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

nimBLE built with -O2 = array-bounds warnings (IDFGH-11151) #12318

Closed
3 tasks done
KaeLL opened this issue Sep 27, 2023 · 5 comments
Closed
3 tasks done

nimBLE built with -O2 = array-bounds warnings (IDFGH-11151) #12318

KaeLL opened this issue Sep 27, 2023 · 5 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@KaeLL
Copy link
Contributor

KaeLL commented Sep 27, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Describe: v5.2-dev-2934-g3b748a6cb7
Relevant nimBLE defconfig

CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
CONFIG_BT_NIMBLE_MAX_BONDS=0
CONFIG_BT_NIMBLE_MAX_CCCDS=0
CONFIG_BT_NIMBLE_SECURITY_ENABLE=n
CONFIG_BT_NIMBLE_GATT_MAX_PROCS=0
CONFIG_BT_NIMBLE_HS_FLOW_CTRL=n
Build log
[815/1139] Building C object esp-idf/bt/CMakeFiles/__idf_bt.dir/host/nimble/nimble/nimble/host/src/ble_store_util.c.obj
/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_store_util.c: In function 'ble_store_util_delete_oldest_peer':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_store_util.c:243:37: warning: array subscript 0 is outside array bounds of 'ble_addr_t[0]' [-Warray-bounds]
  243 |     rc = ble_store_util_delete_peer(&peer_id_addrs[0]);
      |                                     ^~~~~~~~~~~~~~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_store_util.c:228:16: note: while referencing 'peer_id_addrs'
  228 |     ble_addr_t peer_id_addrs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |                ^~~~~~~~~~~~~
[863/1139] Building C object esp-idf/bt/CMakeFiles/__idf_bt.dir/host/nimble/nimble/nimble/host/src/ble_hs_resolv.c.obj
/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs_resolv.c: In function 'ble_hs_resolv_list_rmv':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs_resolv.c:608:17: warning: array subscript 2 is above array bounds of 'struct ble_hs_resolv_entry[1]' [-Warray-bounds]
  608 |                 &g_ble_hs_resolv_list[position + 1],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs_resolv.c:40:35: note: while referencing 'g_ble_hs_resolv_list'
   40 | static struct ble_hs_resolv_entry g_ble_hs_resolv_list[BLE_RESOLV_LIST_SIZE];
      |                                   ^~~~~~~~~~~~~~~~~~~~
[874/1139] Building C object esp-idf/bt/CMakeFiles/__idf_bt.dir/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c.obj
In file included from /esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/hci_common.h:23,
                 from /esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:30,
                 from /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:36:
In function 'ble_addr_cmp',
    inlined from 'ble_store_ram_find_cccd' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:313:17:
/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:303:18: warning: array subscript [0, 306783378] is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  303 |     type_diff = a->type - b->type;
      |                 ~^~~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_find_cccd':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:48:5: note: object 'ble_store_ram_cccds' of size 0
   48 |     ble_store_ram_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~
In function 'ble_addr_cmp',
    inlined from 'ble_addr_cmp' at /esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:299:19,
    inlined from 'ble_store_ram_find_cccd' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:313:17:
