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.