Keil project porting issue ..

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Keil project porting issue ..

304 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bmentink on Sun Aug 22 19:00:22 MST 2010
Hi All,

I have just ported across the Keil secondary bootloader code to the LPCXpresso platform. I have everything compiling/linking now except for one piece of code ..

The code is from memory.c:


Quote:
  Prepare_Copy((unsigned int *)&Load$$RW_IRAM1$$Base,(unsigned int *)&Image$$RW_IRAM1$$RW$$Base,(unsigned int)&Image$$RW_IRAM1$$RW$$Length);
  Prepare_Zero((unsigned int *)&Image$$RW_IRAM1$$ZI$$Base,(unsigned int)&Image$$RW_IRAM1$$ZI$$Length);



From hunting around, it seems it is some specific Keil platform labels so that you can find the location and size of the built image at compile time .. what it's doing I am not sure.

Is there anything equivalent in LPCXpresso? :confused:

Many Thanks,
Bernie
0 Kudos
6 Replies

295 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bmentink on Wed Aug 25 14:25:17 MST 2010

Quote: henri
Did you get the code working? I have the same requirements, if you would like to share your code that would be great! :)



Hi Henri,

I actually went back to the NXP LPCxpresso example code as I found it does not take up 64k at all, in fact a release build compiles in at ~6k. (after stripping out the LCD stuff .. very easy)

See this thread --> http://knowledgebase.nxp.com/showthread.php?t=64
CodeRedSupport explained it quite well.

You just have to alter a few defines to get it to take up the 1st two blocks (i.e 8k) and tell it where to start your application and what the new block size is (4k for the 1st 64K of flash)

I will let you know if it works, I am getting hardware soon ..

Cheers,
Bernie
0 Kudos

295 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by henri on Tue Aug 24 13:50:59 MST 2010
Did you get the code working? I have the same requirements, if you would like to share your code that would be great! :)
0 Kudos

295 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bmentink on Mon Aug 23 21:09:24 MST 2010
Thanks :)
0 Kudos

295 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Aug 23 13:14:56 MST 2010
If you look in the startup code, you will see how we copy data using symbols from the linker script. And look in the linker script to see the symbols that are generated.
0 Kudos

295 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bmentink on Mon Aug 23 12:34:39 MST 2010
Thanks, I had allready seen that.

However, that code takes up 64k, the original NXP code only takes up 16k, I don't want to waste 64k of my flash with the bootloader.

I thought if I can port the original "as is" then I could get a similar size.

I have everything compiled in under 16K so have achieved that ... all I want to know is what those two lines of code do so I can do the equivalent in GNU C.

Cheers,
Bernie
0 Kudos

295 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by renan on Mon Aug 23 04:12:22 MST 2010
There is a version for the LPC1768 here:
http://support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects

Renan
0 Kudos