2022-10-31 03:34 PM
If so, I seem to be missing how to set boot0 (I think) to have STM32CubeProgrammer v2.11.0 recognize the part on the dev board, “No STM32 device in DFU mode connected�? although I can use CubeIDE to program the development board. Just looking for a solution to program and update the code in the part without using CubeIDE. We want to use the USB interface just like when using the CubeIDE, the STM32G071 will be on a PCBA that will be connected to a system via USB for updates.
2023-01-03 01:26 PM
I currently am using the USB connection on the Nucleo for both programing as well as a USART from the G071. Since the Nucleo can support the FW update via a simple copy of a hex file to the board that in turn updates the G071, I want to duplicate the circuit from the Nucleo that has the STM32F103 connected to the G071 SWD interface. To make this functionality work I need to understand what code (bootloader) is running in the STM32F103 that allows for the user to connect to the device over USB and then to simply copy the HEX file to the G071 and then to pull reset. I understand that I could use some interface from USB to the SWD link (2 wire) to program/debug the G071 directly, however taking this approach would also require me to add an interface also for the USART to all for output from the G071 device.
2023-01-03 01:46 PM
Maybe I am going about this the wrong way... I thought that DFU/Flash Stick, etc. mode was the right direction, but if there is a better method of how to do this then please let me know. Here is what I am trying to achieve.
So number 1 is for programing and updates and number 2 is for I/O. Based on how I currently am using the Nucleo you can see how I thought that by simply copying that design I could achieve both requirements.
Since ST will not provide the code (bootloader) for these features in the STM32F103, I need to take a different approach. I agree that using the STM32F103 to perform these simple tasks is overkill, however it was a solution.
So thoughts on the best method to address these requirements?
I currently have the USART2 TX and RX on the G071 tied to the STLINK TX and RX to send data out over the USB interface on the Nucleo.
2023-01-03 04:28 PM
You'd have to write something to ingest .HEX, or. DFU files and process the stream.
You might want another FLASH device to stage the update.
I frequently implement XMODEM in my devices so I can use off-the-self terminal application to push data with its own flow-control, as the FLASH writing needs pacing/waiting
Used .DFU files on SD Cards to facilitate updates.
Perhaps look at the UART protocol. The Arduino MKR WAN 1300 has code to implement (on github), and controls a the NRST, BOOT0, and UART RX/TX pins to push in updates.
2023-01-03 05:07 PM
If your board has accessible SWD connector and you/your customer can use an external ST-LINK, this may be the best way. Modern ST-LINKs have both SWD and VCP (UART) interfaces.
If the built-in bootloader of STM32 supports the UART, it may be used too.
Then the RTS output of USB to UART adapter can be connected to BOOT0 to force entry to the bootloader.
SWD interface is more powerful (especially if NRST and SWO are connected), it allows to debug and completely re-program the MCU (think recovery). But it requires extra software: command-line CubeProgrammer subset or something OpenOCD based. Or a professional flasher tool.
On the other hand, the mass-storage like (or even DFU-like) USB interface is easier for the user, but requires at least one additional chip.
2023-01-03 10:17 PM
Your board need only
and or
some info
ST-Link clone repurposing | Hackaday.io
Building a custom ST-Link V2.1 – EmbedBlog
and for inspiration you can place onboard BLE module and use DFU apk