Configure no ITC RAM in iMX RT 105x

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Configure no ITC RAM in iMX RT 105x

1,286 次查看
jakobczyk_woj
Contributor I

I want to configure my FlexRAM for max amount of DTC RAM in runtime, following AN12077. Now I have a working configuration:

DTC 448 KB

ITC 32 KB

OCRAM 32 KB

IOMUXC_GPR_GPR17 is set to 
0b10101010101010101010101010111001.
 
This is working fine.
However, when I set ITC to 0:
0b10101010101010101010101010101001.
the board hangs sometime after start up and my jlink debugger does not connect to the board.
 
AN12077 mentions this:
> If the requested ITCM/DTCM size is 0 Bytes, disable the corresponding TCM in
> IMUXC_GPR_GPR16->INIT_xTCM_EN before configuring the size to 0 Bytes in
> IOMUXC_GPR_GPR14->CM7_CFGxTCMSZ.
However, according to RT1050 reference manual, there is no such bit in IMUXC_GPR_GPR16, neither in IOMUXC_GPR_GPR14.
0 项奖励
回复
5 回复数

1,239 次查看
jakobczyk_woj
Contributor I

Thank you! 

I followed the code in the post (cleared bit 1 to disable ITC). I've also made sure there are no references to ITC memory in my link script.

It hasn't helped...

Now I'm consistently getting a hardfault inside malloc (at it's first use in the code), dereferencing address 0x00. It makes sense, the address is no longer mapped to any memory (previously it was ITC region), though I have no idea what is causing malloc to do so, as I've only disabled ITC in FlexRAM config, leaving memory and section layout in linker script the same.

0 项奖励
回复

1,179 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

To set ITCM/DTCM memory to 0 Bytes you can use FlexRAM partition registers (FLEXRAM_BANK_CFG_SEL and FLEXRAM_BANK_CFG in GPR) without having to write to those xTCM_EN bits.
In case of the malloc function, it is usually not recommended in embedded systems because it uses the default RAM memory, which is limited and may cause issues with the Heap/Stack.
You could change which segment is the default on the Project properties -> C/C++ Build -> MCU Settings.

Best regards,
Omar

0 项奖励
回复

1,167 次查看
jakobczyk_woj
Contributor I

I am well aware of malloc limitations in embedded systems.It's working perfectly fine in my project as long as I don't set ITC size to 0. 

0 项奖励
回复

1,237 次查看
jakobczyk_woj
Contributor I

Maybe there is a bug in malloc and it dereferences 0x00 always, but it doesn't crash when there is ITC memory mapped?
A similar, old issue:
https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/td-p/597123?profile.language=ja 

0 项奖励
回复

1,264 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

These fields appear as reserved because it was determined that the user should not modify them.
For testing FlexRAM reallocation I suggest you follow these steps: Reallocating the FlexRAM - NXP Community

Best regards,
Omar

0 项奖励
回复