DTCM/ITCM example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

DTCM/ITCM example

2,915件の閲覧回数
gumu
Contributor IV

Hello NXP team,

Do you have the example of DTCM/ITCM as system ram for S32K3?

Thanks!

タグ(1)
0 件の賞賛
返信
5 返答(返信)

2,903件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport
0 件の賞賛
返信

1,858件の閲覧回数
dsantxez
Contributor III

Hi there,

I have adapted my project to use the DTCM in it. I don't use ITCM in this case. I have changed the startup code and the linker is similar, I haved used the unified bootloader one.

Everything works fine with the debugger (starting the code with the S32 Design Studio) but when the board starts the code without it, the program doesn't work. The program starts sending through CAN after 2 seconds. With the debugger and no breakpoints, it works fine. Without the debugger, the board doesn't start sending CAN messages.

 

0 件の賞賛
返信

2,899件の閲覧回数
gumu
Contributor IV

@davidtosenovjan ,

Thank you for your support!

I'd like to know which code need to be modifed if make this feature work well.

According to the AN13388(document number) at P11, need to configure some registers to enable TCM as system RAM.

gumu_0-1677631575971.png

I don't find similar modifications in your sample code.

Can you please help me explain more details.

In addition, I did some data copy tests in ITCM, it worked well. but if ITCM is used for freeRTOS heap,  occurs hardfult.

freeRTOS code as below:

#if ( configAPPLICATION_ALLOCATED_HEAP == 1 )

/* The application writer has already defined the array used for the RTOS
* heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#else
PRIVILEGED_DATA static uint8_t __attribute__ ((section(".itcm0_code"))) ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */

What are the restrictions of ITCM usage?

Thanks!

 

0 件の賞賛
返信

2,880件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Actually my example only shows how to put function to the ITCM (executing) and data to the DTCM (read/write). If you need it for other purpose or other core than it is tightly coupled to you must use backdoor access.

davidtosenovjan_0-1677751916982.png

So it is needed to redefine linker file addresses and so.

 

0 件の賞賛
返信

2,251件の閲覧回数
nxf47333
NXP Employee
NXP Employee

Hi davidtosenovjan

For S32K324, i want to put variables of core0 to core0 dtcm, and variables of core1 to core1 dtcm, how can i setup the memory map in link file, for this case if mean i must use backdoor access.

TKS

0 件の賞賛
返信