Help with the nrf21540 on the nrf5340_audio project

Hi,

I'm using nRF Connect version 2.9.1 with the buildprog script method of building this project.

I've got some custom boards based on the nRF5340_audio_dk. We swapped out the codec for a stereo one and went to a Fanstel BT40N module for better range, but it doesn't seem like the FEM/amplifier is working right.

Right now I'm handling it by adding --nrf21540 to the end of my buildprog command to tell it that I've got a nrf21540 shield, and then I edited the arduino_compatible.overlay and arduino_compatible_fwd.overlay files (attached) to change up the pinout to match what the BT40N needs. 

It's definitely working better than before I made those changes, but it doesn't seem to be working nearly as well as it should and I'm wondering if the amplifier is the problem.

Should the FEM be fully working with the changes I've made?

Also, even when it works I get a ton of sync errors. See attached debug log.

I'm going to try removing the --nrf21540 and just see what happens when I hardcode the pins to be in a TX or RX configuration - does the BIS broadcaster firmware do any receiving and does the BIS receiver firmware do any transmitting?

Thanks,

Glen

arduino_compatible.overlay

arduino_compatible_fwd.overlay


*** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.7.99-ca954a6216c9 ***
[00:00:01.036,041] <inf> fw_info:
         nRF5340 Audio nRF5340 Audio DK cpuapp
         NCS base version: 2.9.1
         Cmake run : Tue Jul 15 11:58:50 2025
[00:00:01.056,518] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:01.056,518] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:01.056,549] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 121.4259
 Build 3078678206
