求助关于RT1052的AT_NONCACHEABLE_SECTION_INIT问题

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

求助关于RT1052的AT_NONCACHEABLE_SECTION_INIT问题

Jump to solution
3,454 Views
1277185193
Contributor III

基于FreeRTOS系统下使用串口DMA的时候,定义如下缓冲区:

AT_NONCACHEABLE_SECTION_INIT(uint8_t gu1TxBuf[UART_BUF_SIZE]);
AT_NONCACHEABLE_SECTION_INIT(uint8_t gu1RxBuf[UART_BUF_SIZE]);

然后发现缓冲区数组不能正常接收数据,考虑到是定义在SDRAM里的noncacheable区域的问题,改为如下方式后:

volatile uint8_t gu1TxBuf[UART_BUF_SIZE];
volatile uint8_t gu1RxBuf[UART_BUF_SIZE];

程序可以正常运行,但并不知道数据是不是100%没有问题,以前用DMA也没有用过noncacheable区域。

请问是否会有问题?

或者说noncacheable和volatile是不是等效的?

0 Kudos
1 Solution
2,764 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 卢 鲲 ,

   楼主你好!

   DMA相关的buffer, 你还是需要使用noncacheable的特定区域,否则会有问题,这个比较特别。

  不能使用volatile 去代替。


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

1 Reply
2,765 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 卢 鲲 ,

   楼主你好!

   DMA相关的buffer, 你还是需要使用noncacheable的特定区域,否则会有问题,这个比较特别。

  不能使用volatile 去代替。


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------