Re: DATA_DTCM and NETWORKING Hello World


Loic Poulain
 



Le mer. 2 oct. 2019 à 06:28, <alessandro.moroni@...> a écrit :
Hello

I'm just trying to use the NETWORKING using the internal DATA_DTCM.
I can execute the hello world sample with DATA_DTCM=y, but i can't execute it with both:

CONFIG_DATA_DTCM=y
CONFIG_NETWORKING=y

I'm developing in the MIMXRT1050-EVK board.
The problem is that debugging i can't see the step line and the board breaks and i can't reprogram it (to fix the board, i have to use this procedure: https://community.nxp.com/thread/493530#comments ).

I can execute the sample dumb_webserver too with CONFIG_NETWORKING=y, but not with CONFIG_DATA_DTCM=y

AFAIK, Problem is that you can not use highly coupled memory (DTCM) for DMA transfer, since NXP ethernet driver and probably hal driver use transfer buffer for DMA, this breaks. Ideally we should create a kind of __DMAABLE macro for such buffer. To fix that either relocate network data to OCRAM or external SDRAM. Or build with DATA_OCRAM and relocate the code you want in DTCM. 

E.g. 
zephyr_code_relocate(src/main.c DTCM_DATA_BSS)

You'll have to define DTCM section in a custom.ld or in imx rt linker, something like:
+#if (DT_MCUX_DTCM_SIZE > 0) && !defined(CONFIG_DATA_DTCM)
+ DTCM (wx) : ORIGIN = DT_MCUX_DTCM_BASE_ADDRESS, LENGTH = DT_MCUX_DTCM_SIZE
+#endif

Regards, 

Join devel@lists.zephyrproject.org to automatically receive all group messages.