-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
samples/bluetooth/unicast_audio_server doesn't configure heap memory for IPC #72708
Comments
Confirmed to be an issue. Thanks for the report |
Hi @yclistanford while I could reproduce an issue, it is not the same as you do. After the above PR, I can no longer reproduce any issues given the steps in this issue. Can you try to apply the changes from #72861 to your build and see if there is still an issue? |
@yclistanford PLease respond, else this issue will be closed. |
Yes I did need the BT buffer sizes in #72861. That's a separate issue. For the heap mem pool size, the sample has CONFIG_HEAP_MEM_POOL_ADD_SIZE_BOARD=4096 and that should become |
Thanks. The |
Describe the bug
I built the samples/bluetooth/unicast_audio_server for the nrf5340_audio_dk_nrf5340_cpuapp core/board. The sysbuild for that sample in turn builds samples/bluetooth/hci_ipc for nrf5340_audio_dk_nrf5340_cpunet core/board.
The application core and network core on the nrf5340 talk to each other using IPC RPMSG.
After flashing both images I saw that the network core allocates memory for the RPMSG virtqueue correctly (the memory allocation is done by this call to virtqueue_allocate: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/ipc/ipc_service/lib/ipc_static_vrings.c#L117) but the application core fails this call to virtqueue_allocate.
After a little digging I found that virtqueue_allocate is backed by modules/hal/libmetal and it expects CONFIG_HEAP_MEM_POOL_SIZE > 0. I checked the .config file, the network core has CONFIG_HEAP_MEM_POOL_SIZE=8192 but the application core has CONFIG_HEAP_MEM_POOL_SIZE unconfigured (though it has CONFIG_HEAP_MEM_POOL_ADD_SIZE_BOARD=4096).
After I added CONFIG_HEAP_MEM_POOL_SIZE=8192 to samples/bluetooth/unicast_audio_server/prj.conf, the application core can initialize IPC RPMSG correctly.
It seems either samples/bluetooth/unicast_audio_server needs that configuration, or libmetal should be smarter in memory allocation?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
samples/bluetooth/unicast_audio_server on nrf5340_audio_dk_nrf5340_cpuapp should successfully initialize IPC.
Impact
It slowed me down significantly in getting started with the NRF5340 Audio DK.
Logs and console output
Below are UART logs from the application core, including some of my custom printf logs:
static vrings init
metal_io_init
libmetal_setup
vq_setup, vring size 308
err -12
*** Booting Zephyr OS build v3.6.0-12-g7b42d8f8f9d7 ***
[00:00:00.258,239] bt_hci_driver: IPC service instance initialization failed:2
[00:00:00.258,239] bt_hci_core: HCI driver open failed (-12)
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: