Skip to content
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

[gen3] fix stack overflow for the timer service thread. #2725

Merged
merged 1 commit into from Jan 17, 2024

Conversation

XuGuohui
Copy link
Member

Problem

[SC124588] Device panics with 13 blinks SOS pattern, which is stack overflow. This issue is introduced since #2696.

Solution

Remove logging in timer service routine in BLE HAL.

Steps to Test

  1. Use an Argon to run the user/tests/app/ble/uart_peripheral app. You need to make a little bit change to this app:
   BleAdvertisingData data;
   // data.appendServiceUUID(serviceUuid);
   data.appendLocalName("Argon-123abc");
   BLE.advertise(&data);
  1. Use a Boron to run the attached test app.

Example App

#include "Particle.h"

SYSTEM_MODE(MANUAL);

SYSTEM_THREAD(ENABLED);

// Show system, cloud connectivity, and application logs over USB
// View logs with CLI using 'particle serial monitor --follow'
SerialLogHandler logHandler(LOG_LEVEL_TRACE);

BlePeerDevice OTAPeerDevice;
BleScanResult result;

void setup() {
    uint32_t count;

    waitFor(Serial.isConnected, 30000);
   
    Log.trace("OTA-SETUP");
    delay(1000);

    BLE.on();
    count = BLE.scanWithFilter(BleScanFilter().deviceName("Argon-123abc"), &result, 1);
    BLE.stopScanning();

    if (!count) { 
        Log.trace("NO DEVICE FOUND");
        return;
    }
    
    Log.trace(result.address().toString());
    OTAPeerDevice = BLE.connect(result.address());

    Log.trace("POST CONNECT");
    if (!OTAPeerDevice.connected()) {
        Log.trace("NOT CONNECTED");
        return;
    }
}

void loop() {
}

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui merged commit cf540b2 into develop Jan 17, 2024
13 checks passed
@XuGuohui XuGuohui deleted the fix/sc124588/gen3_stack_overflow branch January 17, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants