Skip to content

Arduino M0 board crashes when setting BLE handle from data buffer #370

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

Merged

Conversation

fabik111
Copy link
Contributor

@fabik111 fabik111 commented Oct 3, 2024

This PR solves the issue of crashes and hangs on M0 board when assigning the variable uint16_t handle in the methods ATTClass::readOrReadBlobReq and ATTClass::writeReqOrCmd as reported also here.

The problem was identified, also, trying to write a characteristic exposed by Arduino Nano RP2040 and Arduino MKR1010 from other Arduino boards.

Copy link

github-actions bot commented Oct 3, 2024

Memory usage change @ 2e66711

Board flash % RAM for global variables %
arduino:mbed_nano:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 +20 - +20 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018:mode=on 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:unor4wifi 🔺 +32 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 +16 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 +16 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Central/LedControl
flash
% examples/Central/LedControl
RAM for global variables
% examples/Central/PeripheralExplorer
flash
% examples/Central/PeripheralExplorer
RAM for global variables
% examples/Central/Scan
flash
% examples/Central/Scan
RAM for global variables
% examples/Central/ScanCallback
flash
% examples/Central/ScanCallback
RAM for global variables
% examples/Central/SensorTagButton
flash
% examples/Central/SensorTagButton
RAM for global variables
% examples/Peripheral/Advertising/EnhancedAdvertising
flash
% examples/Peripheral/Advertising/EnhancedAdvertising
RAM for global variables
% examples/Peripheral/Advertising/RawDataAdvertising
flash
% examples/Peripheral/Advertising/RawDataAdvertising
RAM for global variables
% examples/Peripheral/BatteryMonitor
flash
% examples/Peripheral/BatteryMonitor
RAM for global variables
% examples/Peripheral/ButtonLED
flash
% examples/Peripheral/ButtonLED
RAM for global variables
% examples/Peripheral/CallbackLED
flash
% examples/Peripheral/CallbackLED
RAM for global variables
% examples/Peripheral/EncryptedBatteryMonitor
flash
% examples/Peripheral/EncryptedBatteryMonitor
RAM for global variables
% examples/Peripheral/LED
flash
% examples/Peripheral/LED
RAM for global variables
%
arduino:mbed_nano:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0
arduino:megaavr:uno2018:mode=on 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:renesas_uno:unor4wifi 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrwifi1010 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0
arduino:samd:nano_33_iot 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0
Click for full report CSV
Board,examples/Central/LedControl<br>flash,%,examples/Central/LedControl<br>RAM for global variables,%,examples/Central/PeripheralExplorer<br>flash,%,examples/Central/PeripheralExplorer<br>RAM for global variables,%,examples/Central/Scan<br>flash,%,examples/Central/Scan<br>RAM for global variables,%,examples/Central/ScanCallback<br>flash,%,examples/Central/ScanCallback<br>RAM for global variables,%,examples/Central/SensorTagButton<br>flash,%,examples/Central/SensorTagButton<br>RAM for global variables,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>flash,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>RAM for global variables,%,examples/Peripheral/Advertising/RawDataAdvertising<br>flash,%,examples/Peripheral/Advertising/RawDataAdvertising<br>RAM for global variables,%,examples/Peripheral/BatteryMonitor<br>flash,%,examples/Peripheral/BatteryMonitor<br>RAM for global variables,%,examples/Peripheral/ButtonLED<br>flash,%,examples/Peripheral/ButtonLED<br>RAM for global variables,%,examples/Peripheral/CallbackLED<br>flash,%,examples/Peripheral/CallbackLED<br>RAM for global variables,%,examples/Peripheral/EncryptedBatteryMonitor<br>flash,%,examples/Peripheral/EncryptedBatteryMonitor<br>RAM for global variables,%,examples/Peripheral/LED<br>flash,%,examples/Peripheral/LED<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0
arduino:megaavr:uno2018:mode=on,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:renesas_uno:unor4wifi,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0
arduino:samd:mkrwifi1010,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0
arduino:samd:nano_33_iot,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Oct 3, 2024
Copy link
Contributor

@pennam pennam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabik111 could you check why spellcheck workflow is failing?

@pennam
Copy link
Contributor

pennam commented Mar 10, 2025

@fabik111 could you check why spellcheck workflow is failing?

I think it is related to this #376 (comment)

@per1234
Copy link
Contributor

per1234 commented Mar 10, 2025

it is related to this #376 (comment)

Correct, and I already fixed the problem in #382. So the PR only needs to be rebased, which will trigger a new spell check run using the modernized infrastructure from #382

@pennam
Copy link
Contributor

pennam commented Mar 10, 2025

Thank you @per1234 👍

Copy link

Memory usage change @ eef16ce

Board flash % RAM for global variables %
arduino:mbed_nano:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 +20 - +20 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018:mode=on 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:unor4wifi 🔺 +32 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 +16 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 +16 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Central/LedControl
flash
% examples/Central/LedControl
RAM for global variables
% examples/Central/PeripheralExplorer
flash
% examples/Central/PeripheralExplorer
RAM for global variables
% examples/Central/Scan
flash
% examples/Central/Scan
RAM for global variables
% examples/Central/ScanCallback
flash
% examples/Central/ScanCallback
RAM for global variables
% examples/Central/SensorTagButton
flash
% examples/Central/SensorTagButton
RAM for global variables
% examples/Peripheral/Advertising/EnhancedAdvertising
flash
% examples/Peripheral/Advertising/EnhancedAdvertising
RAM for global variables
% examples/Peripheral/Advertising/RawDataAdvertising
flash
% examples/Peripheral/Advertising/RawDataAdvertising
RAM for global variables
% examples/Peripheral/BatteryMonitor
flash
% examples/Peripheral/BatteryMonitor
RAM for global variables
% examples/Peripheral/ButtonLED
flash
% examples/Peripheral/ButtonLED
RAM for global variables
% examples/Peripheral/CallbackLED
flash
% examples/Peripheral/CallbackLED
RAM for global variables
% examples/Peripheral/EncryptedBatteryMonitor
flash
% examples/Peripheral/EncryptedBatteryMonitor
RAM for global variables
% examples/Peripheral/LED
flash
% examples/Peripheral/LED
RAM for global variables
%
arduino:mbed_nano:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0 20 0.0 0 0.0
arduino:megaavr:uno2018:mode=on 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:renesas_uno:unor4wifi 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrwifi1010 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0
arduino:samd:nano_33_iot 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0
Click for full report CSV
Board,examples/Central/LedControl<br>flash,%,examples/Central/LedControl<br>RAM for global variables,%,examples/Central/PeripheralExplorer<br>flash,%,examples/Central/PeripheralExplorer<br>RAM for global variables,%,examples/Central/Scan<br>flash,%,examples/Central/Scan<br>RAM for global variables,%,examples/Central/ScanCallback<br>flash,%,examples/Central/ScanCallback<br>RAM for global variables,%,examples/Central/SensorTagButton<br>flash,%,examples/Central/SensorTagButton<br>RAM for global variables,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>flash,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>RAM for global variables,%,examples/Peripheral/Advertising/RawDataAdvertising<br>flash,%,examples/Peripheral/Advertising/RawDataAdvertising<br>RAM for global variables,%,examples/Peripheral/BatteryMonitor<br>flash,%,examples/Peripheral/BatteryMonitor<br>RAM for global variables,%,examples/Peripheral/ButtonLED<br>flash,%,examples/Peripheral/ButtonLED<br>RAM for global variables,%,examples/Peripheral/CallbackLED<br>flash,%,examples/Peripheral/CallbackLED<br>RAM for global variables,%,examples/Peripheral/EncryptedBatteryMonitor<br>flash,%,examples/Peripheral/EncryptedBatteryMonitor<br>RAM for global variables,%,examples/Peripheral/LED<br>flash,%,examples/Peripheral/LED<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0,20,0.0,0,0.0
arduino:megaavr:uno2018:mode=on,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:renesas_uno:unor4wifi,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0
arduino:samd:mkrwifi1010,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0
arduino:samd:nano_33_iot,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0

@fabik111
Copy link
Contributor Author

Rebased

@andreagilardoni andreagilardoni merged commit 9e523b5 into arduino-libraries:master Mar 26, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants