-
Notifications
You must be signed in to change notification settings - Fork 52
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
Data logging programme hangs if DAPLink does not have micro:bit specific features #137
Comments
Ideally we should panic rather than hang if the i2c comms for logging data are not working. Some kind of sensible default timeout should be set in CODAL to stop this a forever-wait. |
The latest CODAL also does an I2C transaction on |
May be related to #191 once we implement the panic code. |
We need to consider that MAINTENACE mode in DAPLink doesn't have I2C features,. So, if we panic when we fail to establish I2C comms, then a micro:bit programme would panic in MAINTENACE mode during codal-microbit-v2/model/MicroBit.cpp Lines 219 to 221 in b587d9c
In this case we would either have: |
Couldn't the log data call timeout, and not log the data, From memory, it may be that it isn't actually hanging, but the timeout becomes very long (say 20 * 20 * 10s) when I2C is not responding. |
After some discussion, we've decided to handle this by only attempting calls which will panic when we actually need to access the flash rather than querying version like so: codal-microbit-v2/model/MicroBit.cpp Line 253 in b587d9c
This way we only panic when we actually do something with DAPLink, with an exception for when we have the ERASE FLASH flag set in codal config, but DAPLink is unreachable, we should NOT panic, otherwise setting that config will immediately halt the board. |
Before PR lancaster-university#114 the string was "BBC micro:bit V2.0", with that PR it was updated to indicate "BBC micro:bit V2.0" for board ID 0x9904 and "V2.X" to any unknown board ID (currently V2.2 boards would still appear as "V2.X"). lancaster-university#114 There is no need for BLE apps or devices to distinguish between different V2 versions, just as we currently don't differentiate between V1.3 and V1.5. Hardcoding this in CODAL to be "BBC micro:bit V2" also removes an I2C call to the interface chip on uBit.init(), which help us better support unofficial interface chip firmwares, like Segger's J-Link. Fixes lancaster-university#208 Related to lancaster-university#137
This MakeCode programme hangs at the data logging block, so the micro:bit only shows the sad face image, it never reaches the beating heart:
microbit-dl-simple.hex.zip
All micro:bits from factory include the I2C functionality, but if somebody builds DAPLink from source they can build the version without it (technically, this is the only version merged in DAPLink upstream right now, the V2 functionality is still in a PR), or users could be using J-Link instead:
https://www.segger.com/products/debug-probes/j-link/models/other-j-links/bbc-microbit-j-link-upgrade/
This DAPLink image can be used for testing:
kl27z_microbit_if.hex.zip
The text was updated successfully, but these errors were encountered: