HCI Driver open failed - NRF5340

Hello,

We have been successfully developing and debugging an NRF5340 application for many months now. We have been logging data over BLE as well, so we know that was working. However, we recently started getting an error when trying to start the Bluetooth which seems to be unrecoverable. The specific failure point occurs in the call to bt_dev.drv->open() in hci_core.c. Following this down into the function call, I get a failure at these lines within rpmsg.c:

err = k_sem_take(&ipc_bound_sem, IPC_BOUND_TIMEOUT_IN_MS);
if (err) {
    BT_ERR("Endpoint binding failed with %d", err);
    return err;
}
I tried recovering the network and application cores with the nrfjprog command line tools. They seem to complete successfully, but it doesn't solve the problem.
One (potentially) important point - we recently tried implementing a shutdown feature that calls:
pm_state_set(PM_STATE_SOFT_OFF, 0);
After this was called is when the problem started. I don't know if it is related or not, but reading through some other threads, it seems like maybe the network core Flash could have been corrupted...? But if so, why don't the recover commands work? These should be completely erasing Flash, correct?
Any help is greatly appreciated. We are under a tight timeline and this error has introduced a major instability in the code base.
Thank you,
Jamie
Parents
  • The issue seems to be similar to what was described here

    Can you see if you have enabled CONFIG_BT_RPC_STACK=y in prj.conf, prestine build and see if that could be the source of the issue.

  • Okay - sorry for all the updates, but this one is probably the biggest clue yet. We had updated the toolchains for this latest build and that seems to be the actual root of the problem. I downgraded to toolchain and SDK v2.0.2 (which was our standard for all previous development), now the BLE is working again. However, I am still not able to get into debug mode. Still getting the SIGTRAP before I get to main. So not completely solved yet. Any ideas?

    This is my debug configuration:

    {
    	"version": "0.2.0",
    	"configurations": [
    		{
    			"type": "nrf-connect",
    			"request": "launch",
    			"name": "Launch build",
    			"config": "${workspaceFolder}/build",
    			"runToEntryPoint": "main"
    		}
    	]
    }

  • jmilliken said:
    Okay - sorry for all the updates, but this one is probably the biggest clue yet. We had updated the toolchains for this latest build and that seems to be the actual root of the problem. I downgraded to toolchain and SDK v2.0.2 (which was our standard for all previous development), now the BLE is working again. However, I am still not able to get into debug mode.

    First of all you should not be using such an old SDK for development. It looks like you have some porting issues in your code that compiles OK but seems like not compatible with the changes required for the newer SDK. 

    jmilliken said:

    However, I am still not able to get into debug mode. Still getting the SIGTRAP before I get to main. So not completely solved yet. Any ideas?

    This is my debug configuration:

    Can you check the speed of the debugger, it looks a bit similar to this thread, Can you try debugging with Ozone and see if it works and if nrf-connect is trying to clock the debugger with really high speed. If so, we can change the debugger speed with which nrf-connect ide start to something lower in the configuration file.

  • Thanks. Regarding the debug link, it does sound like this could be the problem. The J-Link speed is set to 12MHz. I will try Ozone, but for VS Code debugging, how to do I specify the J-Link speed in the launch json?

  • Update - I managed to change the debug speed based on this answer and that was worked. I'm all set there, thank you for the help. I would like to go back to the other problem of not being able to use the most up to date SDK and toolchain to see if we can fix that as well.

Reply Children
No Data
Related