Hi,
I am using LPC4367 tri core controller for our application development. I am facing issue related to on chip RAM availability. Total SRAM available in LPC4367 as per data sheet is 154KB which is used for 3 different cores (M4 / M0App/ M0Sub).
Refer the below screen shot which shows the bifurcation of 154KB RAM
Now, considering the above information we can see that for Core M4 is assigned 40KB RAM for Core M0App I have assigned 32KB RAM and for Core M0Sub core is assigned 16KB (RAMM0Sub16) RAM. After compilation of tri core project I get following result for individual core.
M0App Core:
MCU Setting:
Memory Utilization after compilation:
Above is the Memory utilization of M0App core after implementation of the application code. We can observe that RamLoc32 is utilized around 91 %. But the other memory location like RamAHB32 / RAMAHB16 / RamAhbETB16 are not utilized. As per the MCU setting show above for M0App Core project it is allocating only 32KB rest is unused.
M0Sub Core:
MCU Setting:
Memory utilization after compilation:
Above is the Memory utilization of M4 core after implementation of the application code. We can observe that RamM0sub16 is utilized around 54%. per the MCU setting show above for M0App Core project it is allocating only 16KB rest is unused.
But in this what if the memory goes beyond 16KB then whether it uses the other 2KB RAM? Please confirm.
M4Core :
MCU Setting:
Memory Utilization after compilation:
Above is the Memory utilization of M4 core after implementation of the application code. We can observe that RamLoc40 is utilized around 94 %. But the other memory location like RamAHB32 / RAMAHB16 / RamAhbETB16 are not utilized. As per the MCU setting show above for M0App Core project it is allocating only 40KB rest is unused.
Over all the problem statement is as per the MCU setting of the respective core he RAM allocated to the respective core is less however as per the data sheet it says that over all 154 KB RAM is available and can be used for the three cores. But after doing the MCU setting I checked and found that only the above mentioned RAM is allocated (M4 -40Kb, M0App-32KB and M0Sub-16KB).
How to use the other memory locations using MCU setting or only by __DATA(bank) Attribute?
Do we need to modify linker script in order to used the unused RAM memory ?
Since this is very critical for us w.r.t to our application side please suggest the proper method.
BR,
Gaurav More
已解决! 转到解答。
"Discarded Input Sections" are sections that are present in the code but have discarded by the linker because they are unused - there is no reference to it in the code. To resolve this, you need to place a reference to the data in your code, or decorate the declaration with __attribute__((used))
e.g.
__DATA(RAM3) __attribute__((used)) char M4_Buffer[1024];
This tells the linker that M4_buffer is used, and therefore will not be discarded. Alternatively, you could just wite
main() {
...
*M4_buffer = 0 ;
...
}
(reference the data!)
Hi Alice,
As per your input I made following modification, Following is the MCU setting of the M4 Core
As per the setting you can see that RamAHB32 - RAM3 - 32KB. so to allocate the buffer to this RAM3 bank I wrote below line,
__DATA(RAM3) char M4_Buffer[1024];
after compilation I do not find any change in the memory region
But after checking the MAP file I found the RAM3 location with 0x400 size but that is under "Discarded input sections" if the .Map file.
So you can see that the size with respect to the data in RAM3 is visible but no the variable. Over all I am Not able to allocate the Buffer in RAM memory.
There are some query regarding this issue,
1. What is the Discarded input sections?
2. If the memory configuration is done in MCU setting then why it is not allocation the buffer to the RAM location?
3. Is there any setting in the MCU xpresso IDE regarding the above issue?
Also find the attached code for Reference.
BR
Gaurav More
"Discarded Input Sections" are sections that are present in the code but have discarded by the linker because they are unused - there is no reference to it in the code. To resolve this, you need to place a reference to the data in your code, or decorate the declaration with __attribute__((used))
e.g.
__DATA(RAM3) __attribute__((used)) char M4_Buffer[1024];
This tells the linker that M4_buffer is used, and therefore will not be discarded. Alternatively, you could just wite
main() {
...
*M4_buffer = 0 ;
...
}
(reference the data!)
Hi Converse,
Thanks for the reply,
Noted you point and modified the same now it is clear and able to get the buffer allocated to the require memory location.
Thanks for the solution.
BR,
Gaurav More
Hi Alice,
Thanks for the reply.
I will check by implementing it at my side, since it think it is the only way, but then if assign back to back memory location but still it is not executing as per our expectation.
BR,
Gaurav More