Reinitialization of stm32f driver problem #3294
Replies: 1 comment
-
|
That is not the way our stack works. We'll re-open this if necessary, closing for now, we can keep talking here. |
Beta Was this translation helpful? Give feedback.
-
|
That is not the way our stack works. We'll re-open this if necessary, closing for now, we can keep talking here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue with descriptor counter not resetting on driver reinitialization
Problem Description
My goal is: To be able to reinitialize the Mongoose TCP/IP stack (mg_mgr and mg_tcpip) without losing network connectivity, specifically to change IP address at runtime.
My actions were:
My expectation was: After reinitialization, the network stack should work correctly with the new IP address, and ping should work normally.
The result I saw:
My question is: This doesn't seem like normal driver behavior. Is it a bug or is there something I'm missing?
Root Cause Analysis
The static variables in
mg_tcpip_driver_stm32f.care not reset during reinitialization:When hardware Ethernet MAC is reset (via
RCC->AHB1RSTR), DMA descriptors are cleared to initial state, but the software counters retain their old values, causing mismatch.Reproduction Steps
Workaround
The issue resolves if descriptor counter happens to be at maximum value before reinit, suggesting the counters need explicit reset.
Environment
Proposed Solution
Add static variable reset in
mg_tcpip_driver_stm32f_init():Or provide a proper deinitialization function that resets driver state.
Beta Was this translation helpful? Give feedback.
All reactions