Flashing with jtag on ESP32_WROOM module for the first time resets indefinitely

CKiamy
Posts: 19
Joined: Wed Nov 23, 2022 3:01 pm

Flashing with jtag on ESP32_WROOM module for the first time resets indefinitely

Postby CKiamy » Tue Mar 07, 2023 4:16 pm

Hello everyone,

I have made a custom board that uses the esp32-wroom-32ue module. The way I flash this guys is by using the JTAG connections, a jlink and the openocd script:

openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp build/myCode.bin 0x50000"

This works on devices that have been previously flashed via UART. Nevertheless devices that are "out of the box" and have never been flashed display a weird behaviour when flashing via JTAG. Once the devices are flashed, the program will not run. After plugging UART to the device and opening up the terminal, the following message is displayed multiple times per second.

  1. rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
  2. configsip: 0, SPIWP:0xee
  3. clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
  4. mode:DIO, clock div:2
  5. load:0x3fffeba4,len:4
  6. load:0x4009f000,len:3248
  7. entry 0x4009f574
  8. �OHAI�ets Jul 29 2019 12:21:46

The only way to make the device actually work is by flashing it first via UART, and then jtag becomes usable again. Why is this? I would like to use the jtag connections only right out of the box.

ESP_Sprite
Posts: 9715
Joined: Thu Nov 26, 2015 4:08 am

Re: Flashing with jtag on ESP32_WROOM module for the first time resets indefinitely

Postby ESP_Sprite » Wed Mar 08, 2023 12:50 am

Looks like you're not programming the 2nd stage bootloader binary.

CKiamy
Posts: 19
Joined: Wed Nov 23, 2022 3:01 pm

Re: Flashing with jtag on ESP32_WROOM module for the first time resets indefinitely

Postby CKiamy » Wed Mar 08, 2023 6:10 am

ESP_Sprite wrote:
Wed Mar 08, 2023 12:50 am
Looks like you're not programming the 2nd stage bootloader binary.
Where can I find/generate the .bin file for the 2nd stage bootloader? And to which offset should I flash it to the esp32?

ESP_Sprite
Posts: 9715
Joined: Thu Nov 26, 2015 4:08 am

Re: Flashing with jtag on ESP32_WROOM module for the first time resets indefinitely

Postby ESP_Sprite » Wed Mar 08, 2023 8:09 am

It depends, bootloaders can be customized and have different versions. Easiest way may just to install ESP32 Arduino, flash 'Hello world' or another example application, and then flash your binary over that like you did before.

Who is online

Users browsing this forum: No registered users and 188 guests