Crash on connect with NCS 2.6.0

You can find all information about the issue and how to produce it on GitHub: github.com/.../ncs-2.6.0-connect-crash

  • Hi

    It's clear that the peripheral is what is crashing here. Based on your description I think the uart_rx_enable() is being enabled before you try to enable BLE with bt_enable(). Please see how uart_rx_enable() is used in our sample projects (as part of uart_init()).

    Best regards,

    Simon

  • Hi Simon,

    1) Moving uart_rx_enable to after bt_enable didn't fix the issue.

    2) Which sample do you mean? nrf/samples/bluetooth/peripheral_uart calls uart_rx_enable before bt_enable, too.

    3) Since we are heavily relying on zephyrs driver/device model, and initialization(and deinitialization) of Bluetooth and UART happen independently and based on external factors, changing the order is not an option for us.

    Thanks

    Michael

  • Hi

    I'm very sorry, for some reason I thought uart_rx_enable was enabling the radio peripheral for some reason, but I see I got way ahead of myself. I'm very sorry about the confusion here.

    Taking another look at the sample you're using I see you're basing your sample on the peripheral_hr sample, which is a Zephyr project, not tested with the nRF SoftDevice controller, so that might be the issue here, although I agree it's very strange it only propagates when uart_rx_enable and the SoftDevice controller is used.

    Please compare your project with the peripheral_hr_coded which is designed and tested for the nRF SoftDevice controller. 

    Bus faults are a bit tricky to debug, but you can try to check Faulting instruction address (r15/pc): 0x0000bb74 for what address this line is pointing to, you can use the command window in your build folder and the following command to get a file name and line number for that address: arm-none-eabi-addr2line -e _build/zephyr/zephyr.elf 0xbb74.

    Best regards,

    Simon

  • I've updated the code on the linked repository(please read the commit messages)

    - I have copied peripheral_hr_coded. This by itself doesn't crash

    - I have disabled the coded phy, changed the advertising name and removed the ext flag from the advertising options(but still using the ext API). Still doesn't crash

    - I have initialized UART DMA. Still doesn't crash

    - I have switched to zephyrs non ext advertising API. Still doesn't crash

    - I have disabled CONFIG_BT_EXT_ADV. Now it crashes.

    I tested a few more permutations and it looks like it's mostly important that DMA UART is initialized and that CONFIG_BT_EXT_ADV is disabled. To me, this still looks like a softdevice_controller bug rather than a usage bug.

  • Hmm, is there a reason you're using this Zephyr advertising API on your end? I don't see it being a great fit with the SoftDevice controller. I'm sorry, but I have not had time to set this up on my end yet but will try to do so tomorrow. It could be MTU related it seems, so could it be that the MTU sizes are invalid when disabling the extended advertising config and trying to enable the UART service? 

    I still think using the command window in your build folder and the following command to get a file name and line number for that address could be helpful, so please give it a try in the meantime: arm-none-eabi-addr2line -e _build/zephyr/zephyr.elf 0xbb74.

    Best regards,

    Simon

Related