Systemview broken on SDK 2.8.0/Kernel 3.7.99

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

Parents Reply
  • Also a quick regex check with "k_fifo_put\(.*\(" shows there are several instances in the kernel where this happens, some of which will yield memory leaks when tracing is enabled. I would say every utilization of all the tracing macros should be looked at.

    Some samples:

    zephyr/subsys/bluetooth/host/hci_core.c

    zephyr/subsys/bluetooth/host/classic/rfcomm.c

    zephyr/subsys/bluetooth/mesh/adv.c

Children
Related