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

Crash when connecting to app #7

Open
zorro735100 opened this issue Jan 4, 2025 · 4 comments
Open

Crash when connecting to app #7

zorro735100 opened this issue Jan 4, 2025 · 4 comments

Comments

@zorro735100
Copy link

grafik

The device works until it connects to the app after about 2 seconds it crashes with this message.

@fbiego
Copy link
Owner

fbiego commented Jan 4, 2025

can you share the relevant code. What are you performing after connection?

@zorro735100
Copy link
Author

zorro735100 commented Jan 4, 2025

I tried to stay close to the navigation example, because i only need the navigation data for my project.
In the App itself i do nothing after the connection. It happens i would say on its own

void connectionCallback(bool state){
  Serial.println("Connection state: " + state ? "Connected" : "Disconnected");
}
void notificationCallback(Notification notification){
  Serial.print("Notification recieved at: ");
  Serial.println(notification.time);
  Serial.print("From: ");
  Serial.println(notification.app);
  Serial.print("\tIcon: ");
  Serial.println(notification.icon);
  Serial.print(notification.message);
}

void configCallback(Config config, uint32_t a, uint32_t b)
{
    switch (config)
    {
    case CF_NAV_DATA:
        Serial.print("Navigation state: ");
        Serial.println(a ? "Active" : "Inactive");
        change = true;
        if (a){
            Navigation nav = watch.getNavigation();
            Serial.println(nav.directions);
            Serial.println(nav.eta);
            Serial.println(nav.duration);
            Serial.println(nav.distance);
            Serial.println(nav.title);
        }
        break;
    case CF_NAV_ICON:
        Serial.print("Navigation Icon data, position: ");
        Serial.println(a);
        Serial.print("Icon CRC: ");
        Serial.printf("0x%04X\n", b);
        break;
    }
}
void ChronosHandler(){
  watch.loop();

  if (change)
  {
    change = false;

    Navigation nav = watch.getNavigation();
    if (nav.active)
    {
      Serial.println(nav.directions);
      Serial.println(nav.eta);
      Serial.println(nav.duration);
      Serial.println(nav.distance);
      Serial.println(nav.title);
    }
  }
  
}
void ChronosSetup(){
  watch.setConnectionCallback(connectionCallback);
  watch.setNotificationCallback(notificationCallback);
  watch.setConfigurationCallback(configCallback);
  watch.begin();

  Serial.println("Chronos aktiviert");
  Serial.println(watch.getAddress());
  watch.setBattery(69);
  ChronosSetupBeendet = true;
}
void setup() {

  // Pin Konfiguration
  PinSetup();
  
  // Serial Konfiguration
  if (SerialSetupBeendet == false)
  {
    SerialSetup();
  }
  
  // Chronos Konfiguration
  if (ChronosSetupBeendet == false)
  {
    ChronosSetup();
  }
}

void loop() {

  // Chronos Handler
  ChronosHandler();

}

@fbiego
Copy link
Owner

fbiego commented Jan 4, 2025

can you check the stack trace and decode with EspExceptionDecoder

might be related to fbiego/esp32-c3-mini#14

@zorro735100
Copy link
Author

If id add the Return, it connects without any crashes but I can´t get any notifications in the serial monitor.
Here is the stack trace:

Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x42008a4e  RA      : 0x420062d2  SP      : 0x3fca7c70  GP      : 0x3fc92600
TP      : 0x3fc8c728  T0      : 0x00000000  T1      : 0x403902d4  T2      : 0x00000000
S0/FP   : 0x3fc95dec  S1      : 0x3fca0000  A0      : 0x3fc9f838  A1      : 0x00000001
A2      : 0x00000002  A3      : 0x00000000  A4      : 0x00000001  A5      : 0x00000081
A6      : 0x00000002  A7      : 0x00000080  S2      : 0x3c0d3000  S3      : 0x3c0d3000
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x00000000  T4      : 0x00005000  T5      : 0x00000001  T6      : 0x00000001
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000005  MTVAL   : 0x00000008
MHARTID : 0x00000000

Stack memory:
3fca7c70: 0x4038dd36 0x4038b4d2 0x3fca7cf0 0x3fcc0a98 0x0000005f 0x0000005d 0x00000000 0x00000000
  #0  0x4038dd36 in vPortClearInterruptMask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/riscv/port.c:308
  #1  0x4038b4d2 in xQueueGenericSend at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:947

3fca7c90: 0x00000000 0x00000000 0x01000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca7cb0: 0x00000000 0x00000000 0x02c95dec 0x00000020 0x00000000 0x00000000 0x81004200 0x8953e478
3fca7cd0: 0x00000000 0x00000000 0x3fc95dec 0x00000000 0x3fc96000 0x3fca0000 0x00000000 0x42001b54
  #0  0x3fc95dec in ?? at src/main.cpp:20
  #1  0x42001b54 in ChronosHandler() at src/main.cpp:186

3fca7cf0: 0x42021116 0x4202241c 0x00000000 0x4038d0de 0x3fc8c728 0x00000000 0x3fcbeea8 0x00000000
  #0  0x42021116 in lwip_recvfrom_udp_raw at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:1256
  #1  0x4202241c in lwip_recvfrom at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:1293 (discriminator 4)
  #2  0x4038d0de in xTaskPriorityDisinherit at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:4919

