Skip to main content
Visitor II
March 26, 2021
Solved

STM32F207 CAN2 bootloader

  • March 26, 2021
  • 4 replies
  • 2254 views

in datasheet :

Boot modes At startup, boot pins are used to select one out of three boot options:  Boot from user Flash memory  Boot from system memory  Boot from embedded SRAM The boot loader is located in system memory. It is used to reprogram the Flash memory by using USART1 (PA9/PA10), USART3 (PC10/PC11 or PB10/PB11), CAN2 (PB5/PB13), USB OTG FS in Device mode (PA11/PA12) through DFU (device firmware upgrade).

I want to use a bootloader on CAN2, but also ethernet RMII - the problem is that PB13 is used for CAN2_TX and ETH_RMII_TXD1

the solution is to use for CAN2_TX PB6 - will the bootloader work on PB5, PB6 instead of PB5, PB13?

I have a LQFP100 package and I can't remap ETH_RMII_TXD1.

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    Unfortunately this doesn't work because the bootloader is limited to the interfaces listed in AN2606, section 16 (STM32F2xxxx) and their settings.

    However, the STM32F2xx would only be able to boot via CAN2 if Bootloader V3.x is already factory-programmed:

    Two bootloader versions are available on STM32F2xxxx devices:

    • V2.x supporting USART1 and USART3 - This version is embedded in revisions A, Z and B
    • V3.x supporting USART1, USART3, CAN2 and DFU (USB FS device) - This version is embedded in all other revisions (Y, X, W, 1, V, 2, 3 and 4)

    CAN2_RX and CAN2_TX are fixed, so it is regrettably neither possible to set an option to switch to an alternate pin, nor does it switch alone.

    It looks like the only solution is to create your own bootloader if you want or need to use this STM32F207.

    I am very sorry that I cannot offer a better solution.

    Good luck!

    When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

    /Peter

    4 replies

    Technical Moderator
    March 26, 2021

    Unfortunately this doesn't work because the bootloader is limited to the interfaces listed in AN2606, section 16 (STM32F2xxxx) and their settings.

    However, the STM32F2xx would only be able to boot via CAN2 if Bootloader V3.x is already factory-programmed:

    Two bootloader versions are available on STM32F2xxxx devices:

    • V2.x supporting USART1 and USART3 - This version is embedded in revisions A, Z and B
    • V3.x supporting USART1, USART3, CAN2 and DFU (USB FS device) - This version is embedded in all other revisions (Y, X, W, 1, V, 2, 3 and 4)

    CAN2_RX and CAN2_TX are fixed, so it is regrettably neither possible to set an option to switch to an alternate pin, nor does it switch alone.

    It looks like the only solution is to create your own bootloader if you want or need to use this STM32F207.

    I am very sorry that I cannot offer a better solution.

    Good luck!

    When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

    /Peter

    LUrba.1Author
    Visitor II
    March 29, 2021

    Thanks for the explanation.

    I have two more questions:

    1 - How do I know which version of the loader is loaded in the MCU? (for order)

    2 - I assume that

    "CAN2_RX and CAN2_TX are fixed, so it is regrettably neither possible to set an option to switch to an alternate pin, nor does it switch alone"

    applies only in connection with the bootloader, because on STM32F205RCT6, which I have the opportunity to test, CAN2 works on all pins (Tx on PB6, PB13 - Rx on PB5, PB12). And I rely on the same for the whole STM32F2xx family - or is it different for the STM32F207?

    Technical Moderator
    March 29, 2021
    1. You will find the revision number at the end of the 2nd row of the type marking, in the following example rev V: STM32F207 / VGT6 V
    2. Yes, of course this statement ("...are fixed...") only applies to the bootloader. Within your user program, you have full freedom to use the peripheral devices as you like.

    [edit]Usually it is not possible to order special chip revisions and you always get what is currently on stock - if any.[/edit]

    Regards

    /Peter

    LUrba.1Author
    Visitor II
    March 29, 2021

    Thanks

    Graduate II
    March 29, 2021

    These are very old parts

    Newer parts built on the lessons learned a decade plus ago.

    The F405/F407 were far more popular, and are pin-for-pin compatible (144-pin I used at least) save a pair of differently strapped ones which would typically get accommodated at design time

    LUrba.1Author
    Visitor II
    March 29, 2021

    Thanks - I'll think about it. So far I am in the PCB design phase.