Events emitted by radio do not match expected events

Hello,
I am having trouble getting a simple radio application with a transmitter and receiver working. The events emitted by the radio do not seem to make sense, and no packet is ever received by the receiver. I am using the nRF HAL radio driver with an nRF52833 and the zephyr operating system.

I am using the BLE 1 Mbit mode. I have an ISR set up to receive all of the events that the radio emits, with a function to print these events as a string. For transmission these events make sense except for a FRAMESTART event, which should only be emitted in 802.15.4 mode (which I am not using) and also only when receiving, if I'm not mistaken. For reception, the only events received are READY, RXREADY and again FRAMESTART, which I don't think should be emitted for my application.

Here is the code. The same code is running on both the receiver and transmitter, with the only difference being on line 145 (the `mode` variable).

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mm_radio, LOG_LEVEL_DBG);

#include <zephyr/kernel.h>

#include <zephyr/irq.h>

#include "hal/nrf_radio.h"

enum {
	RECEIVER,
	TRANSMITTER,
};

static uint8_t packet[ 255 ]; // Packet to send

static const char *event_to_str(nrf_radio_event_t event) {
	switch (event) {
	case NRF_RADIO_EVENT_READY:
		return "READY";
	case NRF_RADIO_EVENT_ADDRESS:
		return "ADDRESS";
	case NRF_RADIO_EVENT_PAYLOAD:
		return "PAYLOAD";
	case NRF_RADIO_EVENT_END:
		return "END";
	case NRF_RADIO_EVENT_DISABLED:
		return "DISABLED";
	case NRF_RADIO_EVENT_DEVMATCH:
		return "DEVMATCH";
	case NRF_RADIO_EVENT_DEVMISS:
		return "DEVMISS";
	case NRF_RADIO_EVENT_RSSIEND:
		return "RSSIEND";
	case NRF_RADIO_EVENT_BCMATCH:
		return "BCMATCH";
	case NRF_RADIO_EVENT_CRCOK:
		return "CRCOK";
	case NRF_RADIO_EVENT_CRCERROR:
		return "CRCERROR";
	case NRF_RADIO_EVENT_FRAMESTART:
		return "FRAMESTART";
	case NRF_RADIO_EVENT_EDEND:
		return "EDEND";
	case NRF_RADIO_EVENT_CCAIDLE:
		return "CCIDLE";
	case NRF_RADIO_EVENT_CCABUSY:
		return "CCABUSY";
	case NRF_RADIO_EVENT_CCASTOPPED:
		return "CCASTOPPED";
	case NRF_RADIO_EVENT_RATEBOOST:
		return "RATEBOOST";
	case NRF_RADIO_EVENT_TXREADY:
		return "TXREADY";
	case NRF_RADIO_EVENT_RXREADY:
		return "RXREADY";
	case NRF_RADIO_EVENT_MHRMATCH:
		return "MHRMATCH";
	case NRF_RADIO_EVENT_SYNC:
		return "SYNC";
	case NRF_RADIO_EVENT_PHYEND:
		return "PHYEND";
	case NRF_RADIO_EVENT_CTEPRESENT:
		return "CTEPRESENT";
	default:
		return "???";
	}
}

