Skip to content

Conversation

Links2004
Copy link
Contributor

@Links2004 Links2004 commented Sep 6, 2025

This PR update NimbleBLE to 2.3.6 and does the needed migrations.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      ESP32-S3 + RF95
      ESP32-C3 + RF95

@CLAassistant
Copy link

CLAassistant commented Sep 6, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@thebentern
Copy link
Contributor

This will need to be tested thoroughly on ESP32 / ESP32S3 and C3 targets on both Android and iOS, as we've experienced regressions in almost every big NimBLE upgrade.

@Links2004
Copy link
Contributor Author

I Tested with Android + ESP32-S3 and ESP32-C3, can build a ESP32 hardware if needed,
but I dont have access to IOS based devices.

@vidplace7 vidplace7 added the dependencies Pull requests that update a dependency file label Sep 6, 2025
@jp-bennett
Copy link
Collaborator

@Links2004 I manually pulled part of this patch in, to get support for an upcoming esl32-c6 device ironed out. I would love to get this PR to apply the new nimble version to all the c6 devices. We can use them as a test platform to find any outstanding problems.

@Links2004
Copy link
Contributor Author

will rebase to fix the conflicts

@Links2004
Copy link
Contributor Author

@jp-bennett did find one missing ifdef NimBLEDevice::setPower(ESP_PWR_LVL_P9);

@Links2004 Links2004 force-pushed the nimble_update branch 2 times, most recently from b5bbb1d to f592272 Compare September 20, 2025 10:53
@Links2004
Copy link
Contributor Author

looks like that the ESP32 is running out of RAM.

the pax module for example has seen_ids_map which takes ~8k all the time.

had a short look and there is a loot of big static buffers and allocations in the firmware:

