Skip to main content
MStev.7
Associate III
October 31, 2022
Question

Is DFU the recommended method for Manufacturing and Field updated to load FW into the SMT32G071?

  • October 31, 2022
  • 5 replies
  • 2767 views

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.

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
November 1, 2022

Which board are we talking about?

The NUCLEO-G071's USB connection goes to the ST-LINK/V2-1 MCU, not the STM32G071

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
MStev.7
MStev.7Author
Associate III
November 1, 2022

Sorry if this is bad information... I have the Nucleo dev baord part number Nucleo-G071Rb that contains the STM32G071. I am trying to get this setup to be able to update the FW on the dev board like we will once the STM32G071 is on our PCBA in production.

MM..1
Chief III
November 1, 2022
On-board ST-LINK debugger/programmer with USB re-enumeration
capability: mass storage, Virtual COM port and debug port

You on Nucleo dont have USB for DFU. IDE programming works over SWD STLINK.

AN2606 define external prog ways read G07x ...

MStev.7
MStev.7Author
Associate III
January 3, 2023

The NUCLEO-G071 contains a STM32F103CBT6 at location U2, this is then connected to the MCU STM32G071. When I mount the Dev board I can simply drag an image (.hex) file onto the mounted device and the image is copied over and the code in the STM32G071 is updated and the device is rebooted. This implies to me that the STM32F103CBT6 supports DFU, however when I look at AN2606 DFU is not listed as a supported method for STM32F103CBT6. In my design I would like to basically reproduce what I can do with the dev kit NUCLEO-G071 for updating the code on the STM32G071. So to achieve this I need to have the STM32F103CBT6 connected to USB and then connected to the STM32G071 SWD link, correct?

Tesla DeLorean
Guru
January 3, 2023

The STM32F103 implementing the ST-LINK has SWD/JTAG connectivity to the G07x, and can act as a USB MSC (Flash Stick), to which you drop binaries, and the ST-LINK programs the G07x.

It does not use USB/DFU connectivity.

No, you'd have to provide USB connectivity directly to the G07x

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
January 3, 2023

If the G07x doesn't support USB (part you chose, documented in AN2606), then you'd need to implement a serial port method, or provide pin header or test points on your board to facilitate SWD/JTAG type connectivity. This would also be helpful for code development and debugging.

For a UART method, perhaps a SiLabs or FTDI USB-to-CMOS Serial type chip

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
MStev.7
MStev.7Author
Associate III
January 3, 2023

Thanks for the information! So since I would like to use this approach to program the G07X, what code needs to be on the STM32F103 to achieve the "Flash Stick" approach? Since this just works this way in the Nucleo dev kit I want to duplicate this in our design.

Tesla DeLorean
Guru
January 3, 2023

ST doesn't provide this code, or IC's programmed for ST-LINK operation. Materially similar to bootloader code on Arduino and RPi Pico type boards. Emulates USB MSC, and fake FAT file system.

What interfaces does your product present to the user?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
MStev.7
MStev.7Author
Associate III
January 3, 2023

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.

  1. I need a method that will allow for a simple copy of a hex file to the G071 to update the code on the device when needed. This interface can be USB to the SWD Link interface or something else. I just can not use special Software to perform the update once the G071 is in the product.
  2. The G071 has a function in the code that needs to send output (text) to the USART that is consumed by a process outside of the G071.

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?

  1. Some USB to SWD link interface.
  2. G071 USART to USB interface.

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.

Tesla DeLorean
Guru
January 4, 2023

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.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..