[00:00:01.090,606] <inf> bt_hci_core: Identity: F3:1F:3E:44:97:B6 (random)
[00:00:01.090,637] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x209a, manufacturer 0x0059
[00:00:01.090,637] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x209a
[00:00:01.091,003] <inf> bt_mgmt_ctlr_cfg: Controller: SoftDevice: Version 6.0 (0x0e), Revision 8346
[00:00:01.091,156] <inf> bt_mgmt: Local identity addr: F3:1F:3E:44:97:B6 (random)
[00:00:01.092,437] <err> TLV320: GDM cs47l63_comm_init
[00:00:01.092,468] <err> audiocodec: GDM cs47l63_initialize
[00:00:01.092,468] <err> TLV320: GDM cs47l63_comm_gpio_set
[00:00:01.094,543] <err> TLV320: GDM cs47l63_comm_gpio_set
[00:00:01.194,580] <err> TLV320: GDM End of cs47l63_comm_init
[00:00:01.194,610] <err> hw_codec: GDM Soft reset code
[00:00:01.195,831] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:01.195,831] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:02.503,387] <inf> main: PA sync lost, reason: 62
[00:00:02.503,387] <err> main: Failed to restart scanning: -120
[00:00:03.703,857] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:04.903,900] <inf> broadcast_sink: Sync with stereo channel
[00:00:04.903,900] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:04.904,083] <err> audio_system: GDM Decoder sample rate 48000
[00:00:04.904,083] <inf> main: Presentation delay 3000 us is set
[00:00:06.158,142] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:06.158,172] <inf> broadcast_sink: Stream sync lost
[00:00:06.158,203] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:06.158,203] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:06.158,233] <inf> broadcast_sink: Stream sync lost
[00:00:06.158,264] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:06.158,355] <inf> main: Sync lost
[00:00:06.158,752] <inf> main: PA sync lost, reason: 22
[00:00:06.159,576] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:06.159,606] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:06.159,606] <inf> main: Restarted scanning for broadcaster
[00:00:06.159,606] <inf> main: Sync lost
[00:00:06.159,637] <wrn> main: PA sync is NULL
[00:00:06.159,973] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:06.159,973] <err> bt_mgmt: Failed to delete PA sync
[00:00:06.159,973] <wrn> main: Failed to delete PA sync -13
[00:00:06.161,132] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:06.161,132] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:06.161,132] <inf> main: Restarted scanning for broadcaster
[00:00:07.503,906] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:08.103,912] <inf> broadcast_sink: Sync with stereo channel
[00:00:08.103,912] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:08.104,064] <err> audio_system: GDM Decoder sample rate 48000
[00:00:08.104,064] <inf> main: Presentation delay 3000 us is set
[00:00:09.958,160] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:09.958,190] <inf> broadcast_sink: Stream sync lost
[00:00:09.958,221] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:09.958,221] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:09.958,251] <inf> broadcast_sink: Stream sync lost
[00:00:09.958,282] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:09.958,374] <inf> main: Sync lost
[00:00:09.958,770] <inf> main: PA sync lost, reason: 22
[00:00:09.959,594] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:09.959,625] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:09.959,625] <inf> main: Restarted scanning for broadcaster
[00:00:09.959,625] <inf> main: Sync lost
[00:00:09.959,655] <wrn> main: PA sync is NULL
[00:00:09.959,991] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:09.959,991] <err> bt_mgmt: Failed to delete PA sync
[00:00:09.959,991] <wrn> main: Failed to delete PA sync -13
[00:00:09.961,151] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:09.961,151] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:09.961,151] <inf> main: Restarted scanning for broadcaster
[00:00:11.303,405] <inf> main: PA sync lost, reason: 62
[00:00:11.303,436] <err> main: Failed to restart scanning: -120
[00:00:12.503,906] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:13.103,942] <inf> broadcast_sink: Sync with stereo channel
[00:00:13.103,942] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:13.104,095] <err> audio_system: GDM Decoder sample rate 48000
[00:00:13.104,095] <inf> main: Presentation delay 3000 us is set
[00:00:15.558,197] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:15.558,197] <inf> broadcast_sink: Stream sync lost
[00:00:15.558,258] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:15.558,258] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:15.558,288] <inf> broadcast_sink: Stream sync lost
[00:00:15.558,319] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:15.558,410] <inf> main: Sync lost
[00:00:15.558,807] <inf> main: PA sync lost, reason: 22
[00:00:15.559,631] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:15.559,631] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:15.559,661] <inf> main: Restarted scanning for broadcaster
[00:00:15.559,661] <inf> main: Sync lost
[00:00:15.559,661] <wrn> main: PA sync is NULL
[00:00:15.560,028] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:15.560,028] <err> bt_mgmt: Failed to delete PA sync
[00:00:15.560,028] <wrn> main: Failed to delete PA sync -13
[00:00:15.561,187] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:15.561,187] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:15.561,187] <inf> main: Restarted scanning for broadcaster
[00:00:16.503,936] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:17.703,948] <inf> broadcast_sink: Sync with stereo channel
[00:00:17.703,948] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:17.704,132] <err> audio_system: GDM Decoder sample rate 48000
[00:00:17.704,132] <inf> main: Presentation delay 3000 us is set
[00:00:20.758,209] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:20.758,239] <inf> broadcast_sink: Stream sync lost
[00:00:20.758,270] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:20.758,270] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:20.758,300] <inf> broadcast_sink: Stream sync lost
[00:00:20.758,361] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:20.758,422] <inf> main: Sync lost
[00:00:20.758,850] <inf> main: PA sync lost, reason: 22
[00:00:20.759,674] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:20.759,674] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:20.759,674] <inf> main: Restarted scanning for broadcaster
[00:00:20.759,704] <inf> main: Sync lost
[00:00:20.759,704] <wrn> main: PA sync is NULL
[00:00:20.760,040] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:20.760,040] <err> bt_mgmt: Failed to delete PA sync
[00:00:20.760,040] <wrn> main: Failed to delete PA sync -13
[00:00:20.761,199] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:20.761,230] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:20.761,230] <inf> main: Restarted scanning for broadcaster
[00:00:21.503,967] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:22.103,973] <inf> broadcast_sink: Sync with stereo channel
[00:00:22.103,973] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:22.104,156] <err> audio_system: GDM Decoder sample rate 48000
[00:00:22.104,156] <inf> main: Presentation delay 3000 us is set
[00:00:22.758,239] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:22.758,239] <inf> broadcast_sink: Stream sync lost
[00:00:22.758,300] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:22.758,300] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:22.758,331] <inf> broadcast_sink: Stream sync lost
[00:00:22.758,361] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:22.758,453] <inf> main: Sync lost
[00:00:22.758,850] <inf> main: PA sync lost, reason: 22
[00:00:22.759,674] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:22.759,674] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:22.759,704] <inf> main: Restarted scanning for broadcaster
[00:00:22.759,704] <inf> main: Sync lost
[00:00:22.759,704] <wrn> main: PA sync is NULL
[00:00:22.760,040] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:22.760,070] <err> bt_mgmt: Failed to delete PA sync
[00:00:22.760,070] <wrn> main: Failed to delete PA sync -13
[00:00:22.761,230] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:22.761,230] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:22.761,230] <inf> main: Restarted scanning for broadcaster
[00:00:23.903,717] <inf> main: PA sync lost, reason: 62
[00:00:23.903,747] <err> main: Failed to restart scanning: -120
[00:00:24.503,997] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:25.704,010] <inf> broadcast_sink: Sync with stereo channel
[00:00:25.704,010] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:25.704,162] <err> audio_system: GDM Decoder sample rate 48000
[00:00:25.704,162] <inf> main: Presentation delay 3000 us is set
[00:00:29.358,276] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:29.358,276] <inf> broadcast_sink: Stream sync lost
[00:00:29.358,337] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:29.358,337] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:29.358,367] <inf> broadcast_sink: Stream sync lost
[00:00:29.358,398] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:29.358,489] <inf> main: Sync lost
[00:00:29.358,886] <inf> main: PA sync lost, reason: 22
[00:00:29.359,710] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:29.359,710] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:29.359,741] <inf> main: Restarted scanning for broadcaster
[00:00:29.359,741] <inf> main: Sync lost
[00:00:29.359,741] <wrn> main: PA sync is NULL
[00:00:29.360,076] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:29.360,107] <err> bt_mgmt: Failed to delete PA sync
[00:00:29.360,107] <wrn> main: Failed to delete PA sync -13
[00:00:29.361,267] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:29.361,267] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:29.361,267] <inf> main: Restarted scanning for broadcaster
[00:00:30.703,491] <inf> main: PA sync lost, reason: 62
[00:00:30.703,491] <err> main: Failed to restart scanning: -120
[00:00:31.504,028] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:32.704,040] <inf> broadcast_sink: Sync with stereo channel
[00:00:32.704,040] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:32.704,193] <err> audio_system: GDM Decoder sample rate 48000
[00:00:32.704,193] <inf> main: Presentation delay 3000 us is set
[00:00:33.958,282] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:33.958,312] <inf> broadcast_sink: Stream sync lost
[00:00:33.958,343] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:33.958,343] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:33.958,374] <inf> broadcast_sink: Stream sync lost
[00:00:33.958,404] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:33.958,496] <inf> main: Sync lost
[00:00:33.958,923] <inf> main: PA sync lost, reason: 22
[00:00:33.959,747] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:33.959,747] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:33.959,747] <inf> main: Restarted scanning for broadcaster
[00:00:33.959,777] <inf> main: Sync lost
[00:00:33.959,777] <wrn> main: PA sync is NULL
[00:00:33.960,113] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:33.960,113] <err> bt_mgmt: Failed to delete PA sync
[00:00:33.960,113] <wrn> main: Failed to delete PA sync -13
[00:00:33.961,273] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:33.961,273] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:33.961,273] <inf> main: Restarted scanning for broadcaster
[00:00:34.904,052] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:36.104,064] <inf> broadcast_sink: Sync with stereo channel
[00:00:36.104,064] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:36.104,217] <err> audio_system: GDM Decoder sample rate 48000
[00:00:36.104,217] <inf> main: Presentation delay 3000 us is set
[00:00:36.758,300] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:36.758,331] <inf> broadcast_sink: Stream sync lost
[00:00:36.758,361] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:36.758,361] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:36.758,392] <inf> broadcast_sink: Stream sync lost
[00:00:36.758,422] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:36.758,514] <inf> main: Sync lost
[00:00:36.758,911] <inf> main: PA sync lost, reason: 22
[00:00:36.759,735] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:36.759,735] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:36.759,735] <inf> main: Restarted scanning for broadcaster
[00:00:36.759,735] <inf> main: Sync lost
[00:00:36.759,765] <wrn> main: PA sync is NULL
[00:00:36.760,101] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:36.760,101] <err> bt_mgmt: Failed to delete PA sync
[00:00:36.760,101] <wrn> main: Failed to delete PA sync -13
[00:00:36.761,260] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:36.761,260] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:36.761,260] <inf> main: Restarted scanning for broadcaster
[00:00:37.304,046] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:38.504,058] <inf> broadcast_sink: Sync with stereo channel
[00:00:38.504,089] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:38.504,241] <err> audio_system: GDM Decoder sample rate 48000
[00:00:38.504,241] <inf> main: Presentation delay 3000 us is set
[00:00:39.158,325] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:39.158,325] <inf> broadcast_sink: Stream sync lost
[00:00:39.158,386] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:39.158,386] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:39.158,416] <inf> broadcast_sink: Stream sync lost
[00:00:39.158,447] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:39.158,538] <inf> main: Sync lost
[00:00:39.158,935] <inf> main: PA sync lost, reason: 22
[00:00:39.159,729] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:39.159,729] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:39.159,759] <inf> main: Restarted scanning for broadcaster
[00:00:39.159,759] <inf> main: Sync lost
[00:00:39.159,759] <wrn> main: PA sync is NULL
[00:00:39.160,095] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:39.160,125] <err> bt_mgmt: Failed to delete PA sync
[00:00:39.160,125] <wrn> main: Failed to delete PA sync -13
[00:00:39.161,285] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:39.161,285] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:39.161,285] <inf> main: Restarted scanning for broadcaster
[00:00:40.304,077] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:41.504,089] <inf> broadcast_sink: Sync with stereo channel
[00:00:41.504,089] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:41.504,241] <err> audio_system: GDM Decoder sample rate 48000
[00:00:41.504,272] <inf> main: Presentation delay 3000 us is set
[00:00:42.158,325] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:42.158,355] <inf> broadcast_sink: Stream sync lost
[00:00:42.158,386] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:42.158,386] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:42.158,416] <inf> broadcast_sink: Stream sync lost
[00:00:42.158,447] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:42.158,538] <inf> main: Sync lost
[00:00:42.158,935] <inf> main: PA sync lost, reason: 22
[00:00:42.159,759] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:42.159,759] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:42.159,759] <inf> main: Restarted scanning for broadcaster
[00:00:42.159,790] <inf> main: Sync lost
[00:00:42.159,790] <wrn> main: PA sync is NULL
[00:00:42.160,125] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:42.160,125] <err> bt_mgmt: Failed to delete PA sync
[00:00:42.160,125] <wrn> main: Failed to delete PA sync -13
[00:00:42.161,285] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:42.161,285] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:42.161,285] <inf> main: Restarted scanning for broadcaster
[00:00:42.704,071] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:44.504,089] <inf> broadcast_sink: Sync with stereo channel
[00:00:44.504,119] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:44.504,272] <err> audio_system: GDM Decoder sample rate 48000
[00:00:44.504,272] <inf> main: Presentation delay 3000 us is set
[00:00:46.958,374] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:46.958,374] <inf> broadcast_sink: Stream sync lost
[00:00:46.958,404] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:46.958,435] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:46.958,465] <inf> broadcast_sink: Stream sync lost
[00:00:46.958,496] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:46.958,557] <inf> main: Sync lost
[00:00:46.958,984] <inf> main: PA sync lost, reason: 22
[00:00:46.959,808] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:46.959,808] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:46.959,808] <inf> main: Restarted scanning for broadcaster
[00:00:46.959,838] <inf> main: Sync lost
[00:00:46.959,838] <wrn> main: PA sync is NULL
[00:00:46.960,174] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:46.960,174] <err> bt_mgmt: Failed to delete PA sync
[00:00:46.960,205] <wrn> main: Failed to delete PA sync -13
[00:00:46.961,364] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:46.961,364] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:46.961,364] <inf> main: Restarted scanning for broadcaster
[00:00:47.704,101] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:48.904,113] <inf> broadcast_sink: Sync with stereo channel
[00:00:48.904,144] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:48.904,296] <err> audio_system: GDM Decoder sample rate 48000
[00:00:48.904,296] <inf> main: Presentation delay 3000 us is set
[00:00:49.558,380] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:49.558,380] <inf> broadcast_sink: Stream sync lost
[00:00:49.558,441] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:49.558,441] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:49.558,471] <inf> broadcast_sink: Stream sync lost
[00:00:49.558,502] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:49.558,593] <inf> main: Sync lost
[00:00:49.558,990] <inf> main: PA sync lost, reason: 22
[00:00:49.559,783] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:49.559,814] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:49.559,814] <inf> main: Restarted scanning for broadcaster
[00:00:49.559,814] <inf> main: Sync lost
[00:00:49.559,814] <wrn> main: PA sync is NULL
[00:00:49.560,150] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:49.560,180] <err> bt_mgmt: Failed to delete PA sync
[00:00:49.560,180] <wrn> main: Failed to delete PA sync -13
[00:00:49.561,340] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:49.561,340] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:49.561,340] <inf> main: Restarted scanning for broadcaster
[00:00:50.504,119] <inf> bt_mgmt_scan: PA synced to name: NRF5340_BROADCASTER, id: 0x06d1bf, addr: 2C
:87:9B:72:0B:28 (random)
[00:00:52.904,144] <inf> broadcast_sink: Sync with stereo channel
[00:00:52.904,144] <inf> broadcast_sink: Syncing to broadcast stream index 0
[00:00:52.904,327] <err> audio_system: GDM Decoder sample rate 48000
[00:00:52.904,327] <inf> main: Presentation delay 3000 us is set
[00:00:54.158,416] <wrn> bt_conn: conn 0x20003660 failed to establish. RF noise?
[00:00:54.158,416] <inf> broadcast_sink: Stream sync lost
[00:00:54.158,447] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:54.158,477] <wrn> bt_conn: conn 0x20003730 failed to establish. RF noise?
[00:00:54.158,508] <inf> broadcast_sink: Stream sync lost
[00:00:54.158,538] <inf> broadcast_sink: Stream index 0 stopped. Reason: 62
[00:00:54.158,599] <inf> main: Sync lost
[00:00:54.159,027] <inf> main: PA sync lost, reason: 22
[00:00:54.159,851] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:54.159,851] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:54.159,851] <inf> main: Restarted scanning for broadcaster
[00:00:54.159,881] <inf> main: Sync lost
[00:00:54.159,881] <wrn> main: PA sync is NULL
[00:00:54.160,217] <wrn> bt_hci_core: opcode 0x2045 status 0x0c
[00:00:54.160,217] <err> bt_mgmt: Failed to delete PA sync
[00:00:54.160,217] <wrn> main: Failed to delete PA sync -13
[00:00:54.161,376] <inf> bt_mgmt_scan: Local addr: F3:1F:3E:44:97:B6 (random). May time out. Updates
not printed
[00:00:54.161,407] <inf> bt_mgmt_scan: Scanning successfully started
[00:00:54.161,407] <inf> main: Restarted scanning for broadcaster

  • I've tried to follow the advice I found at these links, but it still doesn't seem right:
    https://docs.nordicsemi.com/bundle/ncs-2.9.1/page/nrf/app_dev/device_guides/fem/fem_software_support.html
    https://docs.nordicsemi.com/bundle/ncs-2.9.1/page/nrf/app_dev/device_guides/fem/fem_nrf21540_gpio.html
    https://docs.nordicsemi.com/bundle/ncs-2.9.1/page/nrf/app_dev/device_guides/fem/fem_nRF21540_optional_properties.html

    I was using the --nrf21540 build switch to include my modified shield files and I tried putting a bunch of CONFIG_ items I found in various posts into both prj_release.conf for the app core and in my modified nrf5340_audio_dk_nrf5340_cpunet_defconfig file for the net core, but it didn't fix anything. Maybe it would if I had the correct list of CONFIG items to add?


    I tried manually setting all of the GPIO pins to force the broadcaster to always be in transmit mode and the receiver board to always be in receive mode but I got dramatically more current draw and a lot of audio noise on the receiver. It did dramatically boost my advertisement RSSI as seen by my phone though.

  • I think that your overlays map exactly to the BT40N’s FEM pins (TX_EN → P0.21, RX_EN → P0.27, PDN → P0.26, ANT-SEL → P1.05, MODE → P1.04, CSN → P1.06). To get full range extension you also need to enable the nRF21540 driver in the network core’s config: turn on CONFIG_BT_CTLR_FEM_NRF21540, set the PA/LNA/PDN/CSN pin numbers, and enable CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL with the right power step (CONFIG_BT_CTLR_TX_PWR_PLUS_4). Once that’s done, the broadcaster build will drive only TX_EN around each PDU transmit, and the receiver build will drive only RX_EN around each scan/receive – no cross-traffic. That should unlock the full +21 dBm TX and +5 dB RX sensitivity the front-end is capable of. 

    Saying this, I am not an expert in this. Some configs relevant to this that I found are

    # Enable the nRF21540 FEM support
    CONFIG_BT_CTLR_FEM_NRF21540=y
    
    # Map GPIO pins to the FEM control lines
    CONFIG_BT_CTLR_GPIO_PA_PIN=21 
    CONFIG_BT_CTLR_GPIO_PA_POL_INV=0
    CONFIG_BT_CTLR_GPIO_LNA_PIN=27 
    CONFIG_BT_CTLR_GPIO_LNA_POL_INV=0
    CONFIG_BT_CTLR_GPIO_PDN_PIN=26 
    CONFIG_BT_CTLR_GPIO_PDN_POL_INV=0
    CONFIG_BT_CTLR_GPIO_CSN_PIN=6  
    CONFIG_BT_CTLR_GPIO_CSN_POL_INV=0
    
    #  dynamic TX power so you can go above +8 dBm
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    CONFIG_BT_CTLR_TX_PWR_PLUS_4=y
    

    If you want to find tune the timing, configs related to that can be found here

  • Thanks I'm giving this a try. It looks to me like CONFIG_BT_CTLR_GPIO_CSN_PIN shouldn't be just 6 since it's on port 1. I recall that for some other pin setting macros it just keeps going to port 1 pins after 31. So 31 would be P0.31, 32 is P1.00... so I'm guessing I need to set it to 38 to get p1.06

  • Nope... this is so frustrating that there doesn't appear to be any real documentation for the SDK. Where's the paper that shows all of the available config options for my version of the SDK (2.9.1) with real definitions of what they all are and not just this doxygen nonsense that doesn't tell you a thing?

    warning: attempt to assign the value 'y' to the undefined symbol BT_CTLR_FEM_NRF21540

    warning: attempt to assign the value 'y' to the undefined symbol BT_CTLR_TX_PWR_DYNAMIC_CONTROL

    warning: attempt to assign the value '21' to the undefined symbol BT_CTLR_GPIO_PA_PIN

    warning: attempt to assign the value '0' to the undefined symbol BT_CTLR_GPIO_PA_POL_INV

    warning: attempt to assign the value '27' to
    the undefined symbol BT_CTLR_GPIO_LNA_PIN

    warning: attempt to assign the value '0' to the undefined symbol BT_CTLR_GPIO_LNA_POL_INV

    warning: attempt to assign the value '26' to the undefined symbol BT_CTLR_GPIO_PDN_PIN

    warning: attempt to assign the value '0' to the undefined symbol BT_CTLR_GPIO_PDN_POL_INV

    warning: attempt to assign the value '38' to the undefined symbol BT_CTLR_GPIO_CSN_PIN

    warning: attempt to assign the value '0' to the undefined symbol BT_CTLR_GPIO_CSN_POL_INV

  • I decided to just perform a file contents search of the entire SDK for all instances of "NRF21540".

    It looks like the relevant config items are defined here:
    \nRF_Connect\v2.9.1\nrf\subsys\mpsl\fem\Kconfig

    This file contains an option called FEM_AL_LIB which looks like it helps to enable other needed defines: \nRF_Connect\v2.9.1\nrf\lib\fem_al\Kconfig

    Oh! Some actual instructions!

    \nRF_Connect\v2.9.1\nrf\doc\nrf\app_dev\device_guides\fem\fem_nrf21540_gpio_spi.rst

    \nRF_Connect\v2.9.1\nrf\doc\nrf\app_dev\device_guides\fem\fem_nRF21540_optional_properties.rst

    \nRF_Connect\v2.9.1\nrf\doc\nrf\app_dev\device_guides\fem\fem_power_models.rst

    \nRF_Connect\v2.9.1\nrf\doc\nrf\app_dev\device_guides\fem\fem_software_support.rst


    I also found this in the release notes file here:
    \nRF_Connect\v2.9.1\zephyr\doc\releases\release-notes-3.0.rst

    * The following Kconfig options related to radio front-end modules (FEMs) were
    removed:

    * ``CONFIG_BT_CTLR_GPIO_PA``
    * ``CONFIG_BT_CTLR_GPIO_PA_PIN``
    * ``CONFIG_BT_CTLR_GPIO_PA_POL_INV``
    * ``CONFIG_BT_CTLR_GPIO_PA_OFFSET``
    * ``CONFIG_BT_CTLR_GPIO_LNA``
    * ``CONFIG_BT_CTLR_GPIO_LNA_PIN``
    * ``CONFIG_BT_CTLR_GPIO_LNA_POL_INV``
    * ``CONFIG_BT_CTLR_GPIO_LNA_OFFSET``
    * ``CONFIG_BT_CTLR_FEM_NRF21540``
    * ``CONFIG_BT_CTLR_GPIO_PDN_PIN``
    * ``CONFIG_BT_CTLR_GPIO_PDN_POL_INV``
    * ``CONFIG_BT_CTLR_GPIO_CSN_PIN``
    * ``CONFIG_BT_CTLR_GPIO_CSN_POL_INV``
    * ``CONFIG_BT_CTLR_GPIO_PDN_CSN_OFFSET``

    This FEM configuration is hardware description, and was therefore moved to
    :ref:`devicetree <dt-guide>`. See the :dtcompatible:`nordic,nrf-radio`
    devicetree binding's ``fem`` property for information on what to do instead
    on the Nordic open source controller.

Related