Num: Value Size Type Bind Vis Ndx Name
15734: 3ffcb3b0 16444 OBJECT GLOBAL HIDDEN 13 _ZL10staticPool$[...]
9534: 3ffc1880 8188 OBJECT GLOBAL HIDDEN 9 seen_ids_map
15115: 3ffc8c24 8068 OBJECT GLOBAL HIDDEN 13 _ZL32staticMqttC[...]
6415: 3ffd286c 4096 OBJECT LOCAL DEFAULT 13 _ZL10workBuffer
10739: 3ffda048 3800 OBJECT GLOBAL DEFAULT 13 g_cnxMgr
12414: 4008a9e0 2939 FUNC GLOBAL DEFAULT 8 r_lld_evt_restart
3426: 400938bc 2794 FUNC LOCAL DEFAULT 8 __strftime
16186: 4008c5d4 2128 FUNC GLOBAL DEFAULT 8 r_rwble_isr
18463: 3ffdb7f0 2048 OBJECT GLOBAL DEFAULT 13 vflash_mem
9078: 4008d030 2007 FUNC GLOBAL DEFAULT 8 r_rwbt_isr
17173: 3ffcabe0 1984 OBJECT GLOBAL HIDDEN 13 _ZL28staticClien[...]
13601: 3ffcf3f0 1648 OBJECT GLOBAL HIDDEN 13 webAPI
16701: 3ffc74a0 1628 OBJECT GLOBAL HIDDEN 13 devicestate
7310: 3ffd5e2a 1460 OBJECT LOCAL DEFAULT 13 packet$9066
9503: 4008a32c 1422 FUNC GLOBAL DEFAULT 8 r_lld_evt_schedule
19303: 40095e34 1397 FUNC GLOBAL DEFAULT 8 rtc_sleep_init
7850: 3ffd80cc 1248 OBJECT LOCAL DEFAULT 13 ZN12_GLOBAL__N[...]
15126: 4008b80c 1222 FUNC GLOBAL DEFAULT 8 r_lld_pdu_rx_handler
6904: 3ffd4e34 1184 OBJECT LOCAL DEFAULT 13 dns_table
13407: 3ffd9988 1180 OBJECT GLOBAL DEFAULT 13 s_wifi_nvs
6229: 3ffd65e4 1124 OBJECT LOCAL DEFAULT 13 s_coredump_stack
15323: 40089da8 1122 FUNC GLOBAL DEFAULT 8 r_lld_evt_end
5476: 3ffbe31a 1000 OBJECT LOCAL DEFAULT 9 _ZL12chirpy_hirez
2057: 40084b9c 999 FUNC LOCAL DEFAULT 8 esp_sleep_start
15002: 3ffcfe28 992 OBJECT GLOBAL HIDDEN 13 bme680Sensor
15125: 3ffc1058 960 OBJECT GLOBAL DEFAULT 9 TxRxCxt
16685: 40089190 934 FUNC GLOBAL DEFAULT 8 ld_inq_frm_isr_w[...]
16080: 4008bd44 934 FUNC GLOBAL DEFAULT 8 lld_pdu_tx_prog_llcp
16789: 40094ca4 932 FUNC GLOBAL DEFAULT 8 _tzset_unlocked_r
19254: 4009cce4 932 FUNC GLOBAL DEFAULT 8 tlsf_realloc
15592: 40092f30 898 FUNC GLOBAL DEFAULT 8 mktime
13455: 3ffd8d68 844 OBJECT GLOBAL DEFAULT 13 gWpaSm
11750: 40090b30 787 FUNC GLOBAL DEFAULT 8 tx_pwctrl_cal
5395: 3ffbdedd 768 OBJECT LOCAL DEFAULT 9 contentTypes
4112: 3ffd1d70 768 OBJECT LOCAL DEFAULT 13 ble_att_svr_prep[...]
12909: 4009c9e8 761 FUNC GLOBAL DEFAULT 8 tlsf_malloc
17508: 4009c6e4 754 FUNC GLOBAL DEFAULT 8 tlsf_free
19127: 3ffc83e8 720 OBJECT GLOBAL HIDDEN 13 config
3862: 400877d0 718 FUNC LOCAL DEFAULT 8 ke_task_schedule
14546: 40088ccc 718 FUNC GLOBAL DEFAULT 8 ld_acl_frm_isr
9769: 4008eb80 718 FUNC GLOBAL DEFAULT 8 coex_force_wifi_mode
13679: 40092370 685 FUNC GLOBAL DEFAULT 8 __sfvwrite_r
19042: 40090878 663 FUNC GLOBAL DEFAULT 8 set_chan_dig_gain
18271: 40086bb8 644 FUNC GLOBAL DEFAULT 8 r_ea_elt_insert
10069: 3ffd963c 636 OBJECT GLOBAL DEFAULT 13 g_ic
9625: 40087abc 618 FUNC GLOBAL DEFAULT 8 r_ld_sco_audio_isr
12983: 3ffc7ea4 616 OBJECT GLOBAL HIDDEN 13 channelFile
2529: 4008188c 612 FUNC LOCAL DEFAULT 8 i2c_master_cmd_b[...]
10995: 3ffc7c44 608 OBJECT GLOBAL HIDDEN 13 moduleConfig
13576: 400821f0 608 FUNC GLOBAL DEFAULT 8 spi_flash_mmap_pages
14505: 40087e34 600 FUNC GLOBAL DEFAULT 8 ld_sco_frm_isr_w[...]
14752: 4009c14c 590 FUNC GLOBAL DEFAULT 8 wdt_hal_init
6012: 3ffd6b24 588 OBJECT LOCAL DEFAULT 13 s_reg_dump$5943
12211: 40083748 569 FUNC GLOBAL DEFAULT 8 call_start_cpu0
10603: 40088814 565 FUNC GLOBAL DEFAULT 8 r_ld_fm_prog_push
3415: 40092d04 553 FUNC LOCAL DEFAULT 8 validate_structure
7832: 3ffd863c 544 OBJECT LOCAL DEFAULT 13 ZN12_GLOBAL__N[...]
3978: 4008dd80 542 FUNC LOCAL DEFAULT 8 btdm_bb_isr
12705: 400992a0 539 FUNC GLOBAL DEFAULT 8 vTaskSwitchContext
5043: 3ffd2644 531 OBJECT LOCAL DEFAULT 13 ZN12_GLOBAL__N[...]
10308: 4009ba48 529 FUNC GLOBAL DEFAULT 8 spi_flash_hal_co[...]
3869: 40088414 526 FUNC LOCAL DEFAULT 8 coex_classic_bt_[...]
15721: 4008293c 522 FUNC GLOBAL DEFAULT 8 esp_flash_erase_[...]
14678: 4009d7ec 516 FUNC GLOBAL DEFAULT 8 BT_init_rx_filters
3745: 4009aa7c 514 FUNC LOCAL DEFAULT 8 prvTimerTask
4082: 3ffd164c 512 OBJECT LOCAL DEFAULT 13 _ZL11lastToRadio
5183: 3ffd3b04 512 OBJECT LOCAL DEFAULT 13 serialBytes
3696: 3ffd58ec 500 OBJECT LOCAL DEFAULT 13 pxReadyTasksLists

readelf -a firmware.elf --> libreoffice to sort

@Links2004
Copy link
Contributor Author

opend some PRs to save some memory with some easy changes, lets see if the builds work again after.

@jp-bennett
Copy link
Collaborator

had a short look and there is a loot of big static buffers and allocations in the firmware:

Some of these embedded platforms have essentially zero memory management, and memory fragmentation is effectively the same thing as memory leaking. So we have intentionally gone with static memory over dynamic allocation in a lot of places.

#8055 in particular looks really good, to save ram.

@Links2004
Copy link
Contributor Author

did start work on the I2C sensor devices: #8054
some feedback there will be helpfull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants