Hello! I can't solve the problem. May be you have some explanation or
advice what to check?

System hangs after first byte received using ppos_input
This function invokes in UART RX interrupt:

void USART1_RxCpltCallback(void)
{
u8 v;
v = st.ppprxd;
pppos_input(st.ppp, &v, 1);
USART1_RxEnable();
}

I also tried to collect a packet and send with pppos_input_tcpip by timeout
timer interrupt. Hangs too:
// After 2ms of last byte received
void Timer5_PeriodElapsed(void)
{
u16 i;
if (0 != usartpppst.rxcnt)
{
pppos_input_tcpip(st.ppp, usartpppst.rxbuf, usartpppst.rxcnt);
}

static u32_t output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
{
HAL_UART_Transmit(&huart1, data, len, 0xFFFF);
return len;
}

Initialization procedure in main thread:

tcpip_init(ppp_init_done, (void*)&init);
while (! init)
vTaskDelay(1 / portTICK_RATE_MS);

st.ppp = pppapi_pppos_create(&st.netif,
       output_cb, status_cb, 0);
printf("PPP=%lu\r\n", (u32)st.ppp);

pppapi_set_default(st.ppp);

ppp_set_auth(st.ppp, PPPAUTHTYPE_PAP, "pppclient", "12345678");

holdoff = 0;
pppapi_connect(st.ppp, holdoff);

vTaskDelay(100 / portTICK_RATE_MS);
USART1_RxEnable();

HAL uart interrupt preemption priority = 6
HAL systick priority = 5 (used by FreeRTOS)
configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY = 5

lwiopts.h
#define NO_SYS                          0
#define PPP_INPROC_IRQ_SAFE 1
#define LWIP_TIMERS                     1
#define LWIP_TCPIP_CORE_LOCKING         1
#define SYS_LIGHTWEIGHT_PROT            1
#define MEM_LIBC_MALLOC                 0
#define MEMP_MEM_MALLOC                 0
#define PPP_SERVER                      1
#define PAP_SUPPORT 1
#define LWIP_PPP_API 1
#define TCPIP_THREAD_STACKSIZE 200
#define DEFAULT_THREAD_STACKSIZE 200
#define TCPIP_MBOX_SIZE                 20
#define DEFAULT_THREAD_PRIO 3
#define DEFAULT_THREAD_PRIO 3
#define DEFAULT_RAW_RECVMBOX_SIZE 20
#define DEFAULT_UDP_RECVMBOX_SIZE 20
#define DEFAULT_TCP_RECVMBOX_SIZE 20
#define DEFAULT_ACCEPTMBOX_SIZE 20

Thanks in advance!

--
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to