Memory map for C

Questions about the BASICtools and MakeItC
Post Reply
brucee
Site Admin
Posts: 33
Joined: Thu Dec 18, 2008 8:45 pm

Memory map for C

Post by brucee »

From help line

What is the memory map for SuperPRO PROplus in C?

For C programs the memory map is controlled by the corresponding lpcXXXX.ld file in the lib directory. We take the stock files from the gcc distributions and make some minor edits. The sites for gcc have documents describing those files, and for the most part we don't try to get fancy with them.

The sorcename.map file is generated by the compiler and shows were things end up in memory.

A tool we tend to use a lot is generating a ASM listing, which shows us both what code and where it is in memory resulting from a C file.



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Memory map for C

Post by basicchip »

>more from help line
>I have a SuperPRO board running MakeItC.
>Case 21 of CSample does not work at default address 7000, but it works fine in the 8000 range.
>At addresses 9000 and up it does not appear to write although the error code is 0.
>Case 20 reads FFFFFFFF at all addresses.
>When I first started experimenting I could have written anything anywhere. Could I have overwritten something?

We haven't updated Csample.c in quite some time, the flash map is wrong for the SuperPRO

Code: Select all

	#if defined ARMexpress || defined LPC2106
				WriteFlash ( 0x7000, (int) buffer, 512, 2106);
	#elsif defined LPC1756
				WriteFlash ( 0x7000, (int) buffer, 512, 1756);
	#else	// all the 21xx in use and 17xx and 11xx and 12xx use the 4K Flash map of the 2138
				WriteFlash ( 0x7000, (int) buffer, 512, 2138);
	#endif				

Gary
Posts: 1
Joined: Mon Mar 10, 2014 6:57 pm

Re: Memory map for C

Post by Gary »

Does Flash.c have to change?

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Memory map for C

Post by basicchip »

No flash.c is up to date (we use it in BASIC). The problem was the original write to 0x7000 would be the same for the LPC1756 as the LPC21xx, but for the address 0x8000 the sector number is different, and that is chosen by the map parameter passed to flash.c write. That map is 1758.

To understand this look at the source for flash.c and the NXP User manual for the LPC175xx, which details the IAP calls to write to flash.

Post Reply