static void radio_config() {

	nrf_radio_power_set(NRF_RADIO, true);

	nrf_radio_mode_set(NRF_RADIO, RADIO_MODE_MODE_Ble_1Mbit);

	nrf_radio_packet_conf_t config = {
		.lflen		= 0,							// Length on air of LENGTH field in number of bits.
		.s0len		= 0,							// Length on air of S0 field in number of bytes.
		.s1len		= 0,							// Length on air of S1 field in number of bits.
		.s1incl		= RADIO_PCNF0_S1INCL_Automatic, // Include or exclude S1 field in RAM.
		.cilen		= 0,							// Length of code indicator - long range.
		.plen		= RADIO_PCNF0_PLEN_16bit,		// Length of preamble on air. Decision point: TASKS_START task.
		.crcinc		= false,						// Indicates if LENGTH field contains CRC or not.
		.termlen	= 0,							// Length of TERM field in Long Range operation.
		.maxlen		= 60,							// Maximum length of packet payload.
		.statlen	= 60,							// Static length in number of bytes.
		.balen		= 4,							// Base address length in number of bytes.
		.big_endian = false,						// On air endianness of packet.
		.whiteen	= true							// Enable or disable packet whitening.
	};
	nrf_radio_packet_configure(NRF_RADIO, &config);

	nrf_radio_datawhiteiv_set(NRF_RADIO, 0xAB);

	nrf_radio_base0_set(NRF_RADIO, 0x0000FAFE);
	nrf_radio_prefix0_set(NRF_RADIO, 0xBA);

	nrf_radio_txaddress_set(NRF_RADIO, 0);
	nrf_radio_rxaddresses_set(NRF_RADIO, 1);

	nrf_radio_crc_configure(NRF_RADIO, 2, RADIO_CRCCNF_SKIP_ADDR_Skip, 0x000AA0AA);
	nrf_radio_crcinit_set(NRF_RADIO, 0x00005050);

	nrf_radio_fast_ramp_up_enable_set(NRF_RADIO, true);

	nrf_radio_txpower_set(NRF_RADIO, RADIO_TXPOWER_TXPOWER_0dBm);
	nrf_radio_frequency_set(NRF_RADIO, 0);

	nrf_radio_packetptr_set(NRF_RADIO, packet);
}

ISR_DIRECT_DECLARE(radio_isr) {

	__disable_irq();

	LOG_DBG("isr");

	for (int i = 0x100; i <= 0x170; i += 4) {
		if (nrf_radio_event_check(NRF_RADIO, i)) {
			LOG_DBG("NRF_RADIO_EVENT: %12s (%03x)", event_to_str(i), i);
			nrf_radio_event_clear(NRF_RADIO, i);
		}
	}

	__enable_irq();
	return 0;
}

int radio_init() {

	for (int i = 0; i < 255; i++) {
		packet[ i ] = i;
	}

	radio_config();

	nrf_radio_int_enable(NRF_RADIO, 0x1fe5ffe7); // all of them

	IRQ_DIRECT_CONNECT(RADIO_IRQn, 0, radio_isr, 0);
	irq_enable(RADIO_IRQn);

	LOG_DBG("radio state: %d", nrf_radio_state_get(NRF_RADIO));

	uint8_t mode = TRANSMITTER;

	switch (mode) {
	case TRANSMITTER:
		nrf_radio_shorts_set(NRF_RADIO, NRF_RADIO_SHORT_READY_START_MASK);
		NRF_RADIO->TASKS_TXEN = 1;
		for (;;) {
			k_msleep(1000);
			LOG_INF("radio state: %d", nrf_radio_state_get(NRF_RADIO));
			NRF_RADIO->TASKS_START = 1;
		}
		break;
	case RECEIVER:
		nrf_radio_dacnf_set(NRF_RADIO, 1, 1);
		nrf_radio_shorts_set(NRF_RADIO, NRF_RADIO_SHORT_READY_START_MASK | NRF_RADIO_SHORT_END_START_MASK);
		NRF_RADIO->TASKS_RXEN  = 1;
		NRF_RADIO->TASKS_START = 1;
		for (;;) {
			k_msleep(1000);

			LOG_INF("radio state: %d", nrf_radio_state_get(NRF_RADIO));
		}
		break;
	}

	return 0;
}
Here is the output of the transmit node:

