This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32F415 factory programmed bootloader

Hi,

Urgently needed

I am writing a custom bootloader for my company's product , which is using STM32F415RGTx micro-controller. My intention is that my bootloader should be able to jump to corresponding memory location or sector , which stores the new incoming firmware files. These files are coming over the air.

My question is:

Should I erase the factory programmed bootloader of ST, which is residing at address 0x0000000 and place my custom bootloader over there, is the factory bootloader re-programmable or is it just One-time programmable.

If it's One-Time programmable then I guess there's no point of erasing it and writing my custom bootloader. In that case I am planning to go with the concept of secondary bootloader.
Then what should be the memory address where the second bootloader should reside.
Can anyone give me a link to find more about it.

Thank you
Abhi

  • If it's One-Time programmable then I guess there's no point of erasing it

    If it's one-time programmable then you won't be able to erase it!

    And I believe it is.

  • Hi Heusti,

    Thanks for your reply, so I should use my bootloader as a secondary boot and then make it jump to desired location to execute any application.
    So , can you give me an idea in what memory location should I keep my BOOTLOADER. Do I have the privilege to use other memory location apart from 0x8000 0000 to 0x80FFFFF.
    These are the addresses assigned for users as SECTOR 1, SECTOR 2, SECTOR 3, so on.

    Where can I find a suitable document for a comprehensive information.

    Thanks
    Abhi

  • "Where can I find a suitable document for a comprehensive information"

    It's an ST product - so the place to look is the ST website.

    They have App Notes describing custom bootloader examples - search for "IAP" (In-Application Programming) ...

    eg, AN3965

  • To be executed at start-up your loader would need to be at 0x08000000, as the BOOTx pins map this to zero in place of the System ROM or RAM, depending on the settings of the pin. The memory is shadowed, ie it appears in the memory map start at 0x00000000 and 0x08000000

    The System ROM is either ROM or OTP, either way you can't erase it.

    ST has Data Sheets, Reference Manuals, and App Notes on IAP an ISP methods, you'd need to review ALL these collectively, and perhaps some Cortex-M4 manuals, to gain a full insight into the system and its behaviour.

  • Hi Westonsupermare,

    Thank you for the info. it is very helpful you certainly saved my time.

    Regards,
    Abhi

  • Hi ,

    So I successfully implemented the bootloader , which I am keeping at an address starting form 0x08000000, basically it occupies Sector 0 , Sector 1 and Sector 2 of ST internal flash memory.
    I am keeping my main application program starting form address 0x0800C000, which is at Sector 3.

    Now my bootloader is able to jump to my main application, but when I see my main application getting executed I noticed it doesn't execute completely. It stops at the very first HAL_Delay(10) statement.

    Can anyone please tell me how to fix this? or where I am mistaken.

    Below is my bootloader code snippet

    #define FIRMWARE_1_FLASH_ADDRESS 0x0800C000
    #define FIRMWARE_1_CODE_ENTRY FIRMWARE_1_FLASH_ADDRESS

    int main(void)
    { //printf("Hello World\n"); if(BlueBrain_SysInit()){ DEBUG_UART.println("I am a Bootloader\n"); }

    FUNC_PTR *func;

    func = (FUNC_PTR *)(*(uint32_t *)(FIRMWARE_1_CODE_ENTRY+4));

    __set_MSP(*(uint32_t *)FIRMWARE_1_FLASH_ADDRESS);

    func();

    }