cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader behavior

davidra7
Associate II

Hi,

I need some help to understand the behavior of the bootloader.

Currently I use STM32F746 but I will move to STM32F778AI next week.

I have several needs from bootloader:

  1. Load bootloader if there is no user application.
  2. Load user application on start ( if exist ).
  3. Jump from user application to bootloader.
  4. Jump from bootloader to user application.

I started working on it and 3 out of 4 issues working great...

When BOOT0 pin is 0 ( 0V ) user application load on start and I can jump to bootloader and back.

But I can't do #1 - this only works when BOOT0 is 1 ( 3.3V ).

Explanation:

I connect to bootloader and mass erase flash .

Reset STM32F746 .

Can't enter to bootloader when BOOT0 is 0 but automatically enter to bootloader when BOOT0 is 1.

Any ideas ?

Thanks!!

David

3 REPLIES 3
Bob S
Principal

Is this your own bootloader or the built-in bootloader? If it is the built-in bootloader, I thought it was supposed to run the bootloader if there was no code loaded in FLASH (though I don't know exactly how it checks for "valid code", maybe looking for stack pointer and reset vector at 0x08000000). But looking at AN2606 that does not appear to be the case for the STM32F74xxx family. The F77xx family is different and does appear to look for "valid code" in at least some situations.

I should take a look and check what the current rules are, but yes it used to check from RAM addresses for the SP, and odd, non-zero, non -1 values for the PC

The BOOT pins used to directly latch the memory shadowed at zero, but this has evolved over time, where now it vectors through the ROM.

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

Thanks for help !

It is the built-in bootloader. The purpose was to check if built-in bootloader work for my needs.

I will use STM32F778AI so I will check when I get the board.

I saw in AN2606 for STM32F77xxx that there is tests that check "if the code in boot address is valid" (p.191) and "if boot address is in ram memroy ...".

Can I assume that this tests check if STM32F77xxx have valid code ? ( for example not erased )