IMXRT1024 NONCACHEABLE SECTION IN STRUCT

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

IMXRT1024 NONCACHEABLE SECTION IN STRUCT

跳至解决方案
1,806 次查看
Lukas_Frank
Senior Contributor I

Hi all,

 

I am just trying to create noncacheable section in LPUART EDMA Ring Buffer example. Is it possible to do?

Just like below:

typedef struct OperationDMA

{

AT_NONCACHEABLE_SECTION_INIT(uint8_t rxBuffer[BUFF_SIZE]);//LIKE THIS

AT_NONCACHEABLE_SECTION_INIT(uint8_t rxBuffer[BUFF_SIZE]) = {0}; //OR LIKE THIS

}OperationDMAType;

 

Thanks and Regards.

0 项奖励
回复
1 解答
1,769 次查看
carstengroen
Senior Contributor II

This is not the right way to do this (not proper C). You are declaring a datatype (typedef), not an instance of the structure.

You need to do the typedef (where you declare the datatype), and then do an instance of the typedef. This instance is put in non-cacheable section with the following:

 

 

// Declare the datatype
typedef struct OperationDMA {
  uint8_t rxBuffer[BUFF_SIZE]);
  uint8_t someOtherBuffer[BUFF_SIZE];
} OperationDMAType;
// Make an instance of the datatype just declared (typedef'ed) and place it in non-cachable memory
AT_NONCACHEABLE_SECTION_INIT(OperationDMAType myDMA);

 

 

在原帖中查看解决方案

3 回复数
1,781 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) Is it possible to do?
-- Yes, like this
AT_NONCACHEABLE_SECTION_INIT(uint8_t rxBuffer[BUFF_SIZE])
Have a great day.
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 项奖励
回复
1,775 次查看
Lukas_Frank
Senior Contributor I

Hi Dear @jeremyzhou

 

I tried it before and after post the issue. But it is not working. It is returning error "section attribute not allowed for 'rxBufferInStruct_asNonCachable'

 

rxBufferInStruct_asNonCachable is my parameter name in struct.

Could you help me about How could I do that?

 

Thanks and Regards. 

0 项奖励
回复
1,770 次查看
carstengroen
Senior Contributor II

This is not the right way to do this (not proper C). You are declaring a datatype (typedef), not an instance of the structure.

You need to do the typedef (where you declare the datatype), and then do an instance of the typedef. This instance is put in non-cacheable section with the following:

 

 

// Declare the datatype
typedef struct OperationDMA {
  uint8_t rxBuffer[BUFF_SIZE]);
  uint8_t someOtherBuffer[BUFF_SIZE];
} OperationDMAType;
// Make an instance of the datatype just declared (typedef'ed) and place it in non-cachable memory
AT_NONCACHEABLE_SECTION_INIT(OperationDMAType myDMA);