Configure no ITC RAM in iMX RT 105x

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

Configure no ITC RAM in iMX RT 105x

1,017 Views
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 Kudos
Reply
5 Replies

970 Views
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 Kudos
Reply

910 Views
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 Kudos
Reply

898 Views
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 Kudos
Reply

968 Views
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 Kudos
Reply

995 Views
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 Kudos
Reply