can use opensda and lpuart1 in the same time?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

can use opensda and lpuart1 in the same time?

832 Views
xyj1230730
Contributor I

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!

0 Kudos
3 Replies

672 Views
razva_tilimpea
NXP Employee
NXP Employee

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

0 Kudos

672 Views
xyj1230730
Contributor I

Thanks for your answer!

My configure about lpuart1 as follows:

2018-12-10_181439.png

2018-12-10_182452.png

/*! 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

0 Kudos

672 Views
razva_tilimpea
NXP Employee
NXP Employee

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:

  1. reduce baud rate of UART
  2. Increase CPU source clock
  3. Change the application to send/read multiple data, not one by one.

If these solutions doesn't work please let me know and  provide more details.

Best regards,

Razvan

0 Kudos