cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 FDCAN bootloader

AKG123
Associate II

Hello ST Community,

We are using the STM32G0B1RET6 and have created a custom bootloader using FDCAN. Our setup includes two separate STM32CubeIDE projects:

  1. Bootloader Project

    • Programmed via ST-LINK V2

    • Receives application firmware over FDCAN

    • Writes it to internal Flash and jumps to the application

  2. Application Project

    • Starts at Flash address 0x08004000

    • Compiled and generates a .bin file

I have written and successfully uploaded the bootloader code using ST-LINK V2. Now, I would like to know how to send the .bin file over FDCAN (e.g., using Vehicle Spy 3 or another method), so that the bootloader can receive and flash it correctly.

My questions:

  • What is the recommended way to send the application .bin file over FDCAN?

  • How should I format the FDCAN messages (e.g., 8-byte chunks)?

  • Are there any example tools or scripts to convert a .bin file into FDCAN messages?

  • How can I verify the firmware was flashed and jumped to successfully?

Any guidance, sample projects, or advice would be appreciated.

Thank you!

1 REPLY 1
SirineST
ST Employee

Hello AKG123,

Please find below my answers:

  • What is the recommended way to send the application .bin file over FDCAN?=> Since you are using a custom bootloader, I recommend implementing a custom host on an STM32 board that supports the FDCAN protocol, such as the STM32H7 series. This will allow you to manage the transmission of your application .bin file effectively.

  • How should I format the FDCAN messages (e.g., 8-byte chunks)?=> The format of FDCAN messages depends on your custom bootloader. However, FDCAN, being an advanced version of CAN, offers enhanced features like increased data payloads (up to 64 bytes). You can leverage these features to optimize your message format, possibly using larger data chunks than the traditional 8-byte CAN messages if your bootloader supports it.

  • Are there any example tools or scripts to convert a .bin file into FDCAN messages?=> Currently, STM32CubeProgrammer, the tool provided by ST, does not support FDCAN directly. You can develop your own host application using FDCAN HAL APIs to convert and send .bin files as FDCAN messages.

  • How can I verify the firmware was flashed and jumped to successfully?=> To verify successful flashing and execution of the firmware, you can read back the firmware from memory and check its integrity.

Note: I see your custom bootloader is using FDCAN as a standard CAN, if your goal is to work with standard CAN, you can use ST-LinkV3 and STM32CubeProgrammer with your custom bootloader and AN3154 can be helpful in this case.

With regards

If your question is answered, please close this topic by clicking "Accept as Solution"