LWIP bare-metal ethernetif_input() thread safe

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

LWIP bare-metal ethernetif_input() thread safe

1,451 Views
mspenard603
Contributor IV

Hi All,

 I have a bare-metal project with LWIP and Eth being serviced (i.e., ethernetif_input() ) in mail() loop as is recommended per the SDK example and notes I've read. Viz., it is my understanding that ethernetif_input() is not to run in an interrupt context.

My issue with with LWIP and Eth not being serviced quick enough. As I have some GUI code (EwWiz) that inserts enough delay as to lag network io to some large degree.

Therefore, I'm looking for some way to run ethernetif_input() off a GPT based timer. How can I make it interrupt context safe?



0 Kudos
Reply
2 Replies

1,438 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @mspenard603 ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
In my opinion, I'd highly recommend you use the LWIP+ FreeRTOS demo as the template, which can manage the incoming ENET frame, meanwhile, synchronize the signal with the GUI code.
And you can find the LWIP+ FreeRTOS demo in the SDK library.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,422 Views
mspenard603
Contributor IV
Thanks. Were a bit far into our bare-metal project. So RTOS isn't on the table for now.

I did find a solution by utilizing the PIT. And a lock-out mechanism for when it shouldn't run. E.g., in the middle of an f_open() or f_read() etc etc.

Ethernet speeds jumped 10 fold to where they should be.