[GH-ISSUE #267] Gicisky BLE EPD BWR 2.9" does not refresh #3470

Closed
opened 2026-03-20 23:05:50 +01:00 by sascha_hemi · 27 comments
Owner

Originally created by @andorardo on GitHub (Mar 8, 2024).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/267

Describe the bug
The ESP32 AP recognizes the Gicisky 2.9", but the epaper screen doesn't refresh. Using "Force refresh" doesn't get the paper to refresh either.

To Reproduce
Configuration:

  • 2.52 OpenEPaperLink_Mini_AP_v4 running on S3 devkit N16R2.
  • Gicisky BLE EPD BWR 2.9"
  • Click on tag, change content to Static image, draw something

Expected behavior
epaper screen refresh with image

Screenshots
Screenshot 2024-03-08 at 9 28 11 AM

Additional context
Using https://github.com/atc1441/ATC_GICISKY_ESL, I can pair with the tag, and although it's a 2.9" device instead of the 4.2" in the demo, the tag updates (with a messed up image) and refreshes.

Originally created by @andorardo on GitHub (Mar 8, 2024). Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/267 **Describe the bug** The ESP32 AP recognizes the Gicisky 2.9", but the epaper screen doesn't refresh. Using "Force refresh" doesn't get the paper to refresh either. **To Reproduce** Configuration: * 2.52 OpenEPaperLink_Mini_AP_v4 running on S3 devkit N16R2. * Gicisky BLE EPD BWR 2.9" * Click on tag, change content to Static image, draw something **Expected behavior** epaper screen refresh with image **Screenshots** <img width="242" alt="Screenshot 2024-03-08 at 9 28 11 AM" src="https://github.com/jjwbruijn/OpenEPaperLink/assets/1594149/e38a19b6-4129-4319-b7db-f06faedfa211"> **Additional context** Using https://github.com/atc1441/ATC_GICISKY_ESL, I can pair with the tag, and although it's a 2.9" device instead of the 4.2" in the demo, the tag updates (with a messed up image) and *refreshes*.
sascha_hemi added the bug label 2026-03-20 23:05:50 +01:00
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

@atc1441 since he added the BLE capability and might know how to debug further.

<!-- gh-comment-id:1985871061 --> @andorardo commented on GitHub (Mar 8, 2024): @atc1441 since he added the BLE capability and might know how to debug further.
Author
Owner

@atc1441 commented on GitHub (Mar 8, 2024):

Please insert fresh batteries in the Display 🙂

<!-- gh-comment-id:1985883401 --> @atc1441 commented on GitHub (Mar 8, 2024): Please insert fresh batteries in the Display 🙂
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

Voltage is back up to 3.3V :)
Sadly, that didn't quite fix it. :(

Screenshot 2024-03-08 at 10 39 10 AM

Additional info: When I enqueue a Reboot tag message, it just sits there, and the tag does not reboot.

Oddly enough, ATC_GICISKY_ESL does get it to refresh. Do you by any chance have a 296x128 image to try uploading with that, just to double check?

<!-- gh-comment-id:1985921874 --> @andorardo commented on GitHub (Mar 8, 2024): Voltage is back up to 3.3V :) Sadly, that didn't quite fix it. :( <img width="239" alt="Screenshot 2024-03-08 at 10 39 10 AM" src="https://github.com/jjwbruijn/OpenEPaperLink/assets/1594149/41261b41-3051-446c-9882-b85b5c8e3ba0"> Additional info: When I enqueue a `Reboot tag` message, it just sits there, and the tag does not reboot. Oddly enough, ATC_GICISKY_ESL does get it to refresh. Do you by any chance have a 296x128 image to try uploading with that, just to double check?
Author
Owner

@atc1441 commented on GitHub (Mar 8, 2024):

Please delete the tag as well from the AP and let it find it again, the Fw version is wrong displayed

<!-- gh-comment-id:1985928419 --> @atc1441 commented on GitHub (Mar 8, 2024): Please delete the tag as well from the AP and let it find it again, the Fw version is wrong displayed
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

Deleted tag a few times, rebooted AP, deleted tag again, comes up with same: fw:33025 0x8101

What should it be?

<!-- gh-comment-id:1985948663 --> @andorardo commented on GitHub (Mar 8, 2024): Deleted tag a few times, rebooted AP, deleted tag again, comes up with same: `fw:33025 0x8101` What should it be?
Author
Owner

@atc1441 commented on GitHub (Mar 8, 2024):

Then tha fw might be using a different upload method which leads to a bug.
Please share the uart logs from the AP.
What AP are you using and what RF interface is connected? Esp32-C6?

<!-- gh-comment-id:1985957918 --> @atc1441 commented on GitHub (Mar 8, 2024): Then tha fw might be using a different upload method which leads to a bug. Please share the uart logs from the AP. What AP are you using and what RF interface is connected? Esp32-C6?
Author
Owner

@atc1441 commented on GitHub (Mar 8, 2024):

Ah sorry V4 Mini AP.
Please share then only the Uart logs in the BLE advertising section

<!-- gh-comment-id:1985966294 --> @atc1441 commented on GitHub (Mar 8, 2024): Ah sorry V4 Mini AP. Please share then only the Uart logs in the BLE advertising section
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