[00:00:00.100,646] <dbg> mm_radio: radio_init: radio state: 0
[00:00:00.106,781] <dbg> mm_radio: radio_isr_body: isr
[00:00:00.112,274] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:        READY (100)
[00:00:00.120,544] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      ADDRESS (104)
[00:00:00.128,814] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      PAYLOAD (108)
[00:00:00.137,084] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:          END (10c)
[00:00:00.145,355] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:   FRAMESTART (138)
[00:00:00.153,625] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      TXREADY (154)
[00:00:00.161,895] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:       PHYEND (16c)
[00:00:01.106,781] <inf> mm_radio: radio state: 10
[00:00:01.111,907] <dbg> mm_radio: radio_isr_body: isr
[00:00:01.117,431] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      ADDRESS (104)
[00:00:01.125,701] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      PAYLOAD (108)
[00:00:01.133,941] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:          END (10c)
[00:00:01.142,211] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:   FRAMESTART (138)
[00:00:01.150,482] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:       PHYEND (16c)
[00:00:02.158,813] <inf> mm_radio: radio state: 10
[00:00:02.163,940] <dbg> mm_radio: radio_isr_body: isr
[00:00:02.169,464] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      ADDRESS (104)
[00:00:02.177,734] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      PAYLOAD (108)
[00:00:02.186,004] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:          END (10c)
[00:00:02.194,274] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:   FRAMESTART (138)
[00:00:02.202,545] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:       PHYEND (16c)
[00:00:03.210,845] <inf> mm_radio: radio state: 10
[00:00:03.215,972] <dbg> mm_radio: radio_isr_body: isr
[00:00:03.221,496] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      ADDRESS (104)
[00:00:03.229,766] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      PAYLOAD (108)
[00:00:03.238,037] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:          END (10c)
[00:00:03.246,307] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:   FRAMESTART (138)
[00:00:03.254,577] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:       PHYEND (16c)

And here is the output of receive node:

[00:00:00.101,287] <dbg> mm_radio: radio_init: radio state: 0
[00:00:00.107,452] <dbg> mm_radio: radio_isr_body: isr
[00:00:00.113,067] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:        READY (100)
[00:00:00.121,429] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:   FRAMESTART (138)
[00:00:00.129,821] <dbg> mm_radio: radio_isr_body: NRF_RADIO_EVENT:      RXREADY (158)
[00:00:01.138,244] <inf> mm_radio: radio state: 3
[00:00:02.143,402] <inf> mm_radio: radio state: 3
[00:00:03.148,559] <inf> mm_radio: radio state: 3
[00:00:04.153,717] <inf> mm_radio: radio state: 3
[00:00:05.158,874] <inf> mm_radio: radio state: 3
[00:00:06.164,031] <inf> mm_radio: radio state: 3
[00:00:07.169,189] <inf> mm_radio: radio state: 3
[00:00:08.174,346] <inf> mm_radio: radio state: 3
[00:00:09.179,504] <inf> mm_radio: radio state: 3
[00:00:10.184,661] <inf> mm_radio: radio state: 3
[00:00:11.189,819] <inf> mm_radio: radio state: 3
[00:00:12.194,976] <inf> mm_radio: radio state: 3
[00:00:13.200,134] <inf> mm_radio: radio state: 3
[00:00:14.205,291] <inf> mm_radio: radio state: 3
[00:00:15.210,449] <inf> mm_radio: radio state: 3
[00:00:16.215,606] <inf> mm_radio: radio state: 3

Parents
  • Hi 

    Any particular reason you want to implement the radio protocol from scratch, rather than use one of the existing protocols, such as ESB?

    Unless you have very specialized requirements I would strongly recommend using one of the provided protocols, as it will save you a lot of work. 

    Regarding the FRAMESTART event I assume this event is not suppressed in non supported bitrates, it is just not tested, and is unlikely to behave predictably. I would suggest you just ignore it. 

    I agree that the ordering of events seem incorrect, at least on the TX side. Possibly this is caused by the time spent calling LOG_DBG inside the ISR, which means you could get more interrupts while you are processing the last. In this case the ordering of the log prints will depend on the order in which you check the event registers, and not the order the events were actually triggered. 

    Do you have deferred logging enabled? With deferred logging the log call should run quicker, and this issue is less likely to occur. 

    The radio itself seems to operate as expected on the TX side, but for some reason the RX is not receiving anything. Even with an incorrect CRC you should see the ADDRESS, PAYLOAD and END events on the RX side if the receiver can match the address on air. 
    Some times the choice of address can lead to reception issues. Could you try just using the default address of 0xE7E7E7E7E7 and see if it works better? 

    Best regards
    Torbjørn

