cancel
Showing results for 
Search instead for 
Did you mean: 

Does Bootloader is Assembly or other mid level language

Vprabhu
Associate II

I have a question in my mind does bootloader which comes with ARM chips has written in assembly code or c/c++ code ?

How does the code look like , because i have implemented in application programming bootloader concept in my project where board reads the dfu and bin file from the usb stick which is connected to the board.

Where does the bootloader resides in memory ? does it has vector table to start its execution ?

does bootloader program itself makes decision to read BOOT0 and BOOT1 pins ?

1 ACCEPTED SOLUTION

Accepted Solutions

In most STM32 is it achieved through latches and logic gates, which alter the behaviour of the address decode logic. ie NOT software

In some of the dual boot devices the system loader runs, and has a path which checks the latched state of the boot pins, along with the viability of the application code in both flash banks, nominally checking if the Initial SP and PC pointer to reasonable addresses, and are not blank (0xFFFFFFFF)

You need to place the image you want to start at the base of flash (0x08000000), and you can control execution from that point on. You could put your own loader here, and have an application image deeper into flash.

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

View solution in original post

3 REPLIES 3

Looks like any other application​ that runs on the same microcontroller.

Uses the same vector table method and functionality.

The BOOT pins typically control how memory is mapped when the processor starts, and thus controls where the initial vectors are pulled from. Might also describe this as a paging or shadowing strategy.

Basic microcontroller stuff. Perhaps a review of the ARM TRM and associated support materials would be enlightening?​

The system load is held in ROM/OTP and is visible within the addressable range of the microcontroller.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Vprabhu
Associate II

thanks for your answer, yes i need to brush up my basic knowledge - agreed,

One more questions now Bootloader being same as like application program residing in OTP and actual application residing in Flash , on reset which program decides where to boot from depending on BOOT pins?

if Boot pin 0,1 - Run bootloader code from System memory

If Boot pin 10, - Run from flash memory

where these decisions are made , if in Bootloder code itself ,does on every reset the program starts from system memory to to detect BOOT pin and then jump to flash to run the application ? Please share your knowledge.

In most STM32 is it achieved through latches and logic gates, which alter the behaviour of the address decode logic. ie NOT software

In some of the dual boot devices the system loader runs, and has a path which checks the latched state of the boot pins, along with the viability of the application code in both flash banks, nominally checking if the Initial SP and PC pointer to reasonable addresses, and are not blank (0xFFFFFFFF)

You need to place the image you want to start at the base of flash (0x08000000), and you can control execution from that point on. You could put your own loader here, and have an application image deeper into flash.

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