/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:308:20: warning: array subscript [0, 306783378] is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  308 |     return memcmp(a->val, b->val, sizeof(a->val));
      |                   ~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_find_cccd':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:48:5: note: object 'ble_store_ram_cccds' of size 0
   48 |     ble_store_ram_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:319:21: warning: array subscript [0, 134217727] is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  319 |             if (cccd->chr_val_handle != key->chr_val_handle) {
      |                     ^~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:48:5: note: object 'ble_store_ram_cccds' of size 0
   48 |     ble_store_ram_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~
In function 'ble_store_ram_read_cccd',
    inlined from 'ble_store_ram_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:527:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:368:38: warning: array subscript idx is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  368 |     *value_cccd = ble_store_ram_cccds[idx];
      |                   ~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_read':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:48:5: note: while referencing 'ble_store_ram_cccds'
   48 |     ble_store_ram_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~
In function 'ble_store_ram_read_peer_sec',
    inlined from 'ble_store_ram_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:516:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:266:41: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  266 |     *value_sec = ble_store_ram_peer_secs[idx];
      |                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_read':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:44:5: note: while referencing 'ble_store_ram_peer_secs'
   44 |     ble_store_ram_peer_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_ram_read_our_sec',
    inlined from 'ble_store_ram_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:523:14,
    inlined from 'ble_store_ram_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:498:1:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:152:40: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  152 |     *value_sec = ble_store_ram_our_secs[idx];
      |                  ~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_read':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:40:5: note: while referencing 'ble_store_ram_our_secs'
   40 |     ble_store_ram_our_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_ram_write_cccd',
    inlined from 'ble_store_ram_write' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:562:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:391:24: warning: array subscript idx is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  391 |     ble_store_ram_cccds[idx] = *value_cccd;
      |     ~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_write':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:48:5: note: while referencing 'ble_store_ram_cccds'
   48 |     ble_store_ram_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~
In function 'ble_store_ram_write_peer_sec',
    inlined from 'ble_store_ram_write' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:554:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:293:28: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  293 |     ble_store_ram_peer_secs[idx] = *value_sec;
      |     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_write':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:44:5: note: while referencing 'ble_store_ram_peer_secs'
   44 |     ble_store_ram_peer_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_ram_write_our_sec',
    inlined from 'ble_store_ram_write' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:558:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:179:27: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  179 |     ble_store_ram_our_secs[idx] = *value_sec;
      |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c: In function 'ble_store_ram_write':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/ram/src/ble_store_ram.c:40:5: note: while referencing 'ble_store_ram_our_secs'
   40 |     ble_store_ram_our_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
[875/1139] Building C object esp-idf/bt/CMakeFiles/__idf_bt.dir/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c.obj
In file included from /esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/hci_common.h:23,
                 from /esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:30,
                 from /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:25:
In function 'ble_addr_cmp',
    inlined from 'ble_store_config_find_cccd' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:328:17:
/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:303:18: warning: array subscript [0, 306783378] is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  303 |     type_diff = a->type - b->type;
      |                 ~^~~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_find_cccd':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:38:5: note: object 'ble_store_config_cccds' of size 0
   38 |     ble_store_config_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
In function 'ble_addr_cmp',
    inlined from 'ble_addr_cmp' at /esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:299:19,
    inlined from 'ble_store_config_find_cccd' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:328:17:
/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:308:20: warning: array subscript [0, 306783378] is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  308 |     return memcmp(a->val, b->val, sizeof(a->val));
      |                   ~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_find_cccd':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:38:5: note: object 'ble_store_config_cccds' of size 0
   38 |     ble_store_config_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:334:21: warning: array subscript [0, 134217727] is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  334 |             if (cccd->chr_val_handle != key->chr_val_handle) {
      |                     ^~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:38:5: note: object 'ble_store_config_cccds' of size 0
   38 |     ble_store_config_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_config_read_cccd',
    inlined from 'ble_store_config_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:567:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:388:41: warning: array subscript idx is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  388 |     *value_cccd = ble_store_config_cccds[idx];
      |                   ~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_read':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:38:5: note: while referencing 'ble_store_config_cccds'
   38 |     ble_store_config_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_config_read_peer_sec',
    inlined from 'ble_store_config_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:556:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:274:44: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  274 |     *value_sec = ble_store_config_peer_secs[idx];
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_read':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:34:5: note: while referencing 'ble_store_config_peer_secs'
   34 |     ble_store_config_peer_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_config_read_our_sec',
    inlined from 'ble_store_config_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:563:14,
    inlined from 'ble_store_config_read' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:538:1:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:142:43: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  142 |     *value_sec = ble_store_config_our_secs[idx];
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_read':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:30:5: note: while referencing 'ble_store_config_our_secs'
   30 |     ble_store_config_our_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_config_write_cccd',
    inlined from 'ble_store_config_write' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:602:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:412:27: warning: array subscript idx is outside array bounds of 'struct ble_store_value_cccd[0]' [-Warray-bounds]
  412 |     ble_store_config_cccds[idx] = *value_cccd;
      |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_write':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:38:5: note: while referencing 'ble_store_config_cccds'
   38 |     ble_store_config_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_config_write_peer_sec',
    inlined from 'ble_store_config_write' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:594:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:302:31: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  302 |     ble_store_config_peer_secs[idx] = *value_sec;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_write':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:34:5: note: while referencing 'ble_store_config_peer_secs'
   34 |     ble_store_config_peer_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'ble_store_config_write_our_sec',
    inlined from 'ble_store_config_write' at /esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:598:14:
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:171:30: warning: array subscript idx is outside array bounds of 'struct ble_store_value_sec[0]' [-Warray-bounds]
  171 |     ble_store_config_our_secs[idx] = *value_sec;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c: In function 'ble_store_config_write':
/esp-idf/components/bt/host/nimble/nimble/nimble/host/store/config/src/ble_store_config.c:30:5: note: while referencing 'ble_store_config_our_secs'
   30 |     ble_store_config_our_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 27, 2023
@github-actions github-actions bot changed the title nimBLE built with -O2 = array-bounds warnings nimBLE built with -O2 = array-bounds warnings (IDFGH-11151) Sep 27, 2023
@rahult-github
Copy link
Collaborator

Hello @KaeLL ,

I tried at the same commit and it compiles cleanly. Attached log with verbose build output for reference. compile_o2_log.txt.

Since you observe the issue at your end, can you please help

  1. Double confirm you are on clean commit. You can do a git pull/ git submodule update to be sure .
  2. Can you please share your complete sdkconfig file .
  3. Also please mention how have you enabled the -O2 flag. One way of doing it is via menuconfig by setting the COMPILER_OPTIMIZATION_PERF option. But in case you have done any other way, then please share the same. I can try to same to reproduce the issue and fix it.

@AxelLin
Copy link
Contributor

AxelLin commented Sep 28, 2023

Hi @KaeLL
What is your build target SoC?

@KaeLL
Copy link
Contributor Author

KaeLL commented Sep 28, 2023

@rahult-github
1.

$ git status && echo '' && git describe --tags && echo '' && git submodule status
On branch master
Your branch is behind 'origin/master' by 131 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean

v5.2-dev-2934-g3b748a6cb7

 d037ec89546fad14b5c4d5456c2e23a71e554966 components/bootloader/subproject/components/micro-ecc/micro-ecc (v1.0)
 ffa102a7565dde12510b03d36b616ff9749fe1ad components/bt/controller/lib_esp32 (heads/master-12-gffa102a)
 9da8ad3ebd7932ea6f92578fb1337c7df5000ac7 components/bt/controller/lib_esp32c2/esp32c2-bt-lib (remotes/origin/HEAD)
 e9ad3d704f1034310de8f747d503ea5443df6b67 components/bt/controller/lib_esp32c3_family (remotes/origin/HEAD)
 97499655f3148ee273baadb6b48bbb168207d90b components/bt/controller/lib_esp32c6/esp32c6-bt-lib (heads/main-13-g9749965)
 ff664688f4fedb16c7eafc5bc88a4dacbc3e8ba5 components/bt/controller/lib_esp32h2/esp32h2-bt-lib (remotes/origin/HEAD)
 acdf522a21518a69b3582ff4a4e5b67512a13b32 components/bt/host/nimble/nimble (remotes/origin/nimble-1.5.0-idf)
 eeecc49ce8af123cf8ad40efdb9673e37b56230f components/cmock/CMock (v2.5.2-2-geeecc49)
 ad378ec993cde453b0c93439aa4dbcd317970ccf components/esp_coex/lib (remotes/origin/HEAD)
 95c370089907f74805eac72975b0e85c62e175ed components/esp_phy/lib (remotes/origin/HEAD)
 b74ee0160632978f0e36763f55be0ea6ee18f0c8 components/esp_wifi/lib (heads/master-48-gb74ee016)
 8c9cd0517adf99e363812e9a295dfe3898fdd345 components/heap/tlsf (heads/idf)
 102b03c8095de8a337c293f79dce189be63186f3 components/ieee802154/lib (remotes/origin/HEAD)
 cb8693b058ba302f4829ec6d03f609ac6f848546 components/json/cJSON (v1.7.15-18-gcb8693b)
 7896c6cad020d17a986f7e850f603e084e319328 components/lwip/lwip (remotes/origin/2.1.3-esp)
 727a037da6f9a62a9d3d5def5bd21a2bc9c621c6 components/mbedtls/mbedtls (mbedtls-3.4.1-8-g727a037da)
 05b347643f6679cc60a50a9664b86a24ebf3ae10 components/mqtt/esp-mqtt (ESP-MQTT_FOR_IDF_4.x-223-g05b3476)
 64c77643c92b76fff36bd13211f6b821c4beb8ef components/openthread/lib (remotes/origin/HEAD)
 4ae691476f07164dee3d12d304a9eb0b4f0ea0a3 components/openthread/openthread (thread-reference-20230119-574-g4ae691476)
 abc67a11c6db271bedbb9f58be85d6f4e2ea8389 components/protobuf-c/protobuf-c (v1.4.1)
 0dbb3f71c5f6fae3747a9d935372773762baf852 components/spiffs/spiffs (0.2-255-g0dbb3f7)
 7d2bf62b7e6afaf38153041a9d53c21aeeca9a25 components/unity/unity (v2.4.3-51-g7d2bf62)
2. Is the entire thing really necessary?
defconfig
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.2.0 Project Minimal Configuration
#
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS=y
CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_AFTER_NORESET=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_ota.csv"
CONFIG_PARTITION_TABLE_OFFSET=0xC000
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
CONFIG_COMPILER_WARN_WRITE_STRINGS=y
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
CONFIG_BT_NIMBLE_MAX_BONDS=0
CONFIG_BT_NIMBLE_MAX_CCCDS=0
CONFIG_BT_NIMBLE_SECURITY_ENABLE=n
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="AR"
CONFIG_BT_NIMBLE_GATT_MAX_PROCS=0
CONFIG_BT_NIMBLE_HS_FLOW_CTRL=n
CONFIG_BTDM_CTRL_BLE_MAX_CONN=1
CONFIG_BTDM_CTRL_MODEM_SLEEP=n
CONFIG_BTDM_BLE_SCAN_DUPL=n
CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=n
CONFIG_SPI_MASTER_IN_IRAM=y
CONFIG_SPI_SLAVE_ISR_IN_IRAM=n
CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=n
CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=n
CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=n
CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT=n
CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=n
CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM=y
CONFIG_GPTIMER_ISR_IRAM_SAFE=y
CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN=y
CONFIG_ESP_TLS_INSECURE=y
CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY=y
CONFIG_ETH_DMA_BUFFER_SIZE=256
CONFIG_ETH_DMA_RX_BUFFER_NUM=3
CONFIG_ETH_DMA_TX_BUFFER_NUM=3
CONFIG_ETH_USE_SPI_ETHERNET=n
CONFIG_ESP_EVENT_POST_FROM_ISR=n
CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH=y
CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP=y
CONFIG_ESP32_REV_MIN_1=y
CONFIG_RTC_CLK_SRC_INT_8MD256=y
CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=n
CONFIG_ESP_PHY_REDUCE_TX_POWER=y
CONFIG_ESP_PHY_RF_CAL_FULL=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP_MAIN_TASK_STACK_SIZE=10240
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
CONFIG_ESP_CONSOLE_UART_BAUDRATE=921600
CONFIG_ESP_INT_WDT_TIMEOUT_MS=30
CONFIG_ESP_TASK_WDT_PANIC=y
CONFIG_ESP_PANIC_HANDLER_IRAM=y
CONFIG_ESP_DEBUG_OCDAWARE=n
CONFIG_ESP_IPC_TASK_STACK_SIZE=1536
CONFIG_ESP_WIFI_NVS_ENABLED=n
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y
CONFIG_ESP_COREDUMP_CHECK_BOOT=n
CONFIG_ESP_COREDUMP_LOGS=n
CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=30
CONFIG_ESP_COREDUMP_STACK_SIZE=1024
CONFIG_FREERTOS_HZ=200
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=n
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_CORETIMER_1=y
CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y
CONFIG_LWIP_SNTP_MAX_SERVERS=4
CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN=y
CONFIG_MBEDTLS_TLS_CLIENT_ONLY=y
CONFIG_MBEDTLS_HKDF_C=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET=n
CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED=y
CONFIG_MQTT_REPORT_DELETED_MESSAGES=y
CONFIG_NVS_ASSERT_ERROR_CHECK=y
CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=n
CONFIG_ULP_COPROC_ENABLED=y
CONFIG_ULP_COPROC_RESERVE_MEM=128
CONFIG_WIFI_PROV_BLE_BONDING=y
CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y
3. Through menuconfig, as shown in the defconfig above.

@AxelLin Vanilla ESP32

@rahult-github
Copy link
Collaborator

Hi @KaeLL , Please help check if attached patch works for you. The patch is to be applied in $IDF_PATH/components/bt/host/nimble/nimble path.
fix_compilation_issue.txt

@KaeLL
Copy link
Contributor Author

KaeLL commented Sep 29, 2023

@rahult-github It does. Merge that.
Now, on a lightly related note, the same defconfig results in another warning

/esp-idf/components/espcoredump/src/core_dump_common.c:109:14: warning: unused variable 'bytes_free' [-Wunused-variable]
  109 |     uint32_t bytes_free = esp_core_dump_free_stack_space(s_coredump_stack);
      |              ^~~~~~~~~~

related to another component. Whether it needs filing a new issue or not, I'll leave it up to you. It's just that given how simple it is to fix it, it was worth noting.

@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new Status: Selected for Development Issue is selected for development labels Oct 4, 2023
espressif-bot pushed a commit that referenced this issue Nov 8, 2023
Added conditional compilation for logging stack usage only when CONFIG_ESP_COREDUMP_LOGS is
enabled.

Closes: #12318
espressif-bot pushed a commit that referenced this issue Nov 14, 2023
Added conditional compilation for logging stack usage only when CONFIG_ESP_COREDUMP_LOGS is
enabled.

Closes: #12318
espressif-bot pushed a commit that referenced this issue Nov 22, 2023
Added conditional compilation for logging stack usage only when CONFIG_ESP_COREDUMP_LOGS is
enabled.

Closes: #12318
movsb pushed a commit to movsb/esp-idf that referenced this issue Dec 1, 2023
Added conditional compilation for logging stack usage only when CONFIG_ESP_COREDUMP_LOGS is
enabled.

Closes: espressif#12318
hathach pushed a commit to adafruit/esp-idf that referenced this issue Mar 27, 2024
Added conditional compilation for logging stack usage only when CONFIG_ESP_COREDUMP_LOGS is
enabled.

Closes: espressif#12318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants