Hello Marek,
thank you for providing the example, I was defining an external pointer in MCUXpresso instead of an array. I still have a problem with the code because the address which is written as destination address in the dma config structure is not correct.
The generated code in peripherals.c is
/* Destination address extern definition */
extern uint8_t lastInputShiftRegisterData[];
edma_transfer_config_t DMA0_LPSPI_RECEIVE_1BYTE_config = {
.srcAddr = (uint32_t) (&LPSPI1->RDR),
.destAddr = (uint32_t) &lastInputShiftRegisterData[0],
.srcTransferSize = kEDMA_TransferSize1Bytes,
.destTransferSize = kEDMA_TransferSize1Bytes,
.srcOffset = (int16_t) 0,
.destOffset = (int16_t) 0,
.minorLoopBytes = 1U,
.majorLoopCounts = 1U,
};
this results in destAddr = 0x20000074 which is not the correct address.
The following code line in main
volatile uint32_t address = (uint32_t) &lastInputShiftRegisterData[0];
which is the same as used in peripherals.c results in address = 0x20000070 which is the correct address of the last array entry. The arrays are of type uint8_t and the pointer is pointing to the 5th element in the array.
I can not verify if the same problem is true for your provided example because we do not have a RT1060.
We decided to use our own header file for our defines and include this file in peripherals.c (saves a little bit of memory because no pointers are needed). In case we have to modify some settings with mcuxpresso config tools we just have to add the include to peripherals.c again after updating the source code.
Thank you very much for your help!
Stefan