cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 Boot Process Clarification?

Mike Hooper
Senior
Posted on June 29, 2017 at 19:28

Hello folks! New to STM (migrating from TI). Please be gentle on me:) I'm working on a custom board design based on the STM32F7 device.

Can someone point me to a simplified tutorial on the boot process for the STM32F7 (yes I've read AN-2606 and AN-3156)? My goal is to design a custom board that, when fresh from the PCB assembly house (i.e. no program in flash) can be programmed via the USB port. I prefer not to add hardware, such as a push button for this function. I would prefer to attach a USB host and have the un-programmed device automatically start the bootloader. My Windows app would then issue the boot loader commands in order to do the initial programming of the device.

In the TI world, the processor (MSP) would invoke the boostrap loader (BSL) in any one of 3 ways: Blank Reset Vector (i.e. the device has not yet been programmed), Software jump to BSL code, and pull-up resistor on PUR pin of the USB peripheral. Since the device had not been programmed (i.e. blank reset vector), the boot loader code began looking for a connected USB device. This worked very reliably for initial firmware programming.

I see that the STM can also search for a USB device, but it appears that the BOOT pin needs to move from a 0 to a 1 to kick off this process, which means attaching some sort of push button to the BOOT pin. IS THIS CORRECT? Is this the only way to start the bootloader? Again, I would prefer NOT to add a BOOT pushbutton switch if possible

Any guidance would be much appreciated.

Thanks!

MikeH

2 REPLIES 2
Posted on June 29, 2017 at 21:52

The Cortex-Mx typically boots from address 0 (ie reset does SCB->VTOR = 0), the logic of BOOTx pins is that it shadows a memory region at 0, being it ROM, FLASH, RAM etc. via the external memory bus.

The processor loads the stack-pointer and program counter from the first two words, and as the PC will point to the code at the native address of the code in ROM, FLASH, etc transfer to the ResetHandler described in the table occurs, and execution proceeds.

Typically you'd pull BOOT0 low externally to ensure your code runs, don't connect it to ground directly, as in production you might want to probe the board and boot it into the System Loader ROM

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on June 30, 2017 at 20:27

Thanks Clive. I'm starting to understand.

So, it sounds like the answer to my original question is, 'yes' you MUST add a way to toggle the BOOT pin to logic level 1 in order to initiate the System Loader in ROM. Correct?

And, apparently in the STMF74xx, the BOOT_ADD1[15:0] comes from the factory pointing to the System bootloader at 0x0010 0000? Correct?

Thanks again!

MikeH