Playing with another RiscV chip : ESP32C3 , Jtag adventures

While still having fun with the GD32FV103, which are very good low end MCU, 

 I also bought a few cheap esp32c3 boards on aliexpress, like those ones (esp32c3 32S)


Installed everything, built hello world, all is fine.

Now time to have a real debugger. openocd installed, gdb ready, let's go.

According to the nice documentation, the jtag/serial-to-usb bridge is included in the chip, no need for a FTDI or similar. Great !

Problem is, when connecting the board to my linux, it only detects a CH340 serial to usb chip, which is indeed present (it's the big black rectangle at the bottom).

Ok, no problem, we'll use directly TDI/TDO/TMS/TCK aka GPIO 5/7/4/6 with a ftdi.

Does not work either ....

Ok it seems that the jtag, by default , is routed to the internal USB component which is not connected.

Two options here from what i understood :

* Blowing efuse to change the connection from internal usb to external pins. Should work, but we'll lose 4 gpios, that' s a bit too much. We only have ~ 10 usable on those tiny boards.

* Use GPIO 18/19 as usb.

Ok, let's take a usb breakout board and connect that. And since we are full of hope, we'll not use level translators and connect the 5v D+/D- directly to GPIO19/GPIO18 (the esp32 chips are *NOT* 5v tolerant).



and.... it works!

The connection is very flimsy, you bump the desk and you lose it, but it works.

I'll have to do something better with proper level translators and a better mechanical support.




Comments

Popular posts from this blog

Component tester with STM32 : Part 1 ADC, Resistor

Fixing the INA3221

INA3221, weird wiring