atctwo / bbrx

RC receiver controlled using Bluetooth gamepads
1 stars 1 forks source link

Some ESP devices Get stuck #1

Closed NerdsCorp closed 2 months ago

NerdsCorp commented 2 months ago

Hello, im not sure what kind of device this has been tested on but i have tried to use a Heltec ESP32 v2 and it get stuck on the LED startup. Could you give me a recommendation on what devices this works on?

atctwo commented 2 months ago

Hi, it's been tested mostly on Adafruit boards: their ItsyBitsy ESP32, ESP32 Feather V2, and QT Py ESP32 Pico. I've only tried classic ESP32 boards (not ESP32-S2 or S3 etc) but the Heltec board looks like a classic ESP32.

Would you be able to provide the serial log output?

NerdsCorp commented 2 months ago

yes, here is both the upload log and the serial output that the esp gives me.

(upload log)

WARNING: Category '' in library ESP Insights is not valid. Setting to 'Uncategorized' WARNING: Category '' in library ESP RainMaker is not valid. Setting to 'Uncategorized' WARNING: Category '' in library WiFiProv is not valid. Setting to 'Uncategorized' Archiving built core (caching) in: /tmp/arduino_cache_67471/core/core_esp32-bluepad32_esp32_heltec_wifi_lora_32_V2_PSRAM_disabled,CPUFreq_240,UploadSpeed_921600,DebugLevel_none,LORAWAN_REGION_3,LoRaWanDebugLevel_0,EraseFlash_none_362161be666ee4dc643fda38705fdfe4.a Sketch uses 1100689 bytes (32%) of program storage space. Maximum is 3342336 bytes. Global variables use 95252 bytes (29%) of dynamic memory, leaving 232428 bytes for local variables. Maximum is 327680 bytes. esptool.py v4.5.1 Serial port /dev/ttyUSB0 Connecting.... Chip is ESP32-D0WDQ6 (revision v1.1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: b0:b2:1c:f8:73:ac Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Flash will be erased from 0x00001000 to 0x00005fff... Flash will be erased from 0x00008000 to 0x00008fff... Flash will be erased from 0x0000e000 to 0x0000ffff... Flash will be erased from 0x00010000 to 0x0011efff... Compressed 18992 bytes to 13109... Writing at 0x00001000... (100 %) Wrote 18992 bytes (13109 compressed) at 0x00001000 in 0.5 seconds (effective 281.9 kbit/s)... Hash of data verified. Compressed 3072 bytes to 146... Writing at 0x00008000... (100 %) Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 354.9 kbit/s)... Hash of data verified. Compressed 8192 bytes to 47... Writing at 0x0000e000... (100 %) Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 493.9 kbit/s)... Hash of data verified. Compressed 1107264 bytes to 618745... Writing at 0x00010000... (2 %) Writing at 0x000210d7... (5 %) Writing at 0x0002c7e7... (7 %) Writing at 0x000375b4... (10 %) Writing at 0x0004c554... (13 %) Writing at 0x00054ac0... (15 %) Writing at 0x0005a99c... (18 %) Writing at 0x00060d71... (21 %) Writing at 0x0006658d... (23 %) Writing at 0x0006bafd... (26 %) Writing at 0x000710b5... (28 %) Writing at 0x0007655b... (31 %) Writing at 0x0007b96a... (34 %) Writing at 0x00081a2e... (36 %) Writing at 0x00087284... (39 %) Writing at 0x0008c65a... (42 %) Writing at 0x00091e3e... (44 %) Writing at 0x000970fc... (47 %) Writing at 0x0009c4a8... (50 %) Writing at 0x000a2524... (52 %) Writing at 0x000a8013... (55 %) Writing at 0x000ae42b... (57 %) Writing at 0x000b4101... (60 %) Writing at 0x000b9abd... (63 %) Writing at 0x000bf3bc... (65 %) Writing at 0x000c5715... (68 %) Writing at 0x000ce76e... (71 %) Writing at 0x000d5a78... (73 %) Writing at 0x000dd9d0... (76 %) Writing at 0x000e3e6b... (78 %) Writing at 0x000ec009... (81 %) Writing at 0x000f4635... (84 %) Writing at 0x000fc47e... (86 %) Writing at 0x0010408c... (89 %) Writing at 0x00109632... (92 %) Writing at 0x0010f21c... (94 %) Writing at 0x00114809... (97 %) Writing at 0x00119d97... (100 %) Wrote 1107264 bytes (618745 compressed) at 0x00010000 in 11.4 seconds (effective 774.6 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin...

(the serial output)

Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 10:04:43 [i] [main] [i] [status] Setting up Status LED Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE

NerdsCorp commented 2 months ago

I have a few of these and Ive tried it on three of them and get the same outcome. They don't have anything attached, i don't know if that matters because i didn't want to use an sd card just the config internally.

atctwo commented 2 months ago

Ok, I have an idea of what might be causing this issue:

I've pushed a new version (2525cc7e026ed03390fa0831106f281dfa2ddf06) which basically just comments out STATUS_LED_POWER_PIN in config.h (line 100), which will stop that pin being set. Could you either pull this new version or just comment out STATUS_LED_POWER_PIN and see if it works?

NerdsCorp commented 2 months ago

so i just commented the line out and it starts then crashes. below is the output, it does this over and over.

Rebooting... Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE E (1559) psr[i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 19:44:09 [i] [main] [i] [status] Setting up Status LED [d] [status] changed state to 1 [d] [status] setting led to 0 128 0, pulse period = 1000, pulse delay = 4 [i] [config] Loading bbrx config file from LittleFS... [w] [config] Failed to open /config.yml [i] [config] Could not load config file; using default config values [i] [controller] Setting up Bluepad32 [i] [controller] BP32 version: Bluepad32 for Arduino v4.1.0 [i] [controller] Listening for controllers... [i] [events] Initialised binding 0: action=2, event=1, min=-512, max=511 [i] [events] Initialised binding 1: action=2, event=0, min=511, max=-512 [i] [events] Initialised binding 2: action=2, event=4, min=-1024, max=1023 [i] [events] Initialised binding 3: action=2, event=5, min=1023, max=-1024 [i] [events] Initialised binding 4: action=6, event=16, min=0, max=1 [i] [events] Initialised binding 5: action=3, event=17, min=0, max=1 [i] [events] Initialised binding 6: action=4, event=18, min=0, max=1 [i] [events] Initialised binding 7: action=3, event=12, min=0, max=1 [i] [events] Initialised binding 8: action=4, event=13, min=0, max=1 [d] [status] changed state to 2 [d] [status] setting led to 0 0 255, pulse period = 1000, pulse delay = 4 Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled.

Core 1 register dump: PC : 0x400df065 PS : 0x00060830 A0 : 0x800d34f5 A1 : 0x3ffdd8c0
A2 : 0x3ffc3868 A3 : 0x3ffc3860 A4 : 0x3ffc37f8 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x000000ff A8 : 0x00000000 A9 : 0x00000002
A10 : 0x000008ea A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00000001
A14 : 0x4017d4b4 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x40086311 LEND : 0x40086319 LCOUNT : 0x00000027

Backtrace: 0x400df062:0x3ffdd8c0 0x400d34f2:0x3ffdd8e0 0x400f42a5:0x3ffdd900

ELF file SHA256: cdf9eb9305cfbadf

Rebooting... Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE E (1622) psr[i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 21 2024 19:44:09 [i] [main] [i] [status] Setting up Status LED [d] [status] changed state to 1 [d] [status] setting led to 0 128 0, pulse period = 1000, pulse delay = 4 [i] [config] Loading bbrx config file from LittleFS... [w] [config] Failed to open /config.yml [i] [config] Could not load config file; using default config values [i] [controller] Setting up Bluepad32 [i] [controller] BP32 version: Bluepad32 for Arduino v4.1.0 [i] [controller] Listening for controllers... [i] [events] Initialised binding 0: action=2, event=1, min=-512, max=511 [i] [events] Initialised binding 1: action=2, event=0, min=511, max=-512 [i] [events] Initialised binding 2: action=2, event=4, min=-1024, max=1023 [i] [events] Initialised binding 3: action=2, event=5, min=1023, max=-1024 [i] [events] Initialised binding 4: action=6, event=16, min=0, max=1 [i] [events] Initialised binding 5: action=3, event=17, min=0, max=1 [i] [events] Initialised binding 6: action=4, event=18, min=0, max=1 [i] [events] Initialised binding 7: action=3, event=12, min=0, max=1 [i] [events] Initialised binding 8: action=4, event=13, min=0, max=1 [d] [status] changed state to 2 [d] [status] setting led to 0 0 255, pulse period = 1000, pulse delay = 4 Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled.

Core 1 register dump: PC : 0x400df065 PS : 0x00060830 A0 : 0x800d34f5 A1 : 0x3ffdd8c0
A2 : 0x3ffc3868 A3 : 0x3ffc3860 A4 : 0x3ffc37f8 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x000000ff A8 : 0x00000000 A9 : 0x00000002
A10 : 0x00000909 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00000001
A14 : 0x4017d4b4 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x40086311 LEND : 0x40086319 LCOUNT : 0x00000027

Backtrace: 0x400df062:0x3ffdd8c0 0x400d34f2:0x3ffdd8e0 0x400f42a5:0x3ffdd900

atctwo commented 2 months ago

I've been trying to reproduce this crash but i can't get it not working. I'm guessing it might be a problem with some code in status_led.cpp, so I've pushed a new version (82703dd8aefd74432a9c5effa04ce927a5dbc131) which adds some divide-by-zero checks, as well as a bit more debugging info. It also adds a define called STATUS_LED_ENABLE which you can comment out to completely disable all the status LED code, if the checks don't fix the issue.

Could you try out this new version? Also, if this doesn't work could you post your config.h?

NerdsCorp commented 2 months ago

Thanks for being so responsive! this fixed the problem! below is my output and it functions as described! You should create a discord channel. This is a great project! I just used it as is and didnt comment anything out,

Bluepad32 (C) 2016-2024 Ricardo Quesada and contributors. Version: v4.1.0 BTstack: Copyright (C) 2017 BlueKitchen GmbH. BTstack up and running at B0:B2:1C:F8:73:AE [i] [main] === bbrx! === [i] [main] version: v1.1 [i] [main] build time: Sep 22 2024 08:46:08 [i] [main] [i] [status] Setting up Status LED [d] [status] 1 leds on pin 5, init brightness = 35 [d] [status] changed state to 1 [d] [status] setting led to 0 128 0, pulse period = 1000, pulse delay = 4, divider = 7, brightness = 35 [i] [config] Loading bbrx config file from LittleFS... [w] [config] Failed to open /config.yml [i] [config] Could not load config file; using default config values [i] [controller] Setting up Bluepad32 [i] [controller] BP32 version: Bluepad32 for Arduino v4.1.0 [i] [controller] Listening for controllers... [i] [events] Initialised binding 0: action=2, event=1, min=-512, max=511 [i] [events] Initialised binding 1: action=2, event=0, min=511, max=-512 [i] [events] Initialised binding 2: action=2, event=4, min=-1024, max=1023 [i] [events] Initialised binding 3: action=2, event=5, min=1023, max=-1024 [i] [events] Initialised binding 4: action=6, event=16, min=0, max=1 [i] [events] Initialised binding 5: action=3, event=17, min=0, max=1 [i] [events] Initialised binding 6: action=4, event=18, min=0, max=1 [i] [events] Initialised binding 7: action=3, event=12, min=0, max=1 [i] [events] Initialised binding 8: action=4, event=13, min=0, max=1 [d] [status] changed state to 2 [d] [status] setting led to 0 0 255, pulse period = 1000, pulse delay = 4, divider = 7, brightness = 35 [i] [main] Setup complete!

NerdsCorp commented 2 months ago

all fixed