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
microeval
Associate II
Posted on June 13, 2013 at 06:37

Hi Clive1,

Thanks for your reply,

With the boot-loader I am able to boot from the Image1 and flash the Image2 contents, applying software reset(NIVC_SystemReset()), control will boot from the boot_loader and jump into newly flashed location and executing.

For this need to update 3 parameters in boot loader:

1. Image IVT address,

2. Image Stack pointer,

3. Program counter.

It will jump to the new Image location.

Please ref: 

http://www.actel.com/documents/M2S_AC390_AN.PDF

Posted on June 13, 2013 at 11:44

Ok, not sure how that gets me to the fault handler problem.

So is this a hard fault? When does it occur? At the jump? This could occur if you set the PC to an illegal address, or one that's not ODD. The M3 can only run THUMB (16-bit) code, an EVEN address means ARM (32-bit) code, and will cause the CPU to fault.

To understand the nature of the fault you're either going to have to get the fault handler to output diagnostic information about the location/registers at the fault, or step into the code with a debugger and observe the failure first hand. What does your current debugging tell you about the issue?
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 13, 2013 at 14:44

Hi Clive1

Yes, Your are right. Jumping into the invalid location is causing the Hard_Fault(). By setting the starting address of image, IVT, Stack pointer and Program counter the Issue is resolved.

Thanks,

Ram. 

okelly
Associate II
Posted on February 25, 2015 at 22:12

Hello venkat.ram,

I have a question about your dual boot approach.

I am also using IAR. Did you need to make distinct software images for App-1 and App-2? Suppose it is the same software. Did you need to run the linker twice - Once create an image with base 0x08003000, and again to create an image with base 0x08010000?

I am thinking of doing this with .SREC file format, however, I wonder if I chose a different file format if the programming could be done (somehow) using the one image together with offset information.

Thanks for any suggestions,

Owen

Posted on February 25, 2015 at 22:23

The thread was started by a different OP two years ago, the forum never send me tickler emails.

If you want the flash loader to ''address'' this, then you'd typically want to use a Relocatable Object Format (some variants of .ELF, etc). Hex files like Intel or Motorola tend to be fixed address formats output once the linker has resolved everything.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
okelly
Associate II
Posted on March 03, 2015 at 17:12

I am restricted to SREC format, so my solution has been to generate a linked image in SREC format for each intended load-offset.

In the IAR toolchain, the solution was to create distinct configurations (IAR | Project | Edit Configurations...), each with their own .icf file. Then create a batch that builds multiple configurations at the same time (IAR | Project | Batch build...). 

Thank you for your help.

Owen