alf45tar / PedalinoMini

Wireless and Bluetooth MIDI Foot Controller
GNU General Public License v3.0
488 stars 87 forks source link

Using bank names when # of Pedals is under 6 causes boot loop/crash (bug) #485

Closed Pedalnetics closed 9 months ago

Pedalnetics commented 9 months ago

When setting: #define PEDALS 6 to something less than 6 and then setting a bank name in Actions, the device will reboot and never load to the bank name screen. It loads the Wifi config bar to 100%, sits there, and eventually reboots itself.

alf45tar commented 9 months ago

I need more information of your configuration to investigate the issue. I tried my T-Display with 5 pedals and it works. Can you attach the log?

Pedalnetics commented 9 months ago

Alrighty; I set my PEDALS define to 4, did a full clean, erase flash, build, upload, build filesystem image, and filesystem image upload. On first boot, I SmartConfig the WiFi, everything boots normal/fine, and I'm able to get to the webpage. If I simply visit the Actions page and set a bank name and apply/save (in this case, my bank name was HX), it'll sit on the original A01 screen for a bit (not changing the bank name on the screen), and eventually reboot itself. Then it reconnects to wifi, sits there on the "Connecting to" screen with a full bar, and eventually reboots. If I change the PEDALS define to anything under 6, this happens. if I set it to 6 or above, it works fine. Logs from it booting and a crash:


