-
Notifications
You must be signed in to change notification settings - Fork 3k
resolve lwip init twice issue #4444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -469,6 +469,7 @@ nsapi_error_t mbed_lwip_emac_init(emac_interface_t *emac) | |||
eth_arch_enable_interrupts(); | |||
#endif | |||
|
|||
netif_inited = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tab used? please fix alignment
As this change is in the generic, how was this tested? It touches wifi, what about the ethernet? any other platform? This variable is set in |
We set this netif_inited here is because there's multiple place doing init of the lwip. The first time is by our RTWInterface constructor, the second time is during mbed_lwip_bringup in RTWInterface.connect(). |
resolve wifi example test fail before lwip is init
@geky @kjbracey-arm Can you please review? |
RTWInterface calls mbed_lwip_init() in constructor, and calls mbed_lwip_bringup() in its connect() when a wifi connection is requested.
The problem is that mbed_lwip_init() calls mbed_lwip_emac_init() without setting netif_inited to true, so mbed_lwip_emac_init() ends up called twice. Hope this helps. |
bump |
For the EMAC case, I think the proper place to set netif_inited is in mbed_lwip_init, iff mbed_lwip_emac_init() returns OK.
|
As I understand, this is still not completely fixed @tung7970 ? |
@0xc0170 The problem is mbed_lwip_emac_int is called twice, once in mbed_lwip_init(), and the other in mbed_lwip_bringup_2(). The bug was introduced in the EMAC backward fix. As long as netif_inited is correctly set to true after it's inited, wifi example should work properly. Either @Archcady's fix or the patch I posted should work. |
/morph test-nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
[1497558667.02][CONN][RXD] DNS: query "connector.mbed.com" => "(null)"
[1497559442.79][CONN][RXD] TCP client IP Address is 10.118.13.255
[1497564549.07][CONN][RXD] DNS: query "connector.mbed.com" => "(null)"
[1497565521.38][CONN][RXD] TCP client IP Address is 10.118.13.255 So looks like all the failures were LWIP network failures when trying to communicate with developer.mbed.org ! |
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
Seems like network issue was back again the last weekend ? I restarted one job to confirm, waiting for a result |
/morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
resolve wifi example test fail before lwip is init
We find for REALTEK_RTL8195AM target, the wifi example will hang at mbed_lwip_bringup().