CRC errors receiving packets with Coded PHY and S=2

Code running on nRF52833 devkit version 1.0.0 that continuously sends an empty 500 kbit/s radio packet:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int main(void) {
uint8_t packet[3] = {0, 0, 0};
NRF_CLOCK->TASKS_HFCLKSTART = 1;
while (!NRF_CLOCK->EVENTS_HFCLKSTARTED) {
}
// Radio config
NRF_RADIO->TXPOWER = (RADIO_TXPOWER_TXPOWER_Pos4dBm << RADIO_TXPOWER_TXPOWER_Pos);
NRF_RADIO->MODECNF0 = (RADIO_MODECNF0_RU_Fast << RADIO_MODECNF0_RU_Pos) | (RADIO_MODECNF0_DTX_Center << RADIO_MODECNF0_DTX_Pos);
NRF_RADIO->TXADDRESS = 0x00UL;
NRF_RADIO->CRCCNF = (RADIO_CRCCNF_LEN_Three << RADIO_CRCCNF_LEN_Pos) | (RADIO_CRCCNF_SKIPADDR_Skip << RADIO_CRCCNF_SKIPADDR_Pos);
NRF_RADIO->CRCPOLY = 0x0000065B;
// Radio address config
uint32_t aa = 0x53abcdef;
NRF_RADIO->PREFIX0 = aa >> 24;
NRF_RADIO->BASE0 = aa << 8;
// Packet configuration
NRF_RADIO->PCNF0 = (1 << RADIO_PCNF0_S0LEN_Pos) |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Code running on nRF54L15 devkit version 0.8.1 with chip revision QFAABB 2433AA that on every packet receipt prints CRC status to the console as well as showing LED indicating CRC ok/error:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void test_rx(void) {
uint8_t packet[3 + 255];
NRF_RADIO->RXADDRESSES = 0x01UL;
NRF_RADIO->CRCCNF = (RADIO_CRCCNF_LEN_Three << RADIO_CRCCNF_LEN_Pos) | (RADIO_CRCCNF_SKIPADDR_Skip << RADIO_CRCCNF_SKIPADDR_Pos);
NRF_RADIO->CRCPOLY = 0x0000065B;
NRF_RADIO->MODE = (RADIO_MODE_MODE_Ble_LR125Kbit << RADIO_MODE_MODE_Pos);
// Packet configuration
NRF_RADIO->PCNF0 = (1 << RADIO_PCNF0_S0LEN_Pos) |
(0 << RADIO_PCNF0_S1LEN_Pos) |
(RADIO_PCNF0_S1INCL_Include << RADIO_PCNF0_S1INCL_Pos) |
(8 << RADIO_PCNF0_LFLEN_Pos) |
(2 << RADIO_PCNF0_CILEN_Pos) |
(RADIO_PCNF0_PLEN_LongRange << RADIO_PCNF0_PLEN_Pos) |
(3 << RADIO_PCNF0_TERMLEN_Pos);
// Packet configuration
NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Enabled << RADIO_PCNF1_WHITEEN_Pos) |
(RADIO_PCNF1_ENDIAN_Little << RADIO_PCNF1_ENDIAN_Pos) |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

nRF Connect SDK version is 2.8.0.

Result:

The first packet received has CRC status ok. The subsequent packets typically have CRC status error. If stepping through the code with a debugger line by line, the CRC ok rate increases a bit.

Running similar RX code on an nRF52 device, the code works as expected and CRC status is typically always ok.

If TX mode is changed to Coded PHY 125kbit/s instead, the problem disappears when receiving on nRF54L15 and CRC is typically always ok.

Question: why is this happening? I think I have followed the radio peripheral documentation correctly.

Parents
  • Hi,

    I want to start by double checking, so that I get this right.

    You test with sending:

    1. Coded PHY 500kbit/s packets from a nRF52833 to a nRF54L15. This gives CRC errors.
    2. Coded PHY 125kbit/s packets from a nRF52833 to a nRF54L15. This works
    3. Coded PHY 500kbit/s packets from a nRF52833 to a nRF52833. This works

    You tested both using your custom low-level implementation and using Zephyr. Does that mean using the BLE stack, including the SoftDvice Controller?

  • Almost correct, for 3., that works as expected without CRC errors. Since the code works if the receiver is an nRF52, that means that the sender is working properly and that the problem lies within the nRF54 when that one is the receiver.

    I tested in a blank VS code "Create a new application" -> "Create a blank application" with NCS 2.8.0, using nrf54l15dk/nrf54l15/cpuapp. Then just put the code I posted in the main.c file and call test_rx() from the main() function.

  • Emil Lenngren said:
    Almost correct, for 3., that works as expected without CRC errors.

    I see. Updated the previous post.

    Emil Lenngren said:
    I tested in a blank VS code "Create a new application" -> "Create a blank application" with NCS 2.8.0, using nrf54l15dk/nrf54l15/cpuapp. Then just put the code I posted in the main.c file and call test_rx() from the main() function.

    I see. Coded PHY is supported if you use our Bluetooth stack, and the Bluetooth: Central Heart Rate Monitor with Coded PHY and Bluetooth: Peripheral Heart Rate Monitor with Coded PHY samples support the nRF54L15. Have you seen issues with Coded PHY using the BT stack as well for comparison, or only using your custom low-level code?

  • The coded phy heart rate samples with the softdevice works fine for some reason with coded phy and S=2 on the same devkit.

    I'm trying to receive custom packets with the radio peripheral, and that's where the chip doesn't work as I expect.

  • One thing, aren't you supposed to use EVENTS_PHYEND to detect long distance packet ends??  I don't think that helps, and I don't know if its and issue with the nrf54.
    Actually, it makes little sense, since it works on other models. 

Reply
  • One thing, aren't you supposed to use EVENTS_PHYEND to detect long distance packet ends??  I don't think that helps, and I don't know if its and issue with the nrf54.
    Actually, it makes little sense, since it works on other models. 

Children