Here's the relevant looking part:

[11:11:53]Doing the BLE Scan
[11:11:57]BLE Advertised Device found: Name: , Address: ff:ff:92:93:42:71, manufacturer data: 53503321810140, serviceUUID: 0000fef0-0000-1000-8000-00805f9b34fb, rssi: -27
[11:11:57] Payload data: 0201060302F0FE08FF53503321810140
[11:11:57] Address type: 00 Manu data: 1028CD3F070000
[11:11:57]<ADR 0033FFFF92934271

This recurs periodically with other RSSI values.

(do you need the other devices?)

<!-- gh-comment-id:1985988386 --> @andorardo commented on GitHub (Mar 8, 2024): Here's the relevant looking part: ``` [11:11:53]Doing the BLE Scan [11:11:57]BLE Advertised Device found: Name: , Address: ff:ff:92:93:42:71, manufacturer data: 53503321810140, serviceUUID: 0000fef0-0000-1000-8000-00805f9b34fb, rssi: -27 [11:11:57] Payload data: 0201060302F0FE08FF53503321810140 [11:11:57] Address type: 00 Manu data: 1028CD3F070000 [11:11:57]<ADR 0033FFFF92934271 ``` This recurs periodically with other RSSI values. (do you need the other devices?)
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

There's also a bit more of this, when I do Clear pending status:

[11:21:07]BLE Image is pending
[11:21:07]BLE Could not create buffer!
[11:21:12]ping failed
[11:21:12]ping failed
[11:21:12]Resetting tag
[11:21:15]ping failed
[11:21:15]ping failed
[11:21:16]ping failed

(The ping fail is from the lack of attached tag)

<!-- gh-comment-id:1985993903 --> @andorardo commented on GitHub (Mar 8, 2024): There's also a bit more of this, when I do `Clear pending status`: ``` [11:21:07]BLE Image is pending [11:21:07]BLE Could not create buffer! [11:21:12]ping failed [11:21:12]ping failed [11:21:12]Resetting tag [11:21:15]ping failed [11:21:15]ping failed [11:21:16]ping failed ``` (The ping fail is from the lack of attached tag)
Author
Owner

@nlimper commented on GitHub (Mar 8, 2024):

The C6 part needs to work, or content will not be generated. If the AP showes 'failed', you should not expect it to work, even if you just have BLE tags. ;-)

<!-- gh-comment-id:1985998551 --> @nlimper commented on GitHub (Mar 8, 2024): The C6 part needs to work, or content will not be generated. If the AP showes 'failed', you should not expect it to work, even if you just have BLE tags. ;-)
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

Ah :)
How do I turn off the C6 part?

  1. is there a firmware without C6?
  2. can I compile one?
    For option 2, I looked into the configs, but wasn't sure which flags to comment out...
<!-- gh-comment-id:1985999729 --> @andorardo commented on GitHub (Mar 8, 2024): Ah :) How do I turn off the C6 part? 1. is there a firmware without C6? 2. can I compile one? For option 2, I looked into the configs, but wasn't sure which flags to comment out...
Author
Owner

@atc1441 commented on GitHub (Mar 8, 2024):

Exactly what @nlimper mentiones.

Otherwise the Manufacturer data looks good

The error message "BLE Could not create buffer" also hints into the problem direction.

@andorardo why can you not just flash the C6 and use it with it? EDIT ok you dont have the V4 Mini AP now i get it... yes that way it will just not work

<!-- gh-comment-id:1986002456 --> @atc1441 commented on GitHub (Mar 8, 2024): Exactly what @nlimper mentiones. Otherwise the Manufacturer data looks good The error message "BLE Could not create buffer" also hints into the problem direction. @andorardo why can you not just flash the C6 and use it with it? EDIT ok you dont have the V4 Mini AP now i get it... yes that way it will just not work
Author
Owner

@nlimper commented on GitHub (Mar 8, 2024):

nope... The BLE part is very new. We didn't have a situation yet where there is just BLE with no IEEE801.15.4 radio present.
If you compile it yourself: make sure that a ping just returns true, for a start. The AP will show 'online' then. It might work after that, You also might get other issues, just tackle them one by one ;-)

<!-- gh-comment-id:1986010740 --> @nlimper commented on GitHub (Mar 8, 2024): nope... The BLE part is very new. We didn't have a situation yet where there is just BLE with no IEEE801.15.4 radio present. If you compile it yourself: make sure that a ping just returns true, for a start. The AP will show 'online' then. It might work after that, You also might get other issues, just tackle them one by one ;-)
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

Although I have a C6 somewhere, I think this would be a good feature, so I'm trying the software route.
I hardwired sendPing to return true.

The error I get is at 2408b34c2b/ESP32_AP-Flasher/src/makeimage.cpp (L324)

no matter if BOARD_HAS_PSRAM is set.

If I uncomment BOARD_HAS_PSRAM, then instead I get an error at 2408b34c2b/ESP32_AP-Flasher/src/ble_writer.cpp (L168)

presumably because now there is not enough heap.

So I made both allocations malloc, and reduced the BUFFER_MAX_SIZE_COMPRESSING to 20k.

Now it gets to the point of trying to connect to the BLE tag, and

