Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

I need Passthru source code
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

I need Passthru source code

by GMDII on Sat Mar 13, 2021 6:26 pm

Hello,
I have developed my own board utilizing the ESP-WROOM-32 module. this design was based in part of the Metro M4 Airlift lite.

I need to flash the ESP32 module now and therefore need to create my own Serial passthrough bootloader.

is this source code available for this .uf2 file? I have checked github and don't see a repository for it.

This is in reference to this tutorial https://learn.adafruit.com/upgrading-esp32-firmware/upgrade-an-airlift-all-in-one-board

but does not help with custom boards.

GMDII
 
Posts: 14
Joined: Fri Nov 18, 2011 8:40 pm

Re: I need Passthru source code

by danhalbert on Sun Mar 14, 2021 12:05 am

The source code is here: https://learn.adafruit.com/upgrading-es ... 3041481-18.
it's just an Arduino program compiled for different boards turned into UF2's.

danhalbert
 
Posts: 2379
Joined: Tue Aug 08, 2017 12:37 pm

Re: I need Passthru source code

by GMDII on Mon Mar 15, 2021 6:36 am

Thank you for directing me to the arduino source. It worked but it didn't work as intended.

My board is using ATSAMD51P20A. The ESP32-WROOM module has its own dedicated serial port on serial2 (see variants files below)

In order for me to flash the ESP32 module I had to physically solder Serial1 Tx & RX lines to the module and update the arduino defines as follows:

Code: Select all | TOGGLE FULL SIZE
 #define SerialESP32     Serial1


Now that the ESP32 is flashed and i have unsoldered Serial1 TX & RX and revert the defines back to

Code: Select all | TOGGLE FULL SIZE
 #define SerialESP32     Serial2


To my knowledge I have properly Muxed Serial2 ports according to the datasheet but the module fails to communicate with the processor on serial2.

Can you tell me how I can get the ESP32 module working with dedicated Serial2. The Serial2 pins are only used for the ESP32 Module.

Variants.h serial config
Code: Select all | TOGGLE FULL SIZE
/* WiFi interfaces */

#define SerialESP32      Serial2
#define SerialNina         SerialESP32
#define SPIWIFI             SPI
#define ESP32_GPIO0     89
#define ESP32_RESETN    91
#define SPIWIFI_SS      93
#define SPIWIFI_ACK     90
#define SPIWIFI_RESET   ESP32_RESETN
#define NINA_GPIO0      ESP32_GPIO0
#define NINA_RESETN     ESP32_RESETN
#define NINA_ACK        SPIWIFI_ACK
#define NINA_CTS        SPIWIFI_ACK
#define NINA_RTS        NINA_GPIO0

/*
 * Serial interfaces
 */

// Serial1
#define PIN_SERIAL1_RX      (0)
#define PIN_SERIAL1_TX      (1)
#define PAD_SERIAL1_TX      (UART_TX_PAD_0)
#define PAD_SERIAL1_RX      (SERCOM_RX_PAD_1)
#define SERCOM_SERIAL1        sercom0

// Serial2
#define PIN_SERIAL2_RX      (94)
#define PIN_SERIAL2_TX      (93)
#define PAD_SERIAL2_TX      (UART_TX_PAD_0)
#define PAD_SERIAL2_RX      (SERCOM_RX_PAD_1)
#define SERCOM_SERIAL2        sercom4


Variants.cpp serial config
Code: Select all | TOGGLE FULL SIZE
// Multi-serial objects instantiation
SERCOM sercom0( SERCOM0 ) ;
SERCOM sercom1( SERCOM1 ) ;
SERCOM sercom2( SERCOM2 ) ;
SERCOM sercom3( SERCOM3 ) ;
SERCOM sercom4( SERCOM4 ) ;
SERCOM sercom5( SERCOM5 ) ;
SERCOM sercom6( SERCOM6 ) ;
SERCOM sercom7( SERCOM7 ) ;

Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ;

void SERCOM0_0_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_1_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_2_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_3_Handler()
{
  Serial1.IrqHandler();
}


// sercom for internal ESP32 UART connection
Uart Serial2( &sercom4, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX ) ;

void SERCOM4_0_Handler()
{
  Serial2.IrqHandler();
}
void SERCOM4_1_Handler()
{
  Serial2.IrqHandler();
}
void SERCOM4_2_Handler()
{
  Serial2.IrqHandler();
}
void SERCOM4_3_Handler()
{
  Serial2.IrqHandler();
}


Once again,
Any help is appreciated.

GMDII
 
Posts: 14
Joined: Fri Nov 18, 2011 8:40 pm

Re: I need Passthru source code

by GMDII on Mon Mar 15, 2021 1:55 pm

WOW !

After a good nights rest and fresh start today I instantly noticed that I was declaring the SS pin (93) which is the same as my RX pin.

Serial2 is now working as intended and have successfully reflashed the ESP32 module over serial2.

Thanks !

GMDII
 
Posts: 14
Joined: Fri Nov 18, 2011 8:40 pm

Re: I need Passthru source code

by danhalbert on Mon Mar 15, 2021 2:04 pm

Congrats, and glad to help!

danhalbert
 
Posts: 2379
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.