-
Notifications
You must be signed in to change notification settings - Fork 3k
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
OdinWiFiInterface constructor has side-effects #5211
Comments
We have reproduced this and found the cause. The driver initializes the HAL ticks and configured the CPU clock but it has already been done by mbed OS/ST HAL. This will be fixed in the next release of the driver that most likely will be done this week. |
Great, waiting for the patch! |
ARM Internal Ref: MBOTRIAGE-165 |
Closing since the referenced PR has long since been merged. |
Description
The construction of an instance of OdinWiFiInterface manipulates the system event queue in such a way that previous configuration is lost. In particular, when used with MbedCloudClient, the OdinWiFiInterface can cancel timers that were set up by the cloud client.
Bug
Code behaves differently depending on when an OdinWiFiInterface is instantiated.
For instance
runs as expected,
But
results in a cloud client whose timers do not fire (for example it won't send keep-alive messages to the cloud)
Files using mbed-cloud-client-example-restricted to demonstrate this behavior are attached.
original.log
original.log - the trace debug log of mbed-cloud-client-example-restricted (unmodified).
easy-connect-patch.txt
easy-connect-patch.txt - patch for easy-connect.h
modified.log
modified.log - the trace debug log of mbed-cloud-client-example-restricted (with easy-connect.patch applied)
mbed-cloud-client-example-restricted uses the easy-connect library which instantiates a global OdinWiFiInterface at initialization. The patch modifies easy-connect, so that the OdinWiFiInterface is instantiated dynamically just before it is needed.
original.log shows the mbed cloud-client sending a keep-alive message as the result of a timer expiration
...
[DBG ][mClt]: M2MNsdlInterface::timer_expired - M2MTimerObserver::Registration - Send update registration
[DBG ][mClt]: M2MNsdlInterface::send_update_registration( lifetime 0)
...
These log messages are missing from modified.log.
Target
UBLOX_EVK_ODIN_W2
Toolchain:
GCC_ARM
Toolchain version:
mbed-cli version:
1.1.0
mbed-os sha:
fc18365 Merge pull request #4463 from ARMmbed/release-candidate
DAPLink version:
Expected behavior
Mbed cloud client should behave consistently regardless of when an OdinWiFiInterface is instantiated.
Actual behavior
Timers do not expire and thus Mbed cloud client does not send keep-alive messages in the case where an OdinWiFiInterface is instantiated after the cloud client.
Steps to reproduce
Apply easy-connect-patch.txt to the easy-connect library in mbed-cloud-client-example-restricted. Execute mbed-cloud-client-example-restricted
The text was updated successfully, but these errors were encountered: