zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.89k stars 6.63k forks source link

Unable to run bluetooth peripheral_hids sample on ESP32S3-Devkitc #81508

Open Zhi-Yih-Lim opened 3 hours ago

Zhi-Yih-Lim commented 3 hours ago

Describe the bug When attempting to run the "peripheral_hids" sample on ESP32S3 devkitc, CPU crashes on FATAL EXCEPTION when attempting to invoke the "bt_enable()" function. Building and flashing the "peripheral" sample results in the same error.

To Reproduce

  1. cd ~/zephyrproject/zephyr
  2. west blobs fetch hal_espressif
  3. west build -p -b esp32s3_devkitc/esp32s3/procpu samples/bluetooth/peripheral_hids
  4. west flash
  5. west espressif monitor

Logs and console output Serial port /dev/ttyUSB0 Connecting.... Detecting chip type... ESP32-S3 --- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x3fc958f8,len:0x2b34 load:0x40374000,len:0x118d4 0x40374000: _WindowOverflow4 at /home/parallels/zephyrproject/zephyr/arch/xtensa/core/window_vectors.S:56

SHA-256 comparison failed: Calculated: d4fed89d944d3015a901d3ed683cc8919d876461686a3104bd25874245ebe766 Expected: 00000000b0bb0000000000000000000000000000000000000000000000000000 Attempting to boot anyway... entry 0x4037f938 0x4037f938: __start at /home/parallels/zephyrproject/zephyr/soc/espressif/common/loader.c:231

I (99) boot: ESP Simple boot I (99) boot: compile time Nov 17 2024 22:05:55 W (100) boot: Unicore bootloader I (100) spi_flash: detected chip: gd I (101) spi_flash: flash io: dio W (104) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header. I (116) boot: chip revision: v0.2 I (119) boot.esp32s3: Boot SPI Speed : 40MHz I (123) boot.esp32s3: SPI Mode : DIO I (127) boot.esp32s3: SPI Flash Size : 8MB I (131) boot: Enabling RNG early entropy source... I (135) boot: DRAM: lma 0x00000020 vma 0x3fc958f8 len 0x2b34 (11060) I (142) boot: IRAM: lma 0x00002b5c vma 0x40374000 len 0x118d4 (71892) 0x40374000: _WindowOverflow4 at /home/parallels/zephyrproject/zephyr/arch/xtensa/core/window_vectors.S:56

I (148) boot: padd: lma 0x00014448 vma 0x00000000 len 0xbbb0 (48048) I (154) boot: IMAP: lma 0x00020000 vma 0x42000000 len 0x24510 (148752) 0x42000000: _stext at ??:?

I (161) boot: padd: lma 0x00044518 vma 0x00000000 len 0xbae0 (47840) I (167) boot: DMAP: lma 0x00050000 vma 0x3c030000 len 0x6dd0 (28112) I (173) boot: Image with 6 segments I (176) boot: DROM segment: paddr=00050000h, vaddr=3c030000h, size=06DD0h ( 28112) map I (184) boot: IROM segment: paddr=00020000h, vaddr=42000000h, size=2450Eh (148750) map I (228) heap: ESP runtime heap init at 0x3fc9f358 size 296 kB.

I (228) spi_flash: flash io: dio Booting Zephyr OS build v3.7.0-4339-g1ec5ce05f9f8 [00:00:00.241,000] fs_nvs: 8 Sectors of 4096 bytes [00:00:00.241,000] fs_nvs: alloc wra: 0, fe8 [00:00:00.241,000] fs_nvs: data wra: 0, 0 [00:00:00.241,000] esp32_bt_adapter: BT controller compile version [963cad4] [00:00:00.272,000] os: FATAL EXCEPTION [00:00:00.272,000] os: CPU 0 EXCCAUSE 28 (load prohibited) [00:00:00.272,000] os: ** PC 0x420012ff VADDR 0xf0b9d5c 0x420012ff: chunk_field at /home/parallels/zephyrproject/zephyr/lib/heap/heap.h:116

[00:00:00.272,000] os: PS 0x60e20 [00:00:00.272,000] os: (INTLEVEL:0 EXCM: 0 UM:1 RING:0 WOE:1 OWB:14 CALLINC:2) [00:00:00.272,000] os: A0 0x82001590 SP 0x3fc9ce60 A2 0x1ff A3 0xf0b9d58 [00:00:00.272,000] os: A4 0xf0b9d5c A5 0x20e A6 0xfcc3 A7 0 [00:00:00.272,000] os: A8 0x7fff A9 0x7fff A10 0x41c A11 0x3fc9d970 [00:00:00.272,000] os: A12 0x3fc9d972 A13 0x41c A14 0x3fc977bd A15 0x3fc9cf40 [00:00:00.272,000] os: LBEG 0x400570e8 LEND 0x400570f3 LCOUNT 0 [00:00:00.272,000] os: SAR 0x18 [00:00:00.272,000] os: ** THREADPTR 0x3fc99840 [00:00:00.272,000] os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0 [00:00:00.272,000] os: Current thread: 0x3fc990e8 (unknown) [00:00:00.388,000] os: Halting system

Environment:

Additional context The minimal code to reproduce the error:

include <zephyr/types.h>

include

include

include

include <zephyr/sys/printk.h>

include <zephyr/sys/byteorder.h>

include <zephyr/kernel.h>

include <zephyr/settings/settings.h>

include <zephyr/bluetooth/bluetooth.h>

include <zephyr/bluetooth/hci.h>

include <zephyr/bluetooth/conn.h>

include <zephyr/bluetooth/uuid.h>

include <zephyr/bluetooth/gatt.h>

int main (void){ // initialize BLE int err = bt_enable(NULL);

return 0;

}

github-actions[bot] commented 3 hours ago

Hi @Zhi-Yih-Lim! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