IMXRT1024 NONCACHEABLE SECTION IN STRUCT

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

IMXRT1024 NONCACHEABLE SECTION IN STRUCT

Jump to solution
1,978 Views
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 Kudos
Reply
1 Solution
1,941 Views
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);

 

 

View solution in original post

3 Replies
1,953 Views
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 Kudos
Reply
1,947 Views
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 Kudos
Reply
1,942 Views
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);