With the recent release of SDK 2.8.0 enabling tracing with Segger Systemview locks up the system.
The offending issue is buf = net_buf_alloc(&hci_cmd_pool, K_FOREVER); which will block forever waiting for a buffer that will never become available. I am not sure if this is a NRF related change on other parts or a Zephyr but as I am using NCS I felt to report here first.
The following command builds on 2.8.0 and 2.7.0 without fail.
west build -b nrf5340dk/nrf5340/cpuapp --pristine=always nrf/samples/bluetooth/peripheral_bms
However only with 2.8.0 when tracing and systemview are enabled the LED no longer blinks and in Ozone I can trace and see it is stuck in the above line waiting.
west build -b nrf5340dk/nrf5340/cpuapp --pristine=always nrf/samples/bluetooth/peripheral_bms -- -DCONFIG_TRACING=y -DCONFIG_SEGGER_SYSTEMVIEW=y