target:S32K148
debug:opensda
Use S32DS example "lpuart_echo_s32k148" to test lpuart, find the pins of lpuart are PTC6 and PTC7, the pins are also needed for opensda. Remote can recieve, but S32K148 receive failed.
Is it possible to use the lpuart1 and opensda for debug in the same time?
thanks!
Hi,
Despite UART pins are connected to OpenSDA you can use in the same time OpenSDA and lpuart because the debug information is not transfer over uart.
Could you share mode details about your setup and what is the behavior on S32K148 side?
Best regards,
Razvan
Thanks for your answer!
My configure about lpuart1 as follows:
/*! lpuart1 configuration structure */
const lpuart_user_config_t lpuart1_InitConfig0 = {
.transferType = LPUART_USING_INTERRUPTS,
.baudRate = 115200U,
.parityMode = LPUART_PARITY_DISABLED,
.stopBitCount = LPUART_ONE_STOP_BIT,
.bitCountPerChar = LPUART_8_BITS_PER_CHAR,
.rxDMAChannel = 0U,
.txDMAChannel = 0U,
};
In loop function,rest on the receive circulation:
while (1)
{
/* Get the received data */
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[i], 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[i++] == '\n')
strReceived = true;
}
/* Append null termination to the received string */
buffer[i] = 0;
Before the loop function,send some data to remote is ok, so the communication is should be no problem, I just test the lpuart1,didn't use another function or gpio.
Best regards
xia
Hi,
If you reduce the baudrate your project works fine?
I suspect that because the UART speed is high the cpu doesn't have time to handle the overhead.
I propose the following solutions:
If these solutions doesn't work please let me know and provide more details.
Best regards,
Razvan