BLE Image is pending
BLE Compressed Length: 13620
BLE Connecting to: FF:FF:92:93:42:71
BLE onConnect
BLE starting to get service
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception). 
Debug exception reason: Stack canary watchpoint triggered (BTU_TASK) 
Core  0 register dump:
PC      : 0x40383f07  PS      : 0x00060136  A0      : 0x803817f0  A1      : 0x3fcd34f0  
A2      : 0x3fccffa0  A3      : 0xb33fffff  A4      : 0x0000abab  A5      : 0x00060123  
A6      : 0x00060120  A7      : 0x0000cdcd  A8      : 0xb33fffff  A9      : 0xffffffff  
A10     : 0x00060123  A11     : 0x00000000  A12     : 0x00060120  A13     : 0x00000002  
A14     : 0x02ccffa0  A15     : 0x00ffffff  SAR     : 0x00000011  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000  


Backtrace: 0x40383f04:0x3fcd34f0 0x403817ed:0x3fcd3530 0x420b2d97:0x3fcd3570 0x420b08a2:0x3fcd35a0 0x4208d8b8:0x3fcd35d0 0x420b5049:0x3fcd3600 0x420d7b6f:0x3fcd3890 0x420b5f5a:0x3fcd3b20 0x420d7732:0x3fcd3b40 0x420b5f5a:0x3fcd3bb0 0x420d73d5:0x3fcd3bd0 0x420b53a1:0x3fcd3bf0 0x420b53cd:0x3fcd3e80 0x420b548e:0x3fcd3ea0 0x420a6f45:0x3fcd3ec0 0x420a0f22:0x3fcd4170 0x420a1462:0x3fcd4400 0x420a2169:0x3fcd4480 0x420a3ac4:0x3fcd44d0 0x420a3b69:0x3fcd44f0 0x420ac509:0x3fcd4510 0x4209e280:0x3fcd4550 0x420b2ab7:0x3fcd4570

  #0  0x40383f04:0x3fcd34f0 in compare_and_set_native at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/compare_set.h:25
      (inlined by) spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:103
      (inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301
  #1  0x403817ed:0x3fcd3530 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578
      (inlined by) xQueueGenericSend at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/queue.c:840
  #2  0x420b2d97:0x3fcd3570 in osi_thead_work_queue_put at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:122
      (inlined by) osi_thread_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:344
  #3  0x420b08a2:0x3fcd35a0 in btc_task_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:214
      (inlined by) btc_transfer_context at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:259
  #4  0x4208d8b8:0x3fcd35d0 in btc_gattc_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gattc.c:189
  #5  0x420b5049:0x3fcd3600 in bta_gattc_search_service at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1133
  #6  0x420d7b6f:0x3fcd3890 in bta_gattc_search at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1546
  #7  0x420b5f5a:0x3fcd3b20 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304
  #8  0x420d7732:0x3fcd3b40 in bta_gattc_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1073
  #9  0x420b5f5a:0x3fcd3bb0 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304
  #10 0x420d73d5:0x3fcd3bd0 in bta_gattc_reset_discover_st at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:859
  #11 0x420b53a1:0x3fcd3bf0 in bta_gattc_explore_srvc at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:640 (discriminator 3)
  #12 0x420b53cd:0x3fcd3e80 in bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:724
      (inlined by) bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:697
  #13 0x420b548e:0x3fcd3ea0 in bta_gattc_disc_cmpl_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1085
  #14 0x420a6f45:0x3fcd3ec0 in gatt_end_operation at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_utils.c:2325
  #15 0x420a0f22:0x3fcd4170 in gatt_act_discovery at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:123
  #16 0x420a1462:0x3fcd4400 in gatt_process_read_info_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:499 (discriminator 4)
  #17 0x420a2169:0x3fcd4480 in gatt_client_handle_server_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:1192
  #18 0x420a3ac4:0x3fcd44d0 in gatt_data_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:1007
  #19 0x420a3b69:0x3fcd44f0 in gatt_le_data_ind at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:590
  #20 0x420ac509:0x3fcd4510 in l2c_rcv_acl_data at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/l2cap/l2c_main.c:275
  #21 0x4209e280:0x3fcd4550 in btu_hci_msg_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/btu/btu_task.c:144
  #22 0x420b2ab7:0x3fcd4570 in osi_thread_run at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:165

So some questions are:

  1. why is ps_malloc failing? Does that have anything to do with the absence of the C6?
  2. why is there relatively so little heap space? Does that have something to do with stuff that is not freed because of the missing C6?

EDIT: On the AP info page it says `psram size: 0

<!-- gh-comment-id:1986203524 --> @andorardo commented on GitHub (Mar 8, 2024): Although I have a C6 somewhere, I think this would be a good feature, so I'm trying the software route. I hardwired sendPing to return true. The error I get is at https://github.com/jjwbruijn/OpenEPaperLink/blob/2408b34c2b11a331841f81dc484ad9666fa8b5ae/ESP32_AP-Flasher/src/makeimage.cpp#L324 no matter if `BOARD_HAS_PSRAM` is set. If I uncomment `BOARD_HAS_PSRAM`, then instead I get an error at https://github.com/jjwbruijn/OpenEPaperLink/blob/2408b34c2b11a331841f81dc484ad9666fa8b5ae/ESP32_AP-Flasher/src/ble_writer.cpp#L168 presumably because now there is not enough heap. So I made both allocations `malloc`, and reduced the BUFFER_MAX_SIZE_COMPRESSING to 20k. Now it gets to the point of trying to connect to the BLE tag, and ``` BLE Image is pending BLE Compressed Length: 13620 BLE Connecting to: FF:FF:92:93:42:71 BLE onConnect BLE starting to get service Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception). Debug exception reason: Stack canary watchpoint triggered (BTU_TASK) Core 0 register dump: PC : 0x40383f07 PS : 0x00060136 A0 : 0x803817f0 A1 : 0x3fcd34f0 A2 : 0x3fccffa0 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x00060123 A6 : 0x00060120 A7 : 0x0000cdcd A8 : 0xb33fffff A9 : 0xffffffff A10 : 0x00060123 A11 : 0x00000000 A12 : 0x00060120 A13 : 0x00000002 A14 : 0x02ccffa0 A15 : 0x00ffffff SAR : 0x00000011 EXCCAUSE: 0x00000001 EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0x00000000 Backtrace: 0x40383f04:0x3fcd34f0 0x403817ed:0x3fcd3530 0x420b2d97:0x3fcd3570 0x420b08a2:0x3fcd35a0 0x4208d8b8:0x3fcd35d0 0x420b5049:0x3fcd3600 0x420d7b6f:0x3fcd3890 0x420b5f5a:0x3fcd3b20 0x420d7732:0x3fcd3b40 0x420b5f5a:0x3fcd3bb0 0x420d73d5:0x3fcd3bd0 0x420b53a1:0x3fcd3bf0 0x420b53cd:0x3fcd3e80 0x420b548e:0x3fcd3ea0 0x420a6f45:0x3fcd3ec0 0x420a0f22:0x3fcd4170 0x420a1462:0x3fcd4400 0x420a2169:0x3fcd4480 0x420a3ac4:0x3fcd44d0 0x420a3b69:0x3fcd44f0 0x420ac509:0x3fcd4510 0x4209e280:0x3fcd4550 0x420b2ab7:0x3fcd4570 #0 0x40383f04:0x3fcd34f0 in compare_and_set_native at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/compare_set.h:25 (inlined by) spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:103 (inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301 #1 0x403817ed:0x3fcd3530 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578 (inlined by) xQueueGenericSend at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/queue.c:840 #2 0x420b2d97:0x3fcd3570 in osi_thead_work_queue_put at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:122 (inlined by) osi_thread_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:344 #3 0x420b08a2:0x3fcd35a0 in btc_task_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:214 (inlined by) btc_transfer_context at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:259 #4 0x4208d8b8:0x3fcd35d0 in btc_gattc_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gattc.c:189 #5 0x420b5049:0x3fcd3600 in bta_gattc_search_service at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1133 #6 0x420d7b6f:0x3fcd3890 in bta_gattc_search at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1546 #7 0x420b5f5a:0x3fcd3b20 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304 #8 0x420d7732:0x3fcd3b40 in bta_gattc_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1073 #9 0x420b5f5a:0x3fcd3bb0 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304 #10 0x420d73d5:0x3fcd3bd0 in bta_gattc_reset_discover_st at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:859 #11 0x420b53a1:0x3fcd3bf0 in bta_gattc_explore_srvc at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:640 (discriminator 3) #12 0x420b53cd:0x3fcd3e80 in bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:724 (inlined by) bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:697 #13 0x420b548e:0x3fcd3ea0 in bta_gattc_disc_cmpl_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1085 #14 0x420a6f45:0x3fcd3ec0 in gatt_end_operation at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_utils.c:2325 #15 0x420a0f22:0x3fcd4170 in gatt_act_discovery at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:123 #16 0x420a1462:0x3fcd4400 in gatt_process_read_info_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:499 (discriminator 4) #17 0x420a2169:0x3fcd4480 in gatt_client_handle_server_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:1192 #18 0x420a3ac4:0x3fcd44d0 in gatt_data_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:1007 #19 0x420a3b69:0x3fcd44f0 in gatt_le_data_ind at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:590 #20 0x420ac509:0x3fcd4510 in l2c_rcv_acl_data at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/l2cap/l2c_main.c:275 #21 0x4209e280:0x3fcd4550 in btu_hci_msg_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/btu/btu_task.c:144 #22 0x420b2ab7:0x3fcd4570 in osi_thread_run at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:165 ``` So some **questions** are: 1. why is `ps_malloc` failing? Does that have anything to do with the absence of the C6? 2. why is there relatively so little heap space? Does that have something to do with stuff that is not freed because of the missing C6? ~EDIT: On the AP info page it says `psram size: 0~
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

For good measure, here is the output of the debug stuff in setup():

##################################
Internal Total heap 312164, internal Free Heap 273260
SPIRam Total heap 0, SPIRam Free Heap 0
ChipRevision 0, Cpu Freq 240, SDK Version v4.4.6-dirty
Flash Size 16777216, Flash Speed 80000000
##################################


Total heap: 312164
Free heap: 273260
Total PSRAM: 0
Free PSRAM: 0

ESP32 Partition table:
| Type | Sub |  Offset  |   Size   |       Label      |
| ---- | --- | -------- | -------- | ---------------- |
|  01  | 02  | 0x009000 | 0x005000 | nvs              |
|  01  | 00  | 0x00E000 | 0x002000 | otadata          |
|  00  | 10  | 0x010000 | 0x480000 | app0             |
|  00  | 11  | 0x490000 | 0x480000 | app1             |
|  01  | 82  | 0x910000 | 0x6E0000 | spiffs           |
|  01  | 03  | 0xFF0000 | 0x010000 | coredump         |

Should I be suspicious of that zero PSRAM part?

<!-- gh-comment-id:1986224098 --> @andorardo commented on GitHub (Mar 8, 2024): For good measure, here is the output of the debug stuff in setup(): ``` ################################## Internal Total heap 312164, internal Free Heap 273260 SPIRam Total heap 0, SPIRam Free Heap 0 ChipRevision 0, Cpu Freq 240, SDK Version v4.4.6-dirty Flash Size 16777216, Flash Speed 80000000 ################################## Total heap: 312164 Free heap: 273260 Total PSRAM: 0 Free PSRAM: 0 ESP32 Partition table: | Type | Sub | Offset | Size | Label | | ---- | --- | -------- | -------- | ---------------- | | 01 | 02 | 0x009000 | 0x005000 | nvs | | 01 | 00 | 0x00E000 | 0x002000 | otadata | | 00 | 10 | 0x010000 | 0x480000 | app0 | | 00 | 11 | 0x490000 | 0x480000 | app1 | | 01 | 82 | 0x910000 | 0x6E0000 | spiffs | | 01 | 03 | 0xFF0000 | 0x010000 | coredump | ``` Should I be suspicious of that zero PSRAM part?
Author
Owner