Reply
  • Hi 

    Any particular reason you want to implement the radio protocol from scratch, rather than use one of the existing protocols, such as ESB?

    Unless you have very specialized requirements I would strongly recommend using one of the provided protocols, as it will save you a lot of work. 

    Regarding the FRAMESTART event I assume this event is not suppressed in non supported bitrates, it is just not tested, and is unlikely to behave predictably. I would suggest you just ignore it. 

    I agree that the ordering of events seem incorrect, at least on the TX side. Possibly this is caused by the time spent calling LOG_DBG inside the ISR, which means you could get more interrupts while you are processing the last. In this case the ordering of the log prints will depend on the order in which you check the event registers, and not the order the events were actually triggered. 

    Do you have deferred logging enabled? With deferred logging the log call should run quicker, and this issue is less likely to occur. 

    The radio itself seems to operate as expected on the TX side, but for some reason the RX is not receiving anything. Even with an incorrect CRC you should see the ADDRESS, PAYLOAD and END events on the RX side if the receiver can match the address on air. 
    Some times the choice of address can lead to reception issues. Could you try just using the default address of 0xE7E7E7E7E7 and see if it works better? 

    Best regards
    Torbjørn

Children
  • Hi Torbjørn,

    Thanks for the reply. We do indeed have very specialized requirements which is why I am looking into a custom radio protocol.

    I do have synchronous logging enabled - I should have mentioned that in my original post, but yes I was aware that the events are not necessarily printed in the order that they are received. I was mostly just confused about the reception of the FRAMESTART event, which you have addressed.

    So now my only issue is that the receiver never receives anything. I have tried changing the address to what you suggested by changing the lines:

    nrf_radio_base0_set(NRF_RADIO, 0xE7E7E7E7);
    nrf_radio_prefix0_set(NRF_RADIO, 0xE7);

    But the behaviour remains the same, nothing is received.

    I have printed out all of the registers the receiver node, do you notice anything incorrect? This was printed after the radio was in the RX state for some time. I notice that RXMATCH and RXCRC remain at zero, so it is indeed never matching an address.

    [00:00:11.477,966] <dbg> mm_radio: dump_regs: SHORTS:   00000021
    [00:00:11.477,996] <dbg> mm_radio: dump_regs: INTENSET:  1fe5ffe7
    [00:00:11.478,027] <dbg> mm_radio: dump_regs: INTENCLR:  1fe5ffe7
    [00:00:11.478,027] <dbg> mm_radio: dump_regs: CRCSTATUS: 00000000
    [00:00:11.478,057] <dbg> mm_radio: dump_regs: RXMATCH:   00000000
    [00:00:11.478,057] <dbg> mm_radio: dump_regs: RXCRC:     00000000
    [00:00:11.478,088] <dbg> mm_radio: dump_regs: DAI:       00000000
    [00:00:11.478,088] <dbg> mm_radio: dump_regs: PDUSTAT:   00000000
    [00:00:11.478,118] <dbg> mm_radio: dump_regs: CTESTATUS: 00000000
    [00:00:11.478,118] <dbg> mm_radio: dump_regs: DFESTATUS: 00000000
    [00:00:11.478,149] <dbg> mm_radio: dump_regs: PACKETPTR: 20002bd0
    [00:00:11.478,149] <dbg> mm_radio: dump_regs: FREQUENCY: 000001c8
    [00:00:11.478,179] <dbg> mm_radio: dump_regs: TXPOWER:   00000000
    [00:00:11.478,179] <dbg> mm_radio: dump_regs: MODE:      00000003
    [00:00:11.478,210] <dbg> mm_radio: dump_regs: PCNF0:     01000000
    [00:00:11.478,210] <dbg> mm_radio: dump_regs: PCNF1:     02043c3c
    [00:00:11.478,240] <dbg> mm_radio: dump_regs: BASE0:     e7e7e7e7
    [00:00:11.478,240] <dbg> mm_radio: dump_regs: PREFIX0:   000000e7
    [00:00:11.478,240] <dbg> mm_radio: dump_regs: PREFIX1:   00000000
    [00:00:11.478,271] <dbg> mm_radio: dump_regs: TXADDRESS: 00000000
    [00:00:11.478,271] <dbg> mm_radio: dump_regs: RXADDRESSES: 00000001
    [00:00:11.478,302] <dbg> mm_radio: dump_regs: CRCCNF:    00000102
    [00:00:11.478,302] <dbg> mm_radio: dump_regs: CRCPOLY:   000aa0aa
    [00:00:11.478,332] <dbg> mm_radio: dump_regs: CRCINIT:   00005050
    [00:00:11.478,332] <dbg> mm_radio: dump_regs: TIFS:      00000000
    [00:00:11.478,363] <dbg> mm_radio: dump_regs: RSSISAMPLE: 00000000
    [00:00:11.478,363] <dbg> mm_radio: dump_regs: STATE:     00000003
    [00:00:11.478,393] <dbg> mm_radio: dump_regs: DATAWHITEIV: 0000006b
    [00:00:11.478,393] <dbg> mm_radio: dump_regs: BCC:       00000000
    [00:00:11.478,424] <dbg> mm_radio: dump_regs: DAB[0]:    00000000
    [00:00:11.478,424] <dbg> mm_radio: dump_regs: DAB[1]:    00000000
    [00:00:11.478,454] <dbg> mm_radio: dump_regs: DAB[2]:    00000000
    [00:00:11.478,454] <dbg> mm_radio: dump_regs: DAB[3]:    00000000
    [00:00:11.478,485] <dbg> mm_radio: dump_regs: DAB[4]:    00000000
    [00:00:11.478,485] <dbg> mm_radio: dump_regs: DAB[5]:    00000000
    [00:00:11.478,515] <dbg> mm_radio: dump_regs: DAB[6]:    00000000
    [00:00:11.478,515] <dbg> mm_radio: dump_regs: DAB[7]:    00000000
    [00:00:11.478,546] <dbg> mm_radio: dump_regs: DAP[0]:    00000000
    [00:00:11.478,546] <dbg> mm_radio: dump_regs: DAP[1]:    00000000
    [00:00:11.478,576] <dbg> mm_radio: dump_regs: DAP[2]:    00000000
    [00:00:11.478,576] <dbg> mm_radio: dump_regs: DAP[3]:    00000000
    [00:00:11.478,576] <dbg> mm_radio: dump_regs: DAP[4]:    00000000
    [00:00:11.478,607] <dbg> mm_radio: dump_regs: DAP[5]:    00000000
    [00:00:11.478,607] <dbg> mm_radio: dump_regs: DAP[6]:    00000000
    [00:00:11.478,637] <dbg> mm_radio: dump_regs: DAP[7]:    00000000
    [00:00:11.478,637] <dbg> mm_radio: dump_regs: DACNF:     00000101
    [00:00:11.478,668] <dbg> mm_radio: dump_regs: MHRMATCHCONF: 00000000
    [00:00:11.478,668] <dbg> mm_radio: dump_regs: MHRMATCHMAS: 00000000
    [00:00:11.478,698] <dbg> mm_radio: dump_regs: MODECNF0:  00000201
    [00:00:11.478,698] <dbg> mm_radio: dump_regs: SFD:     000000a7
    [00:00:11.478,729] <dbg> mm_radio: dump_regs: EDCNT:   00000000
    [00:00:11.478,729] <dbg> mm_radio: dump_regs: EDSAMPLE: 00000000
    [00:00:11.478,759] <dbg> mm_radio: dump_regs: CCACTRL: 052d0000
    [00:00:11.478,759] <dbg> mm_radio: dump_regs: DFEMODE: 00000000
    [00:00:11.478,790] <dbg> mm_radio: dump_regs: CTEINLINECONF: 00002800
    [00:00:11.478,790] <dbg> mm_radio: dump_regs: DFECTRL1: 00023282
    [00:00:11.478,820] <dbg> mm_radio: dump_regs: DFECTRL2: 00000000
    [00:00:11.478,820] <dbg> mm_radio: dump_regs: SWITCHPATTERN: 00000000
    [00:00:11.478,851] <dbg> mm_radio: dump_regs: CLEARPATTERN: 00000000
    [00:00:11.478,851] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[0]: ffffffff
    [00:00:11.478,881] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[1]: ffffffff
    [00:00:11.478,881] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[2]: ffffffff
    [00:00:11.478,881] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[3]: ffffffff
    [00:00:11.478,912] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[4]: ffffffff
    [00:00:11.478,912] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[5]: ffffffff
    [00:00:11.478,942] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[6]: ffffffff
    [00:00:11.478,942] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[7]: ffffffff
    [00:00:11.478,973] <dbg> mm_radio: dump_regs: DFEPACKET.PTR: 00000000
    [00:00:11.478,973] <dbg> mm_radio: dump_regs: DFEPACKET.MAXCNT: 00001000
    [00:00:11.479,003] <dbg> mm_radio: dump_regs: DFEPACKET.AMOUNT: 00000000
    [00:00:11.479,003] <dbg> mm_radio: dump_regs: POWER: 00000001


    Here is the same for the transmitter node:

    [00:16:20.399,688] <dbg> mm_radio: dump_regs: SHORTS:   00000001
    [00:16:20.399,719] <dbg> mm_radio: dump_regs: INTENSET:  1fe5ffe7
    [00:16:20.399,719] <dbg> mm_radio: dump_regs: INTENCLR:  1fe5ffe7
    [00:16:20.399,719] <dbg> mm_radio: dump_regs: CRCSTATUS: 00000000
    [00:16:20.399,749] <dbg> mm_radio: dump_regs: RXMATCH:   00000000
    [00:16:20.399,749] <dbg> mm_radio: dump_regs: RXCRC:     00000000
    [00:16:20.399,780] <dbg> mm_radio: dump_regs: DAI:       00000000
    [00:16:20.399,780] <dbg> mm_radio: dump_regs: PDUSTAT:   00000000
    [00:16:20.399,810] <dbg> mm_radio: dump_regs: CTESTATUS: 00000000
    [00:16:20.399,810] <dbg> mm_radio: dump_regs: DFESTATUS: 00000000
    [00:16:20.399,841] <dbg> mm_radio: dump_regs: PACKETPTR: 20002bd0
    [00:16:20.399,841] <dbg> mm_radio: dump_regs: FREQUENCY: 000001c8
    [00:16:20.399,871] <dbg> mm_radio: dump_regs: TXPOWER:   00000000
    [00:16:20.399,871] <dbg> mm_radio: dump_regs: MODE:      00000003
    [00:16:20.399,871] <dbg> mm_radio: dump_regs: PCNF0:     01000000
    [00:16:20.399,902] <dbg> mm_radio: dump_regs: PCNF1:     02043c3c
    [00:16:20.399,902] <dbg> mm_radio: dump_regs: BASE0:     e7e7e7e7
    [00:16:20.399,932] <dbg> mm_radio: dump_regs: PREFIX0:   000000e7
    [00:16:20.399,932] <dbg> mm_radio: dump_regs: PREFIX1:   00000000
    [00:16:20.399,963] <dbg> mm_radio: dump_regs: TXADDRESS: 00000000
    [00:16:20.399,963] <dbg> mm_radio: dump_regs: RXADDRESSES: 00000001
    [00:16:20.399,963] <dbg> mm_radio: dump_regs: CRCCNF:    00000102
    [00:16:20.399,993] <dbg> mm_radio: dump_regs: CRCPOLY:   000aa0aa
    [00:16:20.399,993] <dbg> mm_radio: dump_regs: CRCINIT:   00005050
    [00:16:20.400,024] <dbg> mm_radio: dump_regs: TIFS:      00000000
    [00:16:20.400,024] <dbg> mm_radio: dump_regs: RSSISAMPLE: 00000000
    [00:16:20.400,054] <dbg> mm_radio: dump_regs: STATE:     0000000a
    [00:16:20.400,054] <dbg> mm_radio: dump_regs: DATAWHITEIV: 0000006b
    [00:16:20.400,085] <dbg> mm_radio: dump_regs: BCC:       00000000
    [00:16:20.400,085] <dbg> mm_radio: dump_regs: DAB[0]:    00000000
    [00:16:20.400,085] <dbg> mm_radio: dump_regs: DAB[1]:    00000000
    [00:16:20.400,115] <dbg> mm_radio: dump_regs: DAB[2]:    00000000
    [00:16:20.400,115] <dbg> mm_radio: dump_regs: DAB[3]:    00000000
    [00:16:20.400,146] <dbg> mm_radio: dump_regs: DAB[4]:    00000000
    [00:16:20.400,146] <dbg> mm_radio: dump_regs: DAB[5]:    00000000
    [00:16:20.400,177] <dbg> mm_radio: dump_regs: DAB[6]:    00000000
    [00:16:20.400,177] <dbg> mm_radio: dump_regs: DAB[7]:    00000000
    [00:16:20.400,207] <dbg> mm_radio: dump_regs: DAP[0]:    00000000
    [00:16:20.400,207] <dbg> mm_radio: dump_regs: DAP[1]:    00000000
    [00:16:20.400,207] <dbg> mm_radio: dump_regs: DAP[2]:    00000000
    [00:16:20.400,238] <dbg> mm_radio: dump_regs: DAP[3]:    00000000
    [00:16:20.400,238] <dbg> mm_radio: dump_regs: DAP[4]:    00000000
    [00:16:20.400,268] <dbg> mm_radio: dump_regs: DAP[5]:    00000000
    [00:16:20.400,268] <dbg> mm_radio: dump_regs: DAP[6]:    00000000
    [00:16:20.400,299] <dbg> mm_radio: dump_regs: DAP[7]:    00000000
    [00:16:20.400,299] <dbg> mm_radio: dump_regs: DACNF:     00000000
    [00:16:20.400,329] <dbg> mm_radio: dump_regs: MHRMATCHCONF: 00000000
    [00:16:20.400,329] <dbg> mm_radio: dump_regs: MHRMATCHMAS: 00000000
    [00:16:20.400,329] <dbg> mm_radio: dump_regs: MODECNF0:  00000201
    [00:16:20.400,360] <dbg> mm_radio: dump_regs: SFD:     000000a7
    [00:16:20.400,360] <dbg> mm_radio: dump_regs: EDCNT:   00000000
    [00:16:20.400,390] <dbg> mm_radio: dump_regs: EDSAMPLE: 00000000
    [00:16:20.400,390] <dbg> mm_radio: dump_regs: CCACTRL: 052d0000
    [00:16:20.400,421] <dbg> mm_radio: dump_regs: DFEMODE: 00000000
    [00:16:20.400,421] <dbg> mm_radio: dump_regs: CTEINLINECONF: 00002800
    [00:16:20.400,451] <dbg> mm_radio: dump_regs: DFECTRL1: 00023282
    [00:16:20.400,451] <dbg> mm_radio: dump_regs: DFECTRL2: 00000000
    [00:16:20.400,451] <dbg> mm_radio: dump_regs: SWITCHPATTERN: 00000000
    [00:16:20.400,482] <dbg> mm_radio: dump_regs: CLEARPATTERN: 00000000
    [00:16:20.400,482] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[0]: ffffffff
    [00:16:20.400,512] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[1]: ffffffff
    [00:16:20.400,512] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[2]: ffffffff
    [00:16:20.400,543] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[3]: ffffffff
    [00:16:20.400,543] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[4]: ffffffff
    [00:16:20.400,573] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[5]: ffffffff
    [00:16:20.400,573] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[6]: ffffffff
    [00:16:20.400,573] <dbg> mm_radio: dump_regs: PSEL.DFEGPIO[7]: ffffffff
    [00:16:20.400,604] <dbg> mm_radio: dump_regs: DFEPACKET.PTR: 00000000
    [00:16:20.400,604] <dbg> mm_radio: dump_regs: DFEPACKET.MAXCNT: 00001000
    [00:16:20.400,634] <dbg> mm_radio: dump_regs: DFEPACKET.AMOUNT: 00000000
    [00:16:20.400,634] <dbg> mm_radio: dump_regs: POWER: 00000001


  • Hi 

    One thing which is not immediately obvious when interfacing the radio directly is that you have to manually start the external HF clock in order for the radio to work correctly, I expect this is the reason why your code isn't working. I should have realized this on Friday, I guess it was too late in the week Wink

    You can use this snippet from the ESB sample for reference. 

    I made a small test application based on your code and verified that it worked. Please note I made some changes, such as removing the irq_disable/enable calls inside the interrupt handler. 

    radio_simple_test.zip

    Best regards
    Torbjørn

  • That was it. It works now.

    Thank you very much.

  • That's great to hear, I will close the ticket then. Good luck with your project Slight smile

Related