Hi I am trying to run the example edma_transfer_s32K144 to do some simple single block memory transfer. I have connected the UART to teraterm terminal and I get the first text printed asking me for options to choose between single block transfer, loop transfer or scatter/gather but I choose any option 1/2/3 the system hangs.
I checked and pinpointed the problem, it is in readOptionFromConsole method/function. When It executes the function LPUART_DRV_ReceiveData(INST_LPUART1, &buffer[bufferIdx], 1UL) , I get following errors for DMA _SAMPLE_BUFFER.
Multiple errors reported.
1) Failed to execute MI command:
-var-create - * DMA_SAMPLE_BUFFER
Error message from debugger back end:
-var-create: unable to create variable object
2) Failed to execute MI command:
-var-create - * DMA_SAMPLE_BUFFER
Error message from debugger back end:
-var-create: unable to create variable object
3) Failed to execute MI command:
-data-evaluate-expression DMA_SAMPLE_BUFFER
Error message from debugger back end:
No symbol "DMA_SAMPLE_BUFFER" in current context.
4) Failed to execute MI command:
-var-create - * DMA_SAMPLE_BUFFER
Error message from debugger back end:
-var-create: unable to create variable object
5) Unable to create variable object
After this it configures DMA and keeps looping in LPUART_DRV_GetReceiveStatus. Am I setting something in console wrong? I just want to see mem to mem transfer. I ran the code without the console part and it works fine. Can some one suggest how the console code i can improve?
I have attached the project below.
Below is the console code:
void readOptionFromConsole(uint8_t * option)
{
bool strReceived = false;
while(strReceived == false)
{
/* Because the terminal appends new line to user data,
* receive and store data into a buffer until it is received
*/
LPUART_DRV_ReceiveData(INST_LPUART1, &buffer[bufferIdx], 1UL);
/* Wait for transfer to be completed */
while(LPUART_DRV_GetReceiveStatus(INST_LPUART1, &bytesRemaining) != STATUS_SUCCESS);
/* Check if current byte is new line */
if(buffer[bufferIdx] == '\n')
{
strReceived = true;
}
}
/* Check for invalid options */
if((bufferIdx > 2) || (buffer[0] < '0') || (buffer[0] > '3'))
{
PRINTF("Invalid option!\r\n");
*option = 0;
}
else
{
*option = buffer[0];
}
/* Reset buffer index for new reception */
bufferIdx = 0;
}
Thank you.
Please refer to the SDK documentation in the SDK installation folder:
.../NXP/S32DS_ARM_v2018.R1/S32DS/S32SDK_S32K1xx_RTM_3.0.0/doc/html_S32K144/edma_transfer_s32k144_group.html
I tried with RealTerm and it works as expected,but there needs to be the \n line ending.
BR, Daniel