SYSTEM_EVENT_SCAN_DONE
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2920
entry 0x403c98d8
E (383) esp_core_dump_flash: No core dump partition found!
E (383) esp_core_dump_flash: No core dump partition found!
PedalinoMini™ - Version 3.1.13
CPU0 reset reason: POWERON_RESET Vbat power on reset
CPU1 reset reason: POWERON_RESET Vbat power on reset
PSRAM not found
ChipRevision 0, CPU Freq 240 MHz, SDK Version v4.4.3
Flash Size 8388608, Flash Speed 80000000 Hz
Internal Total Heap 299496, Internal Free Heap 269624
PSRAM Total Heap 0, PSRAM Free Heap 0
Default Vref: 1100mV
nvs Total 65536
PlatformIO Built Environment: heltec_wifi_kit_32_V3
_________           .___      .__  .__                 _____  .__       .__     ___ ________________    ___ 
\______  \ ____   __| _/____  |  | |__| ____   ____   /     \ |__| ____ |__|   /  / \__    ___/     \   \  \ 
|     ___// __ \ / __ |\__  \ |  | |  |/    \ /  _ \ /  \ /  \|  |/    \|  |  /  /    |    | /  \ /  \   \  \ 
|    |   \  ___// /_/ | / __ \|  |_|  |   |  (  <_> )    Y    \  |   |  \  | (  (     |    |/    Y    \   )  )
|____|    \___  >____ |(____  /____/__|___|  /\____/\____|__  /__|___|  /__|  \  \    |____|\____|__  /  /  / 
              \/     \/     \/             \/               \/        \/       \__\                 \/  /__/ 
                                                                                  (c) 2018-2023 alf45star     
                                                                      https://github.com/alf45tar/PedalinoMini

Hostname: E4E22748
PSRAM not found
Internal Total Heap 299464, Internal Free Heap 269528
PSRAM Total Heap 0, PSRAM Free Heap 0
SPIFFS mount OK
'nvs' partition was successfully initialized
Reading NVS Global ... done
[NVS][Global][Device Name]:      E4E22748
[NVS][Global][Boot Mode]:        1
[NVS][Global][BLE Server]:       
[NVS][Global][STA SSID]:         SN12IoT
[NVS][Global][STA Password]:     gDvR6v6XJLEU
[NVS][Global][AP SSID]:          Pedalino-E4E22748
[NVS][Global][AP Password]:      E4E22748
[NVS][Global][HTTP Username]:    admin
[NVS][Global][HTTP Password]:    pedalnetics
[NVS][Global][Bootstrap Theme]:  bootstrap
[NVS][Global][Current Profile]:  0
[NVS][Global][Flip Screen]:      0
[NVS][Global][Screen Timeout]:   3600000
[NVS][Global][Tap Dance Mode]:   0
[NVS][Global][Bank Switch]:      0
[NVS][Global][Debounce Time]:    5
[NVS][Global][SimultaneousGap]:  50
[NVS][Global][Single Time]:      200
[NVS][Global][Double Time]:      400
[NVS][Global][Long   Time]:      500
[NVS][Global][Repeat Time]:      1000
[NVS][Global][Encoder Sensit]:   5
[NVS][Global][RGB Order]:        10
[NVS][Global][LedsOnBright]:     5
[NVS][Global][LedsOffBright]:    1
[NVS][Global][OSCLocalPort]:     8000
[NVS][Global][OSCRemoteHost]:    255.255.255.255
[NVS][Global][OSCRemotePort]:    9000
[NVS][Global][Ladder]:           Ladder 1 Level 352
[NVS][Global][Ladder]:           Ladder 2 Level 533
[NVS][Global][Ladder]:           Ladder 3 Level 640
[NVS][Global][Ladder]:           Ladder 4 Level 723
[NVS][Global][Ladder]:           Ladder 5 Level 806
[NVS][Global][Ladder]:           Ladder 6 Level 908
[   862][W][Wire.cpp:301] begin(): Bus already started in Master Mode.

Boot NORMAL
Bluetooth Classic disabled: 0 bytes released
Loading profile 0 ...
Reading NVS Profile A ... done
Bank  2
Pedal  1        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D36
Pedal  2        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D37
Pedal  3        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D38
Pedal  4        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D39
MIDI/MTC Clock Off
... profile 0 loaded.
USB MIDI started
DIN MIDI started
Connecting to
SSID        : SN12IoT
Password    : gDvR6v6XJLEU
SYSTEM_EVENT_WIFI_READY
SYSTEM_EVENT_STA_START
[  1731][W][WiFiGeneric.cpp:955] _eventCallback(): Reason: 202 - AUTH_FAIL
SYSTEM_EVENT_STA_DISCONNECTED
SYSTEM_EVENT_STA_CONNECTED
BSSID       : C6:A7:B9:14:D1:C4
RSSI        : -57 dBm
Channel     : 1
STA         : 48:27:E2:E4:83:C0
SYSTEM_EVENT_STA_GOT_IP
Hostname    : E4E22748
IP address  : 192.168.12.34
Subnet mask : 255.255.255.0
Gataway IP  : 192.168.12.1
DNS 1       : 192.168.12.251
DNS 2       : 0.0.0.0
mDNS responder started
BLE MIDI service advertising started (server mode)
Internal Total Heap 294032, Internal Free Heap 148628
[  1853][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
[  1857][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
[  1863][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
HTTP server started on port 80
Connect to http://E4E22748.local/update for firmware update
Connect to http://E4E22748.local for configuration
ipMIDI started
RTP-MIDI started on port 5004
OSC server started on port 8000
SYSTEM_EVENT_SCAN_DONE
Guru Meditation Error: Core  1 panic'ed (LoadStoreError). Exception was unhandled.

Core  1 register dump:
PC      : 0x4200d68c  PS      : 0x00060330  A0      : 0x8205a168  A1      : 0x3fcecbb0  
A2      : 0x3fc9f0c8  A3      : 0x0000a474  A4      : 0x0000a477  A5      : 0x00001d00  
A6      : 0x00001d00  A7      : 0x00000000  A8      : 0x8200d68a  A9      : 0x3fffff50  
A10     : 0x3fcecbfc  A11     : 0x3fcecbfc  A12     : 0x3fcecc0c  A13     : 0x00000000  
A14     : 0x0000000a  A15     : 0x00000000  SAR     : 0x0000001c  EXCCAUSE: 0x00000003  
EXCVADDR: 0x4000004e  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xffffffff  

Backtrace: 0x4200d689:0x3fcecbb0 0x4205a165:0x3fcecc40 0x4205a31e:0x3fcecc60 0x4205a3f5:0x3fcecc80 0x42033e56:0x3fceccb0 0x420368c1:0x3fceccd0 0x420638a5:0x3fcecd20

ELF file SHA256: 1d9c68e0d32628ce

E (17037) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting...
���ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x42174ed2
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2920
entry 0x403c98d8
E (390) esp_core_dump_flash: No core dump partition found!
E (390) esp_core_dump_flash: No core dump partition found!
PedalinoMini™ - Version 3.1.13
CPU0 reset reason: SW_CPU_RESET Software reset CPU
CPU1 reset reason: SW_CPU_RESET Software reset CPU
PSRAM not found
ChipRevision 0, CPU Freq 240 MHz, SDK Version v4.4.3
Flash Size 8388608, Flash Speed 80000000 Hz
Internal Total Heap 299496, Internal Free Heap 269624
PSRAM Total Heap 0, PSRAM Free Heap 0
Default Vref: 1100mV
nvs Total 65536
PlatformIO Built Environment: heltec_wifi_kit_32_V3
_________           .___      .__  .__                 _____  .__       .__     ___ ________________    ___ 
\______  \ ____   __| _/____  |  | |__| ____   ____   /     \ |__| ____ |__|   /  / \__    ___/     \   \  \ 
|     ___// __ \ / __ |\__  \ |  | |  |/    \ /  _ \ /  \ /  \|  |/    \|  |  /  /    |    | /  \ /  \   \  \ 
|    |   \  ___// /_/ | / __ \|  |_|  |   |  (  <_> )    Y    \  |   |  \  | (  (     |    |/    Y    \   )  )
|____|    \___  >____ |(____  /____/__|___|  /\____/\____|__  /__|___|  /__|  \  \    |____|\____|__  /  /  / 
              \/     \/     \/             \/               \/        \/       \__\                 \/  /__/ 
                                                                                  (c) 2018-2023 alf45star     
                                                                      https://github.com/alf45tar/PedalinoMini

Hostname: E4E22748
PSRAM not found
Internal Total Heap 299464, Internal Free Heap 269528
PSRAM Total Heap 0, PSRAM Free Heap 0
SPIFFS mount OK
'nvs' partition was successfully initialized
Reading NVS Global ... done
[NVS][Global][Device Name]:      E4E22748
[NVS][Global][Boot Mode]:        1
[NVS][Global][BLE Server]:       
[NVS][Global][STA SSID]:         SN12IoT
[NVS][Global][STA Password]:     gDvR6v6XJLEU
[NVS][Global][AP SSID]:          Pedalino-E4E22748
[NVS][Global][AP Password]:      E4E22748
[NVS][Global][HTTP Username]:    admin
[NVS][Global][HTTP Password]:    pedalnetics
[NVS][Global][Bootstrap Theme]:  bootstrap
[NVS][Global][Current Profile]:  0
[NVS][Global][Flip Screen]:      0
[NVS][Global][Screen Timeout]:   3600000
[NVS][Global][Tap Dance Mode]:   0
[NVS][Global][Bank Switch]:      0
[NVS][Global][Debounce Time]:    5
[NVS][Global][SimultaneousGap]:  50
[NVS][Global][Single Time]:      200
[NVS][Global][Double Time]:      400
[NVS][Global][Long   Time]:      500
[NVS][Global][Repeat Time]:      1000
[NVS][Global][Encoder Sensit]:   5
[NVS][Global][RGB Order]:        10
[NVS][Global][LedsOnBright]:     5
[NVS][Global][LedsOffBright]:    1
[NVS][Global][OSCLocalPort]:     8000
[NVS][Global][OSCRemoteHost]:    255.255.255.255
[NVS][Global][OSCRemotePort]:    9000
[NVS][Global][Ladder]:           Ladder 1 Level 352
[NVS][Global][Ladder]:           Ladder 2 Level 533
[NVS][Global][Ladder]:           Ladder 3 Level 640
[NVS][Global][Ladder]:           Ladder 4 Level 723
[NVS][Global][Ladder]:           Ladder 5 Level 806
[NVS][Global][Ladder]:           Ladder 6 Level 908
[   869][W][Wire.cpp:301] begin(): Bus already started in Master Mode.

Boot NORMAL
Bluetooth Classic disabled: 0 bytes released
Loading profile 0 ...
Reading NVS Profile A ... done
Bank  2
Pedal  1        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D36
Pedal  2        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D37
Pedal  3        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D38
Pedal  4        1   MOMENTARY1         PRESS_1       POLARITY+      Channel  1   Pin D39
MIDI/MTC Clock Off
... profile 0 loaded.
USB MIDI started
DIN MIDI started
Connecting to
SSID        : SN12IoT
Password    : gDvR6v6XJLEU
SYSTEM_EVENT_WIFI_READY
SYSTEM_EVENT_STA_START
[  1737][W][WiFiGeneric.cpp:955] _eventCallback(): Reason: 202 - AUTH_FAIL
SYSTEM_EVENT_STA_DISCONNECTED
SYSTEM_EVENT_STA_CONNECTED
BSSID       : C6:A7:B9:14:D1:C4
RSSI        : -56 dBm
Channel     : 1
STA         : 48:27:E2:E4:83:C0
SYSTEM_EVENT_STA_GOT_IP
Hostname    : E4E22748
IP address  : 192.168.12.34
Subnet mask : 255.255.255.0
Gataway IP  : 192.168.12.1
DNS 1       : 192.168.12.251
DNS 2       : 0.0.0.0
mDNS responder started
BLE MIDI service advertising started (server mode)
Internal Total Heap 294032, Internal Free Heap 148644
[  9007][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
[  9012][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
[  9018][E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
Pedalnetics commented 9 months ago

Does it have something to do with line 884 in the DisplayOLED.h file? It has a static-define of 6 pedals. If it's trying to pull data back about the Tag names for Pedals 5 & 6 in this case, it'd be an invalid pointer reference I believe, resulting in that crash/backtrace? image

*Edit update - I changed that static define to == 4, and it stopped crashing, so it does appear related to that. Not sure what the proper answer is to expose the PEDALS directive to this class/header file

alf45tar commented 9 months ago

You are right. I will change to

const byte Pedals = _min(PEDALS, 6);

Thanks