cancel
Showing results for 
Search instead for 
Did you mean: 

Is Dual boot Possible in STM L152 (Flash 128k,RAM 16k ) ?

sagarbussa515
Associate II
Posted on January 01, 2013 at 11:25

Hi,

Is there a way we can have dual boot feature in STM32 L-152(Flash-128k & driver size is 50k).

Thanks

#srec #clarify #bootloader
15 REPLIES 15
Posted on January 01, 2013 at 15:43

What, exactly, do you mean by ''dual boot'' in this context?

Posted on January 01, 2013 at 15:53

Couldn't you just split the space in half and have your secondary application in the upper half (0x08010000) ?

Or if you need a boot loader to pick which image to run, that would likely work too, allocate a 4 or 8K block.

In either case you just have to relocate the vector table to point at your respective firmware images.

Tell your linker, via GUI, linker script or scatter file the base/size of your images as they fit into the 128KB of flash.

The IAP app note may give you some ideas.

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00290444.pdf

Possible memory map

0x08000000 0x02000 Boot Loader

0x08002000 0x0F000 App 1

0x08011000 0x0F000 App 2

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on January 01, 2013 at 17:16

That would have been my question, too ...

If you mean two alternative ''applications'', depending on a condition during startup, I would realise it as two execution paths in one single application.

sagarbussa515
Associate II
Posted on January 01, 2013 at 18:33

Hi Clive1,

Thanks for the reply.

As you said , lets say I have my  App1 running @0x08002000 - 0x0F000  will get the app2 from UART and will write @0x08011000 - 0x0F000 .

Now how can I make it(without bootloader) to boot from address 0x08011000 (App2).

Posted on January 01, 2013 at 19:51

App1 or the bootloader would need to jump to it. The STM32 is always going to start executing firmware in flash at 0x08000000, you can however jump to other code, and change the vector table address (512 byte boundary)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
microeval
Associate II
Posted on June 04, 2013 at 07:05

Hi clive1,

For dual boot in STM32L152 need common Interrupt Vector Table (or) different IVT?

For my case i am able to flash the FW file(IVT+IMAGE) 2nd project location. After software reset control again comes to 1st project but i want to boot from 2nd project. Can you help me.

Thanks,

ram.

Posted on June 04, 2013 at 13:16

As previously stated it is always going to boot from the same address, after that you can relocate the Vector Table using SCB->VTOR to different sections of FLASH, or you can build  a dynamic table in RAM and point to that. I would suggest building each image in a free standing manner, and pick which one I wanted to use.

If the function of the Cortex-M3 is unclear, please refer to the TRM (Technical Reference Manual) for the core, or review Joseph Yiu's book
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
microeval
Associate II
Posted on June 07, 2013 at 15:09

Hi Clive1,

Thanks for your Reply,

Asyou said in the previous post I developed boot-loader , App1&App2like:

Boot_loader: 0x08000000to 0x08002FFF(12k)

App-1: 0x08003000to 0x0800FFFF(51k)

App-2: 0x08010000to 0x0801FFFF(63k) (App-1 and App-2 images size is 34K each)

1.Flashedthe boot-loader.

2.LoadedApp1 through IAR and Upgraded App2 through USART, then did areset(NVIC_SystemReset()),

3.Boot_loadergot executed and jumped to App2 .

4.InApp 2 , at the start I updated SCB->VTOR and initializedBSP.

5.But it is hitting the App_Fault_Handler() 

Can youhelp me in figuring out this issue..? Am I missing anything..?

Thanks,

Ram.
Posted on June 07, 2013 at 16:55

4.In App 2 , at the start I updated SCB->VTOR and initialized BSP.

 

5.But it is hitting the App_Fault_Handler()

 

Can you help me in figuring out this issue..? Am I missing anything..?

I can't make a diagnosis with the information presented. Pay attention to what SystemInit() is doing, and understand/explain what instructions are causing the fault condition.

Pay attention to what the boot loader is doing, how it's setting up the CPU, peripherals, and if it is leaving any interrupts enabled, etc. Ideally the boot loader should transfer control to the application with near boot conditions, or have a hand-over state which is clearly understood and implemented between the two.

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