Explanation for IAP RAM reservation on LPC1768

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

Explanation for IAP RAM reservation on LPC1768

Jump to solution
91 Views
avigt
Contributor I

In a legacy LPC1768/9 MBED project I have to maintain, there is a linker script that narrows the usable RAM range on the top end by 32 bytes. In other words, whereas the true size of SRAM is 32k and the start address is 0x10000000, the imposed end address is 0x10007FE0 (instead of 0x10008000 as one would expect). The brief explanation given for this was "used by IAP functions".

Is this true? Is there some fixed-address memory use of the IAP API? If so, does anyone have a documentation link or more explanation as to why this is?

Labels (1)
0 Kudos
Reply
1 Solution
30 Views
jcxz
Contributor III

See paragraph 32.3.2.8 of "User manual" (UM10360):

32.3.2.8 RAM used by IAP command handler
Flash programming commands use the top 32 bytes of on-chip RAM. The maximum stack usage in the user allocated stack space is 128 bytes and it grows downwards.

I don't know what is "on-chip RAM" means in that paragraph. According to memory map LPC1768, it could be either:

  • or: "On-chip SRAM 0x10000000 ... 0x10007FFF"
  • or: "AHB SRAM 0x2007C000 ... 0x20083FFF".

I think it's most likely the first range: 0x10000000 ... 0x10007FFF.

 

But if you don't call IAP from your firmware, then you don't need to worry about these 32 bytes.

View solution in original post

2 Replies
8 Views
JosephGarland
Fresh Out Contributor

It's always intriguing to uncover the "why" behind these hardware-software interactions. My current "why" is usually focused on clearing lines in games. I've been really enjoying Geometry Dash lately, specifically the satisfying feeling of clearing rows and keeping the board from filling up. It's a nice way to unwind and keep my brain engaged with pattern recognition. Regarding your IAP functions query, does that narrow RAM range cause significant limitations in your project?

0 Kudos
Reply
31 Views
jcxz
Contributor III

See paragraph 32.3.2.8 of "User manual" (UM10360):

32.3.2.8 RAM used by IAP command handler
Flash programming commands use the top 32 bytes of on-chip RAM. The maximum stack usage in the user allocated stack space is 128 bytes and it grows downwards.

I don't know what is "on-chip RAM" means in that paragraph. According to memory map LPC1768, it could be either:

  • or: "On-chip SRAM 0x10000000 ... 0x10007FFF"
  • or: "AHB SRAM 0x2007C000 ... 0x20083FFF".

I think it's most likely the first range: 0x10000000 ... 0x10007FFF.

 

But if you don't call IAP from your firmware, then you don't need to worry about these 32 bytes.

%3CLINGO-SUB%20id%3D%22lingo-sub-2420094%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExplanation%20for%20IAP%20RAM%20reservation%20on%20LPC1768%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2420094%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIn%20a%20legacy%20LPC1768%2F9%20MBED%20project%20I%20have%20to%20maintain%2C%20there%20is%20a%20linker%20script%20that%20narrows%20the%20usable%20RAM%20range%20on%20the%20top%20end%20by%2032%20bytes.%20In%20other%20words%2C%20whereas%20the%20true%20size%20of%20SRAM%20is%2032k%20and%20the%20start%20address%20is%26nbsp%3B0x10000000%2C%20the%20imposed%20end%20address%20is%200x10007FE0%20(instead%20of%200x10008000%20as%20one%20would%20expect).%20The%20brief%20explanation%20given%20for%20this%20was%20%22used%20by%20IAP%20functions%22.%3C%2FP%3E%3CP%3EIs%20this%20true%3F%20Is%20there%20some%20fixed-address%20memory%20use%20of%20the%20IAP%20API%3F%20If%20so%2C%20does%20anyone%20have%20a%20documentation%20link%20or%20more%20explanation%20as%20to%20why%20this%20is%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2420094%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ELPC17xx%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2420355%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Explanation%20for%20IAP%20RAM%20reservation%20on%20LPC1768%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2420355%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESee%20paragraph%26nbsp%3B32.3.2.8%20of%20%22User%20manual%22%20(UM10360)%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E32.3.2.8%20RAM%20used%20by%20IAP%20command%20handler%3CBR%20%2F%3EFlash%20programming%20commands%20use%20the%20top%2032%20bytes%20of%20on-chip%20RAM.%20The%20maximum%20stack%20usage%20in%20the%20user%20allocated%20stack%20space%20is%20128%20bytes%20and%20it%20grows%20downwards.%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EI%20don't%20know%20what%20is%20%22on-chip%20RAM%22%20means%20in%20that%20paragraph.%20According%20to%20memory%20map%20LPC1768%2C%20it%20could%20be%26nbsp%3B%3CSPAN%3Eeither%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3Eor%3A%20%22On-chip%20SRAM%200x10000000%20...%200x10007FFF%22%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3Eor%3A%20%22AHB%20SRAM%200x2007C000%20...%200x20083FFF%22.%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI%20think%20it's%20most%20likely%20the%20first%20range%3A%200x10000000%20...%200x10007FFF.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBut%20if%20you%20don't%20call%20IAP%20from%20your%20firmware%2C%20then%20you%20don't%20need%20to%20worry%20about%20these%2032%20bytes.%3C%2FP%3E%3C%2FLINGO-BODY%3E