I'm using the S32K148 AVB with S32DS 3.4 and FreeRTOS. Starting with the bundle freertos demo, I'm able to build, load to the EVB and run the blinking LED. Now, I'm trying to add lpuart support to get console input and output. I've added the lpuart1 component and configured the pins to use PC6 and PC7. In rtos.c, I added the rxCallback() function direct from the lpuart example main.c code. In prvSetupHardware(), I added:
LPUART_DRV_Init(INST_LPUART_LPUART_1, &lpUartState1, &lpUartInitConfig1);
LPUART_DRV_InstallRxCallback(INST_LPUART_LPUART_1, rxCallback, NULL);
In rtos_start(), after the prvSetupHardware() call, I added:
LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, (uint8_t *)welcomeMsg, strlen(welcomeMsg), TIMEOUT);
When I run it, it faults out with a bus fault error. Specifically, it says:
Number of threads 1 (Scheduler not yet running)
BusFault: An imprecise (asynchronous) data access error has occurred.
HardFault: A fault has been escalated to a hard fault.
with the debugger stopped at DefaultISR.
I have stepped into that function, all the way down to OSIF_SemaWait() in osif_freertos.c, which eventually calls xTaskCheckForTimeOut() which executes this block of code:
#if ( INCLUDE_xTaskAbortDelay == 1 )
if( pxCurrentTCB->ucDelayAborted != ( uint8_t ) pdFALSE )
{
/* The delay was aborted, which is not the same as a time out,
* but has the same result. */
pxCurrentTCB->ucDelayAborted = pdFALSE;
xReturn = pdTRUE; <<<<--------
}
else
#endif
As soon as the arrowed line is executed the abort occurs.
Does anyone have any clues what might be going on? I've spent many hours on this and am stuck.