Skip to main content
Graduate
June 14, 2024
Question

Program update

  • June 14, 2024
  • 11 replies
  • 2981 views

Hi,

1. is there any tool (GUI) to update program using executable?

2. How to have different modes of programming? (UART/ USB/ sd card)

3. Bootloader mentions: USB OTG FS (PA11/12) in Device mode (DFU: device firmware upgrade). Can external HS phy in FS as a device be used to update program?

 

    This topic has been closed for replies.

    11 replies

    Technical Moderator
    June 14, 2024

    Hello,


    1. is there any tool (GUI) to update program using executable?


    Using STM32CubeProgrammer tool

    SofLit_0-1718375908892.png

     


    2. How to have different modes of programming? (UART/ USB/ sd card)


    Read AN2606 STM32 microcontroller system memory boot mode / Read the table " configuration in system memory boot mode" that corresponds to your device. It describes the different resources and which interface is used for bootloader for that device. SD card is not a part of the ST bootloader you need to develop it yourself.


    3. Bootloader mentions: USB OTG FS (PA11/12) in Device mode (DFU: device firmware upgrade). Can external HS phy in FS as a device be used to update program?


    Same answer as 2.

    GauravKAuthor
    Graduate
    June 21, 2024

    Hi, reading on program update is ongoing.

    I tried using STM32CubeProgrammer and was able to program using ST-Link. 

    but I tried USB FS device with DFU, and STM32CubeProgrammer was able to detect USB and when connect is pressed...the bottom bar keeps on searching and never finishes...this is with STM32F469 discovery kit.

    I tried loading "DFU_standalone" also but could see same.

    Please any suggestions?

    Technical Moderator
    June 21, 2024

    What about boot pin? How you did manage it? & Reset?

    GauravKAuthor
    Graduate
    June 21, 2024

    on kit I see boot 0 and boot 1 are to GND through resistors, I was not able to change those.

    Also I tried pressing RESET button, nothing happened

    I didn't go for having USB FS connected and re-plugging ST-Link cable, since I read board should be powered before connecting USB.

    Reading is on-going, if any suggestions from experts, can speed-up our understanding

    Graduate II
    June 21, 2024

    The features and functions of the ROM will be limited. It's aimed at production programing or debricking in the field. 

    For a better, more tailored, user experience you code your own loader with the rich features you want. One that implements DFU, or MSC for a drag-n-drop update, does serial XMODEM from a terminal app, or checks an SD Card for an update image.

    GauravKAuthor
    Graduate
    June 21, 2024

    I changed Boot0 to 3.3V and was able to do "Start Program" from CubeProgrammer, USB was detected and download looked complete. But it didn't boot to flash.

    So changed again boot0 to GND, but don't see the program updated...

    Is anything missed?

    I used .elf files, 2 numbers, both having different LEDs to be toggled

    Technical Moderator
    June 21, 2024

    So changed again boot0 to GND, but don't see the program updated...


    Did you reset the MCU after changing boot0 to GND?

    GauravKAuthor
    Graduate
    June 21, 2024

    yes reset press tried, also USB cable re-insertion tried.

     

    GauravKAuthor
    Graduate
    June 21, 2024

    CubeProg logs for USB DFU, verify program is failing

     18:47:37 : UR connection mode is defined with the HWrst reset mode
     18:47:37 : USB speed : Full Speed (12MBit/s)
     18:47:37 : Manuf. ID : STMicroelectronics
     18:47:37 : Product ID : STM32 BOOTLOADER
     18:47:37 : SN : 2057355C5231
     18:47:37 : DFU protocol: 1.1
     18:47:37 : Board : --
     18:47:37 : Device ID : 0x0434
     18:47:37 : UPLOADING OPTION BYTES DATA ...
     18:47:37 : Bank : 0x00
     18:47:37 : Address : 0x1fffc000
     18:47:37 : Size : 16 Bytes
     18:47:37 : Bank : 0x01
     18:47:37 : Address : 0x1ffec008
     18:47:37 : Size : 4 Bytes
     18:47:37 : UPLOADING ...
     18:47:37 : Size : 1024 Bytes
     18:47:37 : Address : 0x8000000
     18:47:37 : Read progress:
     18:47:37 : Data read successfully
     18:47:37 : Time elapsed during the read operation is: 00:00:00.003
     18:47:58 : Memory Programming ...
     18:47:58 : Opening and parsing file: usb_fs_update_test_01 - led1.elf
     18:47:58 : File : usb_fs_update_test_01 - led1.elf
     18:47:58 : Size : 27.00 KB 
     18:47:58 : Address : 0x08000000 
     18:47:58 : Erasing memory corresponding to segment 0:
     18:47:58 : Erasing internal memory sectors [0 1]
     18:47:58 : sector 0000 does not exist
     18:47:58 : sector 0001 does not exist
     18:47:58 : Download in Progress:
     18:47:58 : File download complete
     18:47:58 : Time elapsed during download operation: 00:00:00.240
     18:47:58 : Verifying ...
     18:47:58 : Read progress:
     18:47:58 : Error: Data mismatch found at address 0x08000DD0 (byte = 0x00 instead of 0x40)
     18:47:58 : Error: Download verification failed
     18:48:13 : Disconnected from device.

     whereas from ST Link its ok

     18:45:48 : UR connection mode is defined with the HWrst reset mode
     18:45:49 : ST-LINK SN : 066CFF575285514867153350
     18:45:49 : ST-LINK FW : V2J44M29
     18:45:49 : Board : 32F469IDISCOVERY
     18:45:49 : Voltage : 3.25V
     18:45:49 : SWD freq : 4000 KHz
     18:45:49 : Connect mode: Normal
     18:45:49 : Reset mode : Software reset
     18:45:49 : Device ID : 0x434
     18:45:49 : Revision ID : Rev A
     18:45:49 : Debug in Low Power mode is not supported for this device.
     18:45:49 : UPLOADING OPTION BYTES DATA ...
     18:45:49 : Bank : 0x00
     18:45:49 : Address : 0x40023c14
     18:45:49 : Size : 8 Bytes
     18:45:49 : UPLOADING ...
     18:45:49 : Size : 1024 Bytes
     18:45:49 : Address : 0x8000000
     18:45:49 : Read progress:
     18:45:49 : Data read successfully
     18:45:49 : Time elapsed during the read operation is: 00:00:00.007
     18:45:51 : Memory Programming ...
     18:45:51 : Opening and parsing file: usb_fs_update_test_01 - led3.elf
     18:45:51 : File : usb_fs_update_test_01 - led3.elf
     18:45:51 : Size : 27.00 KB 
     18:45:51 : Address : 0x08000000 
     18:45:51 : Erasing memory corresponding to segment 0:
     18:45:51 : Erasing internal memory sectors [0 1]
     18:45:51 : Download in Progress:
     18:45:52 : File download complete
     18:45:52 : Time elapsed during download operation: 00:00:00.902
     18:45:52 : Verifying ...
     18:45:52 : Read progress:
     18:45:52 : Download verified successfully 
     18:46:09 : Disconnected from device.
    Technical Moderator
    June 21, 2024

    Hello,

    You have a data mismatch after Flash verification.

     18:47:58 : Error: Data mismatch found at address 0x08000DD0 (byte = 0x00 instead of 0x40)
     18:47:58 : Error: Download verification failed

    I don't have this board on hands to test. If I find one I'll do it .. 

    If it's urgent I suggest you to contact your local FAE.

    GauravKAuthor
    Graduate
    June 21, 2024

    Please can I know how to reach them...

    Graduate II
    June 21, 2024

    Through your sale channel? Your purchaser should know where you're buying commercial quantities from. Distributors should have their own customer support engineers as part of their agreements with their vendors. Your local ST sales office should also have staffing.

    Availability of any of these resources is likely to be gated by the amount of business you currently do.

    https://www.st.com/content/st_com/en/contact-us.html

    Super User
    June 21, 2024

    Note that in your ST-LINK and DFU logs the files are different: usb_fs_update_test_01 - led3.elf  vs usb_fs_update_test_01 - led1.elf. 

    The DFU log also says "sector ... does not exist" - which is weird. Unless the file ...led1. elf is indeed bad.

     

     18:47:58 : Address : 0x08000000 
     18:47:58 : Erasing memory corresponding to segment 0:
     18:47:58 : Erasing internal memory sectors [0 1]
     18:47:58 : sector 0000 does not exist
     18:47:58 : sector 0001 does not exist

     

     

    GauravKAuthor
    Graduate
    June 22, 2024

    I don't see issue with files...with ST-Link both work...its just I programmed one with St-Link and tried to have another with USB

    Super User
    June 25, 2024

    The "sector 0000/0001 does not exist" messages are very weird. Address 0x08000000 is the internal flash and it does exist.