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.
已解决! 转到解答。
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);
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.
-------------------------------------------------------------------------------
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.
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);