ThreadX PPPoS on MIMXRT1040-EVK

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

ThreadX PPPoS on MIMXRT1040-EVK

Jump to solution
219 Views
MulattoKid
Contributor III

Hi,

I'm working on getting PPPoS working in ThreadX on an MIMXRT1040-EVK. However, I'm facing an obstacle related to the sending of PPP data over UART.

In ThreadX's nx_ppp_create function one of the parameters is ppp_byte_send, which should send 1 byte over the serial interface to the modem (Quectel EG800Q). To do this I use LPUART_WriteBlocking. However, the modem doesn't respond to using this mechanism:

 

 

void ppp_byte_send(UCHAR byte)
{
    LPUART_WriteBlocking(MODEM_REG_BASE, byte, 1);
}

 

 

I've determined the sequence of bytes being sent in the first message, and when sending these in a single call to LPUART_WriteBlocking it works:

 

 

void ppp_byte_send(UCHAR byte)
{
    uint8_t cmd[] = { 0x7E, 0xFF, 0x7D, 0x23, 0xC0, 0x21, 0x7D, 0x21, 0xC3, 0x7D, 0x20, 0x7D, 0x28, 0x7D, 0x21, 0x7D, 0x24, 0x7D, 0x25, 0xDC, 0xF1, 0xB7, 0x7E };
    LPUART_WriteBlocking(MODEM_REG_BASE, cmd, sizeof(cmd));
}

 

 

Lastly, sending the bytes listed above one by one in a loop also doesn't work.

I'm wondering if there's a different way I should go about implementing the ppp_byte_send function that ThreadX requires? FYI I know my setup works as I've gotten it working in both Zephyr and FreeRTOS, but we're evaluating which RTOS+TCP/IP stack to continue working with.

Thanks,
Daniel

Tags (4)
0 Kudos
1 Solution
201 Views
MulattoKid
Contributor III

I'll blame this on it being Friday afternoon. LPUART_WriteBlocking takes in a pointer to the data, not a single byte, so it should be

 

void ppp_byte_send(UCHAR byte)
{
    LPUART_WriteBlocking(MODEM_REG_BASE, &byte, 1);
}

 

Now it works...!

View solution in original post

0 Kudos
1 Reply
202 Views
MulattoKid
Contributor III

I'll blame this on it being Friday afternoon. LPUART_WriteBlocking takes in a pointer to the data, not a single byte, so it should be

 

void ppp_byte_send(UCHAR byte)
{
    LPUART_WriteBlocking(MODEM_REG_BASE, &byte, 1);
}

 

Now it works...!

0 Kudos