About BLE connection of nRF5340 Audio

Currently, I am creating a CIS-connected device using nRF5340 Audio on a homemade board.

Since the circuit configurations of the Gateway and Headset are different, I have created separate folders for each and executed the following commands on the command line.

〇Build headset
west build C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-1 -b nrf5340_audio_dk_nrf5340_cpuapp -d C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-1\build\dev_headset\build_release - DCONFIG_AUDIO_DEV=1 -DCONFIG_AUDIO_DFU=1 -DCONFIG_B0N_MINIMAL=y -DCONF_FILE=prj_release.conf
〇Build gateway
west build C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-2 -b nrf5340_audio_dk_nrf5340 _cpuapp -d C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-2\build\dev_gateway\build_release -DCONFIG_AUDIO_DEV=2 -DCONFIG_AUDIO_DFU=1 -DCONFIG_B0N_MINIMAL=y -DCONF_FILE=prj_release.conf

〇Using the debugger with serial number 1050198852, erase all user code and UICR flash areas of the network core, reset the device, and turn off APPROTECT gateway
nrfjprog --recover --coprocessor CP_NETWORK --snr 821007475
〇Using the debugger with serial number 1050188709, erase all user code and UICR flash areas of the network core, reset the device, and turn off APPROTECT headset
nrfjprog --recover --coprocessor CP_NETWORK --snr 821007475
〇Use the debugger with serial number 1050198852 to erase all user code and UICR flash areas of the application core, reset the device, and turn off APPROTECT. gateway
nrfjprog --recover --coprocessor CP_APPLICATION --snr 821007475
〇Use the debugger with serial number 1050188709 to erase all user code and UICR flash areas of the application core, reset the device, and turn off APPROTECT. headset
nrfjprog --recover --coprocessor CP_APPLICATION --snr 821007475
〇Write to the network core. gateway
nrfjprog --program C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-2\build\dev_gateway\build_release\zephyr\net_core_app_signed.hex -f NRF53 -q --snr 821007475 --sectorerase --coprocessor CP_NETWORK
〇Write to network core headset
nrfjprog --program C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-1\build\dev_headset\build_release\zephyr\net_core_app_signed.hex -f NRF53 -q --snr 821007475 --sectorerase --coprocessor CP_NETWORK
〇Write to application core gateway
nrfjprog --program C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-2\build\dev_gateway\build_release\zephyr\merged.hex -f NRF53 -q --snr 821007475 --chiperase --coprocessor CP_APPLICATION
〇 Write to application core headset
nrfjprog --program C:\Users\TSP_M1\nrf5340_audio_copy4-2-2-1\build\dev_headset\build_release\zephyr\merged.hex -f NRF53 -q --snr 821007475 --chiperase --coprocessor CP_APPLICATION
〇 Enter value 260116286 into memory address 16744688 using debugger with serial number 260116286 gateway
nrfjprog --memwr 16744688 --val 821007475 --snr 821007475
〇Use the debugger with serial number 821007475 to input the value 0 to memory address 16744692 headset
nrfjprog --memwr 16744692 --val 0 --snr 821007475
〇Use the debugger with serial number 260116286 to reset the device and run the program gateway
nrfjprog -r --snr 821007475
〇Use the debugger with serial number 821007475 to input the value 821007475 to memory address 16744688 headset
nrfjprog --memwr 16744688 --val 821007475 --snr 821007475
〇Reset the device and run the program using the debugger with serial number 821007475 headset
nrfjprog -r --snr 821007475

Now, the Gateway and Headset are connected via BLE, and it has been confirmed that the sound source is input from the Gateway and sound comes out from the Headset.

If you change the Gateway and write only to the Gateway with the above command, you will not be able to connect to BLE.
If you write to both together, it will work normally.

What is the cause?

  • Hello,

    If you change the Gateway and write only to the Gateway with the above command, you will not be able to connect to BLE.

    What command exactly do you refer to?

    Is the Headset already programmed at this point in time? Is the application on the Headset running? Have you tried resetting the Headset after programming the gateway? Perhaps the advertisements have stopped/timed out?

    I don't know exacty what you are writing to the specific addresses (around 0xFF 80F4). Is this used for filtering of some sort? How do you use that in your application? 

    Another possibility is that if you are bonding the devices, one device (the Headset) still has the old bonding information, but the newly programmed gateway does not, and hence, the Headset will reject a connection attempt from the gateway, because it no longer has the encryption keys. 

    Does the log from any the devices say anything when they do not connect?

    Best regards,

    Edvin

Related