Unfortunately I can't post the project because I am only using S32DS to configure the RTD and to generate driver config files.
But I was able to work through the issues and unsurprisingly it was a data cache issue with the DMA.
as for the setup issues:
- didn't properly link the scatter gather channels. (each channel needs to link to the next one and last one needs to be marked as final)
- didn't have the tx/rx dma channels priorities correctly (rx higher than tx)
- didn't have the tx/rx dma channel complete interrupts prioritized correctly. (tx higher than rx)
and the data cache issue boiled down to the MemMap.h files.
nxp uses these defines:
#define MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
#include "Mcl_MemMap.h"
/* Pointer to the DMA Initialization Configuration. Based on this configuration pointer, the DMA Driver obtains all information for the Logic Channels and corresponding Channel Configurations. The Pointer is loaded when Dma_Ip_Init() is called. */
static const Dma_Ip_InitType * Dma_Ip_pxInit;
#define MCL_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
#include "Mcl_MemMap.h"
and in the <module_name>_MemMap.h they define what the compiler should do. in this case #pragma GCC section bss ".mcal_bss_no_cacheable"
#ifdef MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
/**
* @file Mcl_MemMap.h
*/
#undef MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
#define ENTERED_MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
#ifndef MEMMAP_MATCH_ERROR
#define MEMMAP_MATCH_ERROR
#else
#ifndef MCL_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
#error "MemMap.h, no valid matching start-stop section defined."
#endif
#endif
/**
* @file Mcl_MemMap.h
*/
#undef MEMMAP_ERROR
#pragma GCC section bss ".mcal_bss_no_cacheable"
#endif
for gcc unless you use the gcc version that comes with the s32ds ide or download their specific version of gcc these types of pragmas aren't supported.
so for now i just went through all the rtd files that used dma and manually added the right section attributes to make them non-cacheable either .mcal_bss_no_cacheable or .mcal_data_no_cacheableso for the snippet above i had to add:
__attribute__((section(".mcal_bss_no_cacheable")))
static const Dma_Ip_InitType * Dma_Ip_pxInit;
i replaced all the <module_name>_MemMap.h with empty dummy files to make the compiler happy which means i have to manually add all the __attribute__((section())) compiler directives.