Skip to main content
MAlan.1
Associate II
February 22, 2024
Solved

Order of flashing external loader, bootloader and main application.

We have recently received source code from the company that was developing for us. This is our first time using a STM product, so we have some learning to do. We had them build a custom external loader and bootloader in addition to the main application. I have attached an image of the three projects. What is the correct way to build and deploy each project onto a clean board with no code on it?

    This topic has been closed for replies.
    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    February 22, 2024

    The External Loader stages in RAM, and is uploaded there by STM32 Cube Programmer. It has awareness of your hardware implementation, and brings up the external memory of your board, to the point the programmer can load blocks into RAM, and then call a function to write to external memory. Think of like a .DLL loaded on the target MCU / board.

    The Boot Loader lives at the front of FLASH, is called first by the MCU, and it gates access to your Application code, and hopefully provides methods to upload new application code, and recover systems where the application code is missing, or corrupt.

     

    You can upload the Boot Loader and App directly to your fresh board via STM32 Cube Programmer, with the assistance of the External Loader for any QuadSPI / OctoSPI NOR FLASH

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

    6 replies

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    February 22, 2024

    The External Loader stages in RAM, and is uploaded there by STM32 Cube Programmer. It has awareness of your hardware implementation, and brings up the external memory of your board, to the point the programmer can load blocks into RAM, and then call a function to write to external memory. Think of like a .DLL loaded on the target MCU / board.

    The Boot Loader lives at the front of FLASH, is called first by the MCU, and it gates access to your Application code, and hopefully provides methods to upload new application code, and recover systems where the application code is missing, or corrupt.

     

    You can upload the Boot Loader and App directly to your fresh board via STM32 Cube Programmer, with the assistance of the External Loader for any QuadSPI / OctoSPI NOR FLASH

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    MAlan.1
    MAlan.1Author
    Associate II
    February 22, 2024

    Okay thanks!

     

    As for using STMCubeIDE. If I want to edit the external loader (.stldr file), would I build the external loader project (which outputs a file named SmartGauge_Ext_FlashLoader.hex) and edit the .hex file extension into a .stldr extension? I then add the external loader into the Debug Configurations for both the bootloader and main application.

    Tesla DeLorean
    Guru
    February 22, 2024

    The .HEX for the STM32 Cube Programmer External Loader is of not help. The .STLDR is an ELF Object File, and is generated by the Linker. You'd only need to rebuild this if you changed your board, and the pins or part used for the external memory. Say you went for a different size, or brand. ie Micron MT25L128 vs Winbond W25Q256

    Is SmartGauge a tool you're using or the name of your product?

    You should probably walk through this with your vendor.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..