3fca7d10: 0x00000000 0x3fca7dca 0x3fcbeea8 0x4038af94 0x00000000 0x00000000 0x3fcbeea8 0x4038b4b2
  #0  0x4038af94 in prvCopyDataToQueue at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:2245
  #1  0x4038b4b2 in xQueueGenericSend at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:856

3fca7d30: 0xfa000000 0x00000003 0x00000000 0x00000000 0x00000000 0x3fca7d7c 0x3fcbed18 0x420359ca
  #0  0x420359ca in netconn_recv_data at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/api_lib.c:617

3fca7d50: 0x00000000 0x3fca0000 0x3fca7e2c 0x000005b4 0x3fc995ac 0x00000000 0x00000000 0x42033f12
  #0  0x42033f12 in sys_mutex_unlock at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32/freertos/sys_arch.c:98

3fca7d70: 0x00001800 0x3fca1028 0x3fcc0c3c 0x420211e4 0x3fca7e20 0x00000008 0x3fc99598 0x00000000
  #0  0x420211e4 in done_socket at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:433
  #1  0x3fc99598 in ?? at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:262

3fca7d90: 0x00000000 0x3fca0000 0x3fca7e2c 0x000005b4 0x3fca7e20 0x0000000b 0x3fc99598 0x42022432
  #0  0x3fc99598 in ?? at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:262
  #1  0x42022432 in lwip_recvfrom at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:1268

3fca7db0: 0x00000000 0x00000000 0x000005b4 0x3fcc0c3c 0x000005b4 0x3fca1028 0x00001800 0x3fcc0c3c
3fca7dd0: 0x00000000 0x3fca0000 0x00000000 0x00000000 0x3fc98abc 0x3fcc0c34 0xffffffff 0x4038cd10
  #0  0x4038cd10 in __getreent at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:2529

3fca7df0: 0x3fc98abc 0x3fcc0c3c 0x3fca0c70 0x420ae3a6 0x3fc98abc 0x3fcc0c3c 0xffffffff 0x4208fc5c
  #0  0x420ae3a6 in __errno at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/errno/errno.c:14
  #1  0x4208fc5c in WiFiUDP::parsePacket() at C:/Users/PL152/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiUdp.cpp:218

3fca7e10: 0xfa000000 0x00000003 0x000001f4 0x00000000 0x00000010 0x00000000 0x00000000 0x00000000
3fca7e30: 0x00000000 0x00000000 0x00000000 0x4038ad74 0x00000000 0x00000000 0x00000000 0x00000003
  #0  0x4038ad74 in xEventGroupClearBits at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/event_groups.c:544

3fca7e50: 0x00000000 0x3fc98abc 0x3fc91e24 0x42001d00 0x00000000 0x3fca0000 0x3fc91e24 0x8953e478
  #0  0x3fc91e24 in ?? at src/main.cpp:35
  #1  0x42001d00 in WiFiReconnect() at src/main.cpp:228
  #2  0x3fc91e24 in ?? at src/main.cpp:35

3fca7e70: 0x00000000 0x3fca0000 0x00000000 0x4200b192 0x00000000 0x00000000 0x00000000 0x4038dcc8
  #0  0x4200b192 in loopTask(void*) at C:/Users/PL152/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:51
  #1  0x4038dcc8 in _prvTaskExitError at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/riscv/port.c:126
      (inlined by) prvTaskExitError at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/riscv/port.c:140

3fca7e90: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
3fca7eb0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000160 0xabba1234 0x00000154
3fca7ed0: 0x3fca7bd0 0x0000e599 0x3fc9a98c 0x3fc9a98c 0x3fca7ed0 0x3fc9a984 0x00000018 0x3fcc0a60
3fca7ef0: 0x3fcc0a60 0x3fca7ed0 0x00000000 0x00000001 0x3fca5ec0 0x706f6f6c 0x6b736154 0x433a8000
3fca7f10: 0x00fa453e 0x00000000 0x3fca7eb0 0x00000001 0x00000000 0x3fcacc28 0x42013e16 0x0000000b
  #0  0x42013e16 in pthread_local_storage_thread_deleted_callback at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/pthread/pthread_local_storage.c:129

3fca7f30: 0x3fca1334 0x3fca139c 0x3fca1404 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000
3fca7f50: 0x00000000 0x420ae790 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
  #0  0x420ae790 in _cleanup_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/findfp.c:229

3fca7f70: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca7f90: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca7fb0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca7fd0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca7ff0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca8010: 0x00000000 0x00000000 0x00000000 0x00000000 0x34000000 0xbaad5678 0x00000060 0xabba1234
3fca8030: 0x00000054 0x00000000 0x3fca8034 0x00000000 0x00000000 0x00000000 0x3fca804c 0xffffffff
3fca8050: 0x3fca804c 0x3fca804c 0x00000000 0x3fca8060 0xffffffff 0x3fca8060 0x3fca8060 0x00000001



ELF file SHA256: 4a0a3d3c9945aae3

Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40382476
  #0  0x40382476 in esp_restart_noos_dig at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/esp_system.c:53 (discriminator 1)

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x438
load:0x403cc710,len:0x90c
load:0x403ce710,len:0x2624
entry 0x403cc710

Is this what you are looking for?
It´s made with the platformio esp32_exception_decoder, because i can´t get the arduino one to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants