I’m trying to understand all the ways you can talk to your STM32-based modules from a computer.
I’ve been working with STM32 chips for a while now for a project of my own, installing software and debugging via JTAG/ST-Link. I’m also aware of the two-wire SWD as a debug option, but I have not used it personally. Then there’s the method to upload firmware via serial interface. And of course there’s the normal case audio input option you provide for “normal”/non-modder users. Finally, it appears you offer a serial interface (via the DebugPort class) for your own factory uses, which is largely unrelated to the bootloader, but as it uses the same serial pin header on the board I’ll go ahead and ask here.
This is roughly how I think you interact with the board from your computer in each case that I’m aware of:
Mechanism Connector CPU-side
JTAG JTAG adapter openocd
SWD JTAG adapter^ openocd
serial boot serial 6 pin^^ stm32loader^^^
audio panel jack audio interface^^^
serial factory serial 6 pin^^ byte commands to serial port
^ TX/RX wires only
^^ TX/RX/GND wires only
^^^ Device must be reset and starts in bootloader mode
Does that all appear to be correct?
My biggest question relates to how the audio bootloader you install in the factory affects the ability to do stm32loader installs via the serial interface. From what I can tell, this is a function provided by STM’s factory bootloader, which it appears you overwrite. Looking at your audio bootloader code (from Elements in particular), I don’t see it doing anything with a USART to provide that function. Is it the case the stm32loader/serial combo only works where the original STM factory bootloader is installed (e.g., a discovery board), or am I missing some information?
I’m familiar with JTAG and debug code with it regularly on my project. It also sounds like I should be able to do the same via SWD with just two pins on the mini JTAG header. The serial interface Is that correct?