There are two ways to flash a new firmware to your LANA-TNY board:
- USB-C port: Flash new firmware over the USB-C port.
- SWD: Use a dedicated flash/debug probe to flash new firmware (like the WCH-LinkE).
USB-C port
To flash new firmware over the USB-C port, boot the microcontroller in bootloader-mode. To achieve that, keep the BOOT switch pressed while inserting the USB-C cable:
You'll need to install a driver on your computer to recognize the USB-C port.
SWD Interface
Wire up the WCH-LinkE-r0-1v3 flash/debug probe to the SWD pins on the board. Of course, the board needs power. You have two choices:
- Power the board through the flash/debug probe via jumper wires.
- Power the board through the USB-C port. In this case, the board is powered through the USB-C port, and the flash/debug probe is only used for flashing and debugging.
Let's start with the first option - power the board via the flash/debug probe. The flash/debug probe delivers 5V to the LANA-TNY board (which is then further converted into 3V3):
You can see the following signals connected in the figure above:
- 5V: 5V power
- GND: Ground
- SWCLK: SWD Clock line
- SWDIO: SWD Data line
- RST: RST line. The need for this connection depends on the configuration files given to OpenOCD. The configuration file Embeetle gives you by default for the LANA-TNY board does not require this connection.
- TX: [Optional] UART Transmit line
- RX: [Optional] UART Receive line
The TX and RX wires are not essential for flashing and debugging. They are used for UART communication, so they can come in handy if you add print statements to your firmware.
As said before, you can also power the board via its USB-C connector. In that case, you don't need to draw power from the flash/debug probe 5V pin. That would be the only change compared to the previous setup:
After wiring up everything, you still need to install a driver on your computer.
Page last edited January 20, 2025
Text editor powered by tinymce.