Nuvoton ARM Cortex M0 M4

 Forgot password?
 Register
Search
Hot search: MINI51 NUC M051 M4 NANO
View: 56567|Reply: 2

Compile relocatable firmware using Keil IDE and compiler [Copy this link to quote]

Rank: 1

Post time: 2015-06-05 03:44:14
|Show all posts
We have a multi-app bootloader on Cortex M0. The application starts with bootloader.uvprojx and then switches to one of the two applications namely: fw2000 and fw3000. So we have 3 binaries/executables on our controller at following addresses of the flash program/code memory space: bootloader at 0x0, fw2000 at 0x2000 and fw3000 at 0x3000 .
fw2000 and fw3000 are the same code but these two app firmwares here are compiled using absolute ROM addresses to create fw2000.bin and fw3000.bin. This is done in Keil by setting the address in "Options for target"->"Target"->"IROM1:" -> "Start" address to respective start address .

We have this architecture to update firmware. For that creating bin/hex specific to absolute address is not desirable.

Is there a way to compile a fwXXXX which can be relocatable at both the addresses? Such that, fwXXXX is compiled and the .bin or .hex can be written at any address (in this case 0x2000 or 0x3000).

Use magic Report

Rank: 1

Post time: 2015-06-10 04:04:17
|Show all posts
Does Keil has this in built? because in the "Options for Target" -> C/C++ there are two check boxes "Read-Only Position Independent" and "Read-Write Position Independent". Does this have to do with my objective?

Use magic Report

Rank: 8Rank: 8

Post time: 2015-06-18 14:44:32
|Show all posts
Dear Iron,

You can refer to M451 BSP sample code, FMC_IAP which is under \SampleCode\NuEdu\Smpl_Basic01_FMC_IAP.
In this sample code, AP0 can decide where AP1 will be written to by the setting in map.h.

Thanks and best regards,
Henry/林昌宏.

Use magic Report

You have to log in before you can reply Login | Register

Archiver| Nuvoton ARM Cortex M0 M4

2017-01-17 20:57 GMT+8 , Processed in 0.050798 sec., 9 queries

Powered by Discuz! X2, Release 20111010 © 2001-2011 Comsenz Inc.

English version, Rev. 146, © 2009-2011 Valery Votintsev

To Top