This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Evaluation of nRF528xx 802.15.4 capabilities

Hi,

we're performing an evaluation of using an nRF528xx module with 802.15.4 stack to replace a 3rd-party radio module. There will need to be an AT command protocol for device control eventually, but at this point I just want to get a basic UART passthrough system going. The goal is to exchange messages successfully with the 3rd-party device to confirm we can create something with backwards-compatibility with our products already in the market.

I started with the nrf5 SDK 802.15.4 library and the Wireless UART example, and had something basic working within a couple of hours. This was really impressive. Having problems with encrypted data, but looking around it seems I should probably be using the nRF Connect library and dev system instead, so am stepping back and moving forward in that direction instead.

Unfortunately the same example isn't available under nRF Connect though so I'm having to do more work myself to get started. I've gone from the 802.15.4 PHY Test Tool as my base example and am trying to modify it to receive some packets - any packets - from the 3rd party device. Cannot get this working though. 

I've set some breakpoints to try and see any packets being received, but apparently none are. I've modified the rf_init() function to include the settings below.

void rf_init(void)
{
  ...

  /* nrf radio driver initialization */
  nrf_802154_init();

  uint8_t panId[] = { 0x34, 0x12 };
  nrf_802154_pan_id_set(panId);
  nrf_802154_channel_set(0xFu);
  nrf_802154_promiscuous_set(true);
  nrf_802154_receive();

  ...
}

To test transmit, I've also altered the rf_thread() function to send something once every second or so, as below.

static char output[] = { 3, 'D', 'E', 'F' };

void rf_thread(void)
{
  unsigned int count = 0u;
  while (1) {
    rf_process_rx_packets();
    k_sleep(K_MSEC(1));
    count++;
    if (count == 1000u)
    {
      nrf_802154_transmit_raw(output, NULL);
      count = 0u;
      nrf_802154_receive();
    }
  }
}

I'm not receiving anything at my 3rd-party device either. Remote device is on channel 0xF and PAN ID 0x1234.

Is there anything else I need to change to the example to get started, or is there a better sample to start from? 

I'm using Windows OS and VisualGDB with Visual Studio 2017... which I know isn't on the official list of supported products but I must say is rather good at hiding/simplifying/automating all the SDK setup. It's also what we use for all our other embedded development so would give us an easier intro to Nordic development. Trying to get this running on a nRF52840 DK.

  • Hi,

    Due to holidays we are short staffed, so please expect increased response time.

    First of all, the changes you make in rf_init() will be overwritten by other parts of the code, such as the channel being set by the default channel mask PTT_CHANNEL_MASK in Kconfig. Because of this, the channel will still be set to 11.

    When using nrf_802154_transmit_raw() to transmit a packet, the first byte of the pointer to the data to transmit must contain the frame length, so you cannot give output directly as a parameter in the function. Instead you should use something like this:

    temp_tx_pkt[0] = len + RF_FCS_SIZE;
    memcpy(&temp_tx_pkt[RF_PSDU_START], output, len);
    ret = nrf_802154_transmit_raw(temp_tx_pkt, NULL);

    Where len is the length of the data, and RF_FCS_SIZE and RF_PSDU_START are already defined in rf_proc.c in the example. It is a good idea to check what nrf_802154_transmit_raw returns, to see if the driver could schedule the transmission or not.

    I would also recommend removing everything regarding the comm module in the sample, as you do not need that for what you are doing. Additionally, if you have an additional nRF52840 DK or dongle, I recommend setting up a nRF Sniffer for 802.15.4 to see the network traffic.

    Best regards,

    Marte

Related