mqx uncached mem alloc

cancel
Showing results for 
Search instead for 
Did you mean: 

mqx uncached mem alloc

503 Views
johannesstuttne
Contributor II

Hi,

for using the DMA mapped TDSR Register (pointer to Buffer desc start)  for Enet useage, the Buffer Descriptor Data must be stored in the uncached address space. right? Mapping an normal allocated struct with _mem_alloc_align() function kills the Enet controler and terminates with an EBERR interrupt. I assumed that this is a caching problem, because the DMA has no access to the virtual address space allocated by MQX.

So now how can I allocate uncached adressspace in MQX? The function _mem_alloc_asign_uncached() returns the same address like _mem_alloc_asign(). Now when I enable MQX_USE_UNCACHED_MEM in the user_cnfg.h to support the uncached memory functions the compiler terminates with the Error:

/home/nexus/imx6solox/mqx/mcc/examples/pingpong/mcc.c:398: undefined reference to `_mem_alloc_align_uncached'

is there no uncached memory support in the MQX release for the imx6SX?

greets

Labels (1)
0 Kudos
6 Replies

61 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

From what I have seen in the code, they are not supported in the imx6sx BSP.

Best Regards,

Alejandro

0 Kudos

61 Views
johannesstuttne
Contributor II

Can this assumption be verified by someone?!

0 Kudos

61 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

From the latest MQX release for iMX6SX I am not able to find the _mem_alloc_asign_uncached nor the _mem_alloc_asign functions.

And according to a comment from the user_config.h file it seems that uncached memory is no supported.

Best Regards,

Alejandro

0 Kudos

61 Views
johannesstuttne
Contributor II

Hi,

in /mqx/lib/bsp/mqx.h the following functions are declared....

...

#if MQX_USE_UNCACHED_MEM && PSP_HAS_DATA_CACHE

void      *_mem_alloc_uncached(_mem_size);

void      *_mem_alloc_align_uncached(_mem_size, _mem_size);

void      *_mem_alloc_system_uncached(_mem_size);

void      *_mem_alloc_system_zero_uncached(_mem_size);

#else /* MQX_USE_UNCACHED_MEM && PSP_HAS_DATA_CACHE */

#define _mem_alloc_uncached _mem_alloc

#define _mem_alloc_align_uncached _mem_alloc_align

#define _mem_alloc_system_uncached _mem_alloc_system

#define _mem_alloc_system_zero_uncached _mem_alloc_system_zero

#endif /* MQX_USE_UNCACHED_MEM && PSP_HAS_DATA_CACHE */

...

also in /mqx/mqx/sources/kernel/mem.c the _mem_alloc_unchached function allocates memory from a defined area named UNCACHED_POOL.

But in user_config.h the support is disabled by default....

...

/* don't support uncached memory */

#define MQX_USE_UNCACHED_MEM     0

#define MQX_USE_LWMEM_ALLOCATOR  0

...

I can´t believe that the ENET controller is the only Hardware which needs uncached mem addresses....

0 Kudos

61 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

After delving into it I just found that the uncached memory at least in MQX is used in ENET buffers, buffer descriptors and USB buffers too.

/Alejandro

0 Kudos

61 Views
johannesstuttne
Contributor II

Hi Alejandro,

I already assumed that the Enet Buffer Discriptors and other DMA Registers needs Pointers to uncached Memory Areas. But the questions was how to enable this function in the MQX i.mx6SX release.... As mentioned in my first post the compiler terminates with an error when MQX_USE_UNCACHED_MEM is set to 1.

Is it possible that the function is not supported in the imx6 release?!

greets

0 Kudos