@nlimper commented on GitHub (Mar 8, 2024):

Yes. Make sure your psram is working, as it is needed for the buffers.
In platformio.ini are some more settings about the kind of psram your board is using. The default settings assume you have 16MB flash and 8MB psram, but in your first post you stated you have 2 MB psram. That should be enough, but make sure it's detected.

<!-- gh-comment-id:1986228319 --> @nlimper commented on GitHub (Mar 8, 2024): Yes. Make sure your psram is working, as it is needed for the buffers. In platformio.ini are some more settings about the kind of psram your board is using. The default settings assume you have 16MB flash and 8MB psram, but in your first post you stated you have 2 MB psram. That should be enough, but make sure it's detected.
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

What's the difference between the R2 and R8?

AFAICT the R2 has QD Quad SPI, which is already configured (??)
board_build.psram_type=qspi_opi

I'm not sure which config bit is relevant to the PSRAM -- can you give a clue?

<!-- gh-comment-id:1986255312 --> @andorardo commented on GitHub (Mar 8, 2024): What's the difference between the R2 and R8? AFAICT the R2 has QD Quad SPI, which is already configured (??) `board_build.psram_type=qspi_opi` I'm not sure which config bit is relevant to the PSRAM -- can you give a clue?
Author
Owner

@nlimper commented on GitHub (Mar 8, 2024):

A clue: check the data sheets, and the documentation on the board_build.psram_type, which is currenly set to octal instead of quad using that option.

<!-- gh-comment-id:1986268923 --> @nlimper commented on GitHub (Mar 8, 2024): A clue: check the data sheets, and the documentation on the board_build.psram_type, which is currenly set to octal instead of quad using that option.
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

Aha
board_build.arduino.memory_type = qio_qspi
fixed it.

For some reason it was the board_build.arduino.memory_type, rather than the psram_type.

Now there are no memory issues. 👍

Things still go awry:

BLE Image is pending
BLE Compressed Length: 13620
BLE Connecting to: FF:FF:92:93:42:71
<ADR 000024B21AE22748
BLE onConnect
BLE starting to get service
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception). 
Debug exception reason: Stack canary watchpoint triggered (BTU_TASK) 
Core  0 register dump:
PC      : 0x40383e7b  PS      : 0x00060836  A0      : 0x80381740  A1      : 0x3fcca9e0  
A2      : 0x3de078b8  A3      : 0xb33fffff  A4      : 0x0000abab  A5      : 0x00060823  
A6      : 0x00060820  A7      : 0x0000cdcd  A8      : 0x8038311e  A9      : 0xffffffff  
A10     : 0x3de078b8  A11     : 0xb33fffff  A12     : 0x3fcca9fc  A13     : 0x3fcaa755  
A14     : 0x00e078b8  A15     : 0x00ffffff  SAR     : 0x0000000f  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0x00000000  


Backtrace: 0x40383e78:0x3fcca9e0 0x4038173d:0x3fccaa20 0x420b313f:0x3fccaa60 0x420b0c4a:0x3fccaa90 0x4208dc60:0x3fccaac0 0x420b53f1:0x3fccaaf0 0x420d7f4f:0x3fccad80 0x420b6302:0x3fccb010 0x420d7b12:0x3fccb030 0x420b6302:0x3fccb0a0 0x420d77b5:0x3fccb0c0 0x420b5749:0x3fccb0e0 0x420b5775:0x3fccb370 0x420b5836:0x3fccb390 0x420a72ed:0x3fccb3b0 0x420a12ca:0x3fccb660 0x420a180a:0x3fccb8f0 0x420a2511:0x3fccb970 0x420a3e6c:0x3fccb9c0 0x420a3f11:0x3fccb9e0 0x420ac8b1:0x3fccba00 0x4209e628:0x3fccba40 0x420b2e5f:0x3fccba60

  #0  0x40383e78:0x3fcca9e0 in spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:100
      (inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301
  #1  0x4038173d:0x3fccaa20 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578
      (inlined by) xQueueGenericSend at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/queue.c:840
  #2  0x420b313f:0x3fccaa60 in osi_thead_work_queue_put at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:122
      (inlined by) osi_thread_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:344
  #3  0x420b0c4a:0x3fccaa90 in btc_task_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:214
      (inlined by) btc_transfer_context at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:259
  #4  0x4208dc60:0x3fccaac0 in btc_gattc_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gattc.c:189
  #5  0x420b53f1:0x3fccaaf0 in bta_gattc_search_service at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1133
  #6  0x420d7f4f:0x3fccad80 in bta_gattc_search at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1546
  #7  0x420b6302:0x3fccb010 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304
  #8  0x420d7b12:0x3fccb030 in bta_gattc_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1073
  #9  0x420b6302:0x3fccb0a0 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304
  #10 0x420d77b5:0x3fccb0c0 in bta_gattc_reset_discover_st at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:859
  #11 0x420b5749:0x3fccb0e0 in bta_gattc_explore_srvc at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:640 (discriminator 3)
  #12 0x420b5775:0x3fccb370 in bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:724
      (inlined by) bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:697
  #13 0x420b5836:0x3fccb390 in bta_gattc_disc_cmpl_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1085
  #14 0x420a72ed:0x3fccb3b0 in gatt_end_operation at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_utils.c:2325
  #15 0x420a12ca:0x3fccb660 in gatt_act_discovery at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:123
  #16 0x420a180a:0x3fccb8f0 in gatt_process_read_info_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:499 (discriminator 4)
  #17 0x420a2511:0x3fccb970 in gatt_client_handle_server_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:1192
  #18 0x420a3e6c:0x3fccb9c0 in gatt_data_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:1007
  #19 0x420a3f11:0x3fccb9e0 in gatt_le_data_ind at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:590
  #20 0x420ac8b1:0x3fccba00 in l2c_rcv_acl_data at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/l2cap/l2c_main.c:275
  #21 0x4209e628:0x3fccba40 in btu_hci_msg_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/btu/btu_task.c:144
  #22 0x420b2e5f:0x3fccba60 in osi_thread_run at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:165

Somehow it never gets as far as BLE_MAIN_STATE_UPLOAD.

What's the source of this panic?

<!-- gh-comment-id:1986323865 --> @andorardo commented on GitHub (Mar 8, 2024): Aha `board_build.arduino.memory_type = qio_qspi` fixed it. For some reason it was the board_build.**arduino**.memory_type, rather than the psram_type. Now there are no memory issues. 👍 Things still go awry: ``` BLE Image is pending BLE Compressed Length: 13620 BLE Connecting to: FF:FF:92:93:42:71 <ADR 000024B21AE22748 BLE onConnect BLE starting to get service Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception). Debug exception reason: Stack canary watchpoint triggered (BTU_TASK) Core 0 register dump: PC : 0x40383e7b PS : 0x00060836 A0 : 0x80381740 A1 : 0x3fcca9e0 A2 : 0x3de078b8 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x00060823 A6 : 0x00060820 A7 : 0x0000cdcd A8 : 0x8038311e A9 : 0xffffffff A10 : 0x3de078b8 A11 : 0xb33fffff A12 : 0x3fcca9fc A13 : 0x3fcaa755 A14 : 0x00e078b8 A15 : 0x00ffffff SAR : 0x0000000f EXCCAUSE: 0x00000001 EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0x00000000 Backtrace: 0x40383e78:0x3fcca9e0 0x4038173d:0x3fccaa20 0x420b313f:0x3fccaa60 0x420b0c4a:0x3fccaa90 0x4208dc60:0x3fccaac0 0x420b53f1:0x3fccaaf0 0x420d7f4f:0x3fccad80 0x420b6302:0x3fccb010 0x420d7b12:0x3fccb030 0x420b6302:0x3fccb0a0 0x420d77b5:0x3fccb0c0 0x420b5749:0x3fccb0e0 0x420b5775:0x3fccb370 0x420b5836:0x3fccb390 0x420a72ed:0x3fccb3b0 0x420a12ca:0x3fccb660 0x420a180a:0x3fccb8f0 0x420a2511:0x3fccb970 0x420a3e6c:0x3fccb9c0 0x420a3f11:0x3fccb9e0 0x420ac8b1:0x3fccba00 0x4209e628:0x3fccba40 0x420b2e5f:0x3fccba60 #0 0x40383e78:0x3fcca9e0 in spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:100 (inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301 #1 0x4038173d:0x3fccaa20 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578 (inlined by) xQueueGenericSend at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/queue.c:840 #2 0x420b313f:0x3fccaa60 in osi_thead_work_queue_put at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:122 (inlined by) osi_thread_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:344 #3 0x420b0c4a:0x3fccaa90 in btc_task_post at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:214 (inlined by) btc_transfer_context at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/btc/core/btc_task.c:259 #4 0x4208dc60:0x3fccaac0 in btc_gattc_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/btc/profile/std/gatt/btc_gattc.c:189 #5 0x420b53f1:0x3fccaaf0 in bta_gattc_search_service at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1133 #6 0x420d7f4f:0x3fccad80 in bta_gattc_search at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1546 #7 0x420b6302:0x3fccb010 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304 #8 0x420d7b12:0x3fccb030 in bta_gattc_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:1073 #9 0x420b6302:0x3fccb0a0 in bta_gattc_sm_execute at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_main.c:304 #10 0x420d77b5:0x3fccb0c0 in bta_gattc_reset_discover_st at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_act.c:859 #11 0x420b5749:0x3fccb0e0 in bta_gattc_explore_srvc at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:640 (discriminator 3) #12 0x420b5775:0x3fccb370 in bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:724 (inlined by) bta_gattc_char_dscpt_disc_cmpl at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:697 #13 0x420b5836:0x3fccb390 in bta_gattc_disc_cmpl_cback at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/bta/gatt/bta_gattc_cache.c:1085 #14 0x420a72ed:0x3fccb3b0 in gatt_end_operation at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_utils.c:2325 #15 0x420a12ca:0x3fccb660 in gatt_act_discovery at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:123 #16 0x420a180a:0x3fccb8f0 in gatt_process_read_info_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:499 (discriminator 4) #17 0x420a2511:0x3fccb970 in gatt_client_handle_server_rsp at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_cl.c:1192 #18 0x420a3e6c:0x3fccb9c0 in gatt_data_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:1007 #19 0x420a3f11:0x3fccb9e0 in gatt_le_data_ind at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/gatt/gatt_main.c:590 #20 0x420ac8b1:0x3fccba00 in l2c_rcv_acl_data at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/l2cap/l2c_main.c:275 #21 0x4209e628:0x3fccba40 in btu_hci_msg_process at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/stack/btu/btu_task.c:144 #22 0x420b2e5f:0x3fccba60 in osi_thread_run at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c:165 ``` Somehow it never gets as far as `BLE_MAIN_STATE_UPLOAD`. What's the source of this panic?
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

A bit of logging narrows down the error while it's waiting here:

m_haveServices = (m_semaphoreSearchCmplEvt.wait("getServices") == 0);

roughly here:
adc2aee2f0/src/BLEClient.cpp (L435)

(Reproducibly)

<!-- gh-comment-id:1986367365 --> @andorardo commented on GitHub (Mar 8, 2024): A bit of logging narrows down the error while it's waiting here: ```c m_haveServices = (m_semaphoreSearchCmplEvt.wait("getServices") == 0); ``` roughly here: https://github.com/nkolban/ESP32_BLE_Arduino/blob/adc2aee2f0d01eb6b30dd5ad3589f2cc89934beb/src/BLEClient.cpp#L435 (Reproducibly)
Author
Owner

@andorardo commented on GitHub (Mar 8, 2024):

This: EXCVADDR: 0x00000000 looks like null pointer access.

<!-- gh-comment-id:1986463639 --> @andorardo commented on GitHub (Mar 8, 2024): This: `EXCVADDR: 0x00000000` looks like null pointer access.
Author
Owner

@andorardo commented on GitHub (Mar 9, 2024):

One more thing I discovered: It is enough to simply wait 1-2 seconds (vTaskDelay after the esp_ble_gattc_search_service) and the panic is triggered.

This seems to be way deep in the ESP infra. (?!)

@atc1441 , any thoughts on what might be causing this?

Is this a bug we're tickling, or still some interaction with the AP tasks or being low on memory?

<!-- gh-comment-id:1986556617 --> @andorardo commented on GitHub (Mar 9, 2024): One more thing I discovered: It is enough to simply wait 1-2 seconds (`vTaskDelay` after the `esp_ble_gattc_search_service`) and the panic is triggered. This seems to be way deep in the ESP infra. (?!) @atc1441 , any thoughts on what might be causing this? Is this a bug we're tickling, or still some interaction with the AP tasks or being low on memory?
Author
Owner

@jrtraynor commented on GitHub (May 6, 2024):

I had the same issue regarding corrupt ble displays as you described. I was also just using a C3 with no C6 connected, (with the ping set to return true as described above). My two Gickisky 4.2 EPD screens also didn't often respond to updates although were detected just fine in OEPL. Anyway, noticed this morning of some new BLE updates were added by @atc1441 , so rebuilt the C3 from the latest code. and now they're both working just fine and not corrupt at all.
Also noticed that the range wasn't great so added this to the ble_writer.cpp line 155
Serial.println("BLE task started"); BLEDevice::init("ESP32"); BLEDevice::setPower(ESP_PWR_LVL_P12);
And the range is much better, but that might just be on my Lolin C3

<!-- gh-comment-id:2095749963 --> @jrtraynor commented on GitHub (May 6, 2024): I had the same issue regarding corrupt ble displays as you described. I was also just using a C3 with no C6 connected, (with the ping set to return true as described above). My two Gickisky 4.2 EPD screens also didn't often respond to updates although were detected just fine in OEPL. Anyway, noticed this morning of some new BLE updates were added by @atc1441 , so rebuilt the C3 from the latest code. and now they're both working just fine and not corrupt at all. Also noticed that the range wasn't great so added this to the ble_writer.cpp line 155 ` Serial.println("BLE task started"); BLEDevice::init("ESP32"); BLEDevice::setPower(ESP_PWR_LVL_P12);` And the range is much better, but that might just be on my Lolin C3
Author
Owner

@atc1441 commented on GitHub (May 6, 2024):

Perfect, and yes the issue should be fixed now

<!-- gh-comment-id:2095755032 --> @atc1441 commented on GitHub (May 6, 2024): Perfect, and yes the issue should be fixed now
Author
Owner

@atc1441 commented on GitHub (May 6, 2024):

Gonna leave the BLE Power for now

<!-- gh-comment-id:2095756134 --> @atc1441 commented on GitHub (May 6, 2024): Gonna leave the BLE Power for now
Author
Owner

@andorardo commented on GitHub (Jun 3, 2024):

As of the recent 2.60 version https://github.com/OpenEPaperLink/OpenEPaperLink/releases/tag/2.60b, the new "BLE only AP" firmware Just Works. Bravo 👍

<!-- gh-comment-id:2145867500 --> @andorardo commented on GitHub (Jun 3, 2024): As of the recent 2.60 version https://github.com/OpenEPaperLink/OpenEPaperLink/releases/tag/2.60b, the new "BLE only AP" firmware Just Works. Bravo 👍
Author
Owner

@MajorAutomation commented on GitHub (Jun 16, 2025):

Just an FYI,

I have these working using a json file on my HA instance, Node Red creates a JSON file using a function node and saves a file that you can call from the web interface JSON with for example http://:8123/homeassistant/www/epaper/dinner.json.

Node red function looks like this.... it is listening to an anylist dinner string in my example.

// Get the AnyList event value
let dinnerRaw = msg.payload || "Nothing planned";

// Remove trailing date like " - 16 June 2025"
let dinner = dinnerRaw.split(" - ")[0].toUpperCase();  // Convert to uppercase

// Get the current day of the month (e.g., "16")
let dayOfMonth = new Date().getDate().toString();

// Build the JSON array with updated layout
let json = [
    { "text": [115, 90, dinner, "fonts/Signika-SB.ttf", 2, 1, 18] },
    { "box": [0, 0, 296, 59, 1, 2, 1] },
    { "text": [145, 14, "WHAT'S FOR DINNER", "fonts/Signika-SB.ttf", 0, 1, 28] },
    { "box": [234, 64, 59, 59, 2, 1, 0] },
    { "text": [242, 70, dayOfMonth, "fonts/Signika-SB.ttf", 0, 0, 40] }
];

// Output as a compact JSON string
msg.payload = JSON.stringify(json);

// Write to the correct file path
msg.filename = "/homeassistant/www/epaper/dinner.json";

return msg;

Which works perfectly and updates as the file changes.

You can design the layout here: https://atc1441.github.io/oepl_json_designer/ and then use this in the function node.

Just thought I'd share this as it was so much easier to setup custom displays.
This one looks like this
Image

<!-- gh-comment-id:2976236011 --> @MajorAutomation commented on GitHub (Jun 16, 2025): Just an FYI, I have these working using a json file on my HA instance, Node Red creates a JSON file using a function node and saves a file that you can call from the web interface JSON with for example http://<HA IP>:8123/homeassistant/www/epaper/dinner.json. Node red function looks like this.... it is listening to an anylist dinner string in my example. ``` // Get the AnyList event value let dinnerRaw = msg.payload || "Nothing planned"; // Remove trailing date like " - 16 June 2025" let dinner = dinnerRaw.split(" - ")[0].toUpperCase(); // Convert to uppercase // Get the current day of the month (e.g., "16") let dayOfMonth = new Date().getDate().toString(); // Build the JSON array with updated layout let json = [ { "text": [115, 90, dinner, "fonts/Signika-SB.ttf", 2, 1, 18] }, { "box": [0, 0, 296, 59, 1, 2, 1] }, { "text": [145, 14, "WHAT'S FOR DINNER", "fonts/Signika-SB.ttf", 0, 1, 28] }, { "box": [234, 64, 59, 59, 2, 1, 0] }, { "text": [242, 70, dayOfMonth, "fonts/Signika-SB.ttf", 0, 0, 40] } ]; // Output as a compact JSON string msg.payload = JSON.stringify(json); // Write to the correct file path msg.filename = "/homeassistant/www/epaper/dinner.json"; return msg; ``` Which works perfectly and updates as the file changes. You can design the layout here: https://atc1441.github.io/oepl_json_designer/ and then use this in the function node. Just thought I'd share this as it was so much easier to setup custom displays. This one looks like this ![Image](https://github.com/user-attachments/assets/fe1cccc2-0f6d-4e7c-9372-9852defceaf0)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#3470