More esp32c3/jtag



 Using the embedded usb/jtag link with the esp32c3 was really unstable. 

Once in a blue moon it was usable  (tried on 2 modules).





So let's consume more pins and have something that works better :

1- Step 1: Be sure you have a recent esptool ( https://github.com/espressif/esptool )

2- Step 2: We'll burn the JTAG_SEL efuse so that the jtag is connected to either the internal usb stuff or the IO4...IO7 pins depending on the state of IO10 at reset

espefuse.py  burn_efuse JTAG_SEL_ENABLE


3- Step3 : Hardwire IO10 to ground, that way we force the jtag on the external pins

4- Step 4: Connect your favorite Jtag probe , the mapping is as follows :

    TDO IO07

    TCK IO06

    TDI  IO05

   TMS IO04


/!\ Important: make sure you have some *not* brain dead code programmed in.

If the chip deep crashes right at start, even the  jtag will not work properly.

The default way to set it up ( from what i understood) is as follows :

* you program the chip using idf.py flash or similar

* you debug without flashing the chip using jtag

It means you have a gdb init files similar to that :

target remote :3333
set remote hardware-watchpoint-limit 2
mon reset halt
flushregs
thb app_main
c


If you try to program the chip using a "load" statement, it does program something
but the end result is not in a working state, some housekeeping stuff seems missing (?), like checksums.





Comments

Popular posts from this blog

Component tester with STM32 : Part 1 ADC, Resistor

Fixing the INA3221

INA3221, weird wiring