lpuart_rcv

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

lpuart_rcv

1,120 Views
intern_praveena
Contributor II

I m using S32K144_64 , i have  done uart send and recive using LPUART1,but nothing is displayed in putty but while debugging its working.here is my code, only send data is working.

#include "Cpu.h"

volatile int exit_code = 0;
uint8_t txbuff = 'A';
uint8_t rxbuff;
uint8_t rem_data;

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
PINS_DRV_SetPinsDirection(PTB,(1<<0));
PINS_DRV_SetPins(PTB,(1<<0));

LPUART_DRV_Init(INST_LPUART1, &lpuart1_State, &lpuart1_InitConfig0);
while(1)
{
//LPUART_DRV_SendData(INST_LPUART1,&txbuff,1);
PINS_DRV_WritePins(PTB,(0<<0));
LPUART_DRV_ReceiveData(INST_LPUART1,&rxbuff,1);
}

0 Kudos
4 Replies

868 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if using non-blocking function you should add waiting for successful RX process. Try below code

uint32_t bytesRemaining;

while(1)
{
   PINS_DRV_WritePins(PTB,(0<<0));
   LPUART_DRV_ReceiveData(INST_LPUART1,&rxbuff,1);

   /* Wait for transfer to be completed */
   while(LPUART_DRV_GetReceiveStatus(INST_LPUART1, &bytesRemaining) == STATUS_BUSY);

   // process receive data here


}

BR, Petr

0 Kudos

868 Views
intern_praveena
Contributor II

Now its printing i changed putty settings but now microcontrlr is not receiving .

0 Kudos

868 Views
intern_praveena
Contributor II

I want to send and receive through microcontroler,but only transmit is working.

can anyone hlp me to resolve this problem?

0 Kudos

868 Views
intern_praveena
Contributor II

hi petr Stancik,

non - blocking is false. The same happen again,if i press '1' its not display.

0 Kudos