2021-08-08 11:21 PM
Hello together,
I have a question regarding caching on AzureRTOS ThreadX/NetXDuo. At the moment I am switching from freeRTOS + lwIP to AzureRTOS ThreadX + NetXDuo. So far everything works but I have some questions regarding caching.
I know that the ethernet 2 descriptiors DMARxDscrTab + DMATxDescrTab
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection"))); /* Ethernet Tx DMA Descriptors */
uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE] __attribute__((section(".RxArraySection"))); /* Ethernet Receive Buffers */
must be protected by the MPU to avoid caching due to DMA access. So far no problem, I have set the regon to "Device" so that they can't be cached. Now on AzureRTOS NetXDuo it seem that Rx_Buff is not needed as this is allocated by the general byte-pool of AzureRTOS.
In my case the buffer is called nx_byte_pool_buffer.
#if defined ( __ICCARM__ ) /* IAR Compiler */
#pragma location = ".NetXPoolSection"
#elif defined ( __CC_ARM ) /* MDK ARM Compiler */
__attribute__((section(".NetXPoolSection")))
#elif defined ( __GNUC__ ) /* GNU Compiler */
__attribute__((section(".NetXPoolSection")))
#endif
/* USER CODE END NX_Pool_Buffer */
static UCHAR nx_byte_pool_buffer[NX_APP_MEM_POOL_SIZE];
static TX_BYTE_POOL nx_app_byte_pool;
So what about caching on this general byte pool as all threads and byte storages are allocated from it.
Many thanks in advance.
Solved! Go to Solution.
2021-11-04 01:41 AM
Hello @ESawa.1 ,
Sorry for the delay. Here are the answers to your questions:
a- Yes, the assumption is correct.
b- The entire pool has to be set as device (disable caching) because buffers used by DMA are inside it.
It is possible to separate the buffers from the pool in case disabling cache on the pool is inconvenient.
Please click on Select as Best if my post fully answered your question. This will help other customers with the same issue to find the solution faster!
BeST Regards,
Walid
2021-08-26 06:32 AM
Hello @ESawa.1 ,
Your questions have been raised internally. I will keep you posted.
BeST Regards,
Walid
2021-08-26 06:50 AM
Great I am looking forward to hear from you.
Best regards,
Eric
2021-10-27 11:37 PM
Hey together,
@Walid ZRELLI are there any news regarding my question?
Best regards,
Eric
2021-11-04 01:41 AM
Hello @ESawa.1 ,
Sorry for the delay. Here are the answers to your questions:
a- Yes, the assumption is correct.
b- The entire pool has to be set as device (disable caching) because buffers used by DMA are inside it.
It is possible to separate the buffers from the pool in case disabling cache on the pool is inconvenient.
Please click on Select as Best if my post fully answered your question. This will help other customers with the same issue to find the solution faster!
BeST Regards,
Walid
2021-11-04 01:53 AM
Dear @Walid ZRELLI ,
thanks for checking this topic again. This answers my question almost complete. The only thing I would like to know is if there is an example how to separate the buffers.
As I understand NetXDuo all packets (TCP & UDP) are put into the "packet pool".
Best regards,
Eric
2021-11-04 02:29 AM
Hello @ESawa.1
We don’t have/provide an example using split of the packet buffers.
BeST Regards,
Walid