How to test 802.15.4 radio with the lowest code size

Hi,

I am trying to create an ad-hoc network with several nrf5340 boards using 802154 radio, e.g. whenever each node transmits, others can receive the transmitted packets. First, I started with an example from your company such as the multiprotocol_rpmsg project to understand how it works. But the code size is very large after compiling without debugging features as follows:

Memory region Used Size Region Size %age Used
FLASH: 243768 B 256 KB 92.99%
SRAM: 64444 B 64 KB 98.33%
SRAM1: 0 GB 64 KB 0.00%
IDT_LIST: 0 GB 2 KB 0.00%

I did not know to continue without a debugging feature. Or I doubt that if we add several code lines, FLASH is overloaded. Would you please suggest which sample I can start with to check 802.15.4 radio for nrf5340 using Visual Studio Code?

I also try to use other examples such as 802154_phy_test, radio_test. But there are various errors when I compile the new created project. I try to search for the reason on the forum but a few mentioned that it is not compatible board for nrf5340. I do not know why it does not work with nrf5340.

I am happy with a simple example without threads first. If it is possible, would you please suggest to me how to check 802.15.4 radio of nrf5340 communicating with other nrf5340 boards using sequential code and ISR first? Which examples for Visual Studio Code I should start?

Thank you very much.

Lan

Parents
  • Hi Lan

    If I understand you correctly you just want to set up a small mesh type network where any device can transmit to any other?

    Is using 802.15.4 an absolute requirement, or would using other radio modes be a possibility if you can still implement the required network topology?

    Do you need full mesh capability, including the ability for nodes to relay packets between other nodes, or is it fine to only have direct connections between the nodes?

    Is low power a requirement, or is it OK to leave the radio on all the time (meaning you get around 4-5mA constant current draw from the radio) ?

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Many thanks for your answer. We had 40 nrf5340 boards and I would use Visual Studio Code. Please find my answers as follows:

    Q1: If I understand you correctly you just want to set up a small mesh type network where any device can transmit to any other?

    A1: Actually, I want to design a mesh by my own protocol. For example, when a node transmits a packet, all nodes belonging to its communication range can receive the transmitted packet, but my own protocol will decide which ones are active and which one can be a relay, which ones are in deep sleep mode, and so on.

    Q2: Is using 802.15.4 an absolute requirement, or would using other radio modes be a possibility if you can still implement the required network topology?

    A2: Yes, Now I would use 802.15.4 as a general one for my industrial scenarios, for example, WIRELESS HART is also based on 802.15.4. For my other applications, if you can suggest how to use BLE for nrf5340 with Visual Studio Code, it is also great for me.

    Q3: Do you need full mesh capability, including the ability for nodes to relay packets between other nodes, or is it fine to only have direct connections between the nodes?

    A3: I will design a full mesh by my own protocol. But first, I would work with a small mesh network and then extend it to a full mesh network later.

    Q4: Is low power a requirement, or is it OK to leave the radio on all the time (meaning you get around 4-5mA constant current draw from the radio) ?

    A4: Yes, my own protocol may use a timer to wake up the radio from deep sleep mode. I would use a timer using the crystal for synchronization. Which nodes are active as a receiver are decided by my own protocol and I would use an ISR for the receiver mode. Can you suggest how to create an ISR for the 802.15.4 receiver?

    Best regards,

    Lan

     

  • Hi Lan

    We don't really have a lot of examples for doing proprietary 802.15.4 based protocols unfortunately, you probably need to start out with the 802154_phy_test sample. 

    It is odd that you can't get it to build, though. Did you make sure to build it for the nrf5340dk_nrf5340_cpunet board?

    Did you make some changes to it since it stopped working?

    If you are going to make your own mesh protocol 'from scratch' I hope you are prepared to spend a lot of time on it, this is not an easy undertaking ;)

    landao said:
    Can you suggest how to create an ISR for the 802.15.4 receiver?

    The 802.15.4 MAC will handle the radio interrupt for you, and call different handler functions depending on what caused the interrupt. 

    For an overview of the various functions called by the MAC layer refer to the Calls to the higher layer chapter in the documentation. 

    Regarding Bluetooth questions we are happy to help with that, just open a new ticket and share a bit more details about what you are trying to do with Bluetooth Slight smile

    Best regards
    Torbjørn

  • Hi,

    Can you look at the attached picture? That is what I got when I built the 802154_phy_test sample for the nrf5340 board.

    Can you rebuild this project again and confirm that it still works?

    If this project works well, two nrf boards can communicate with each other, and then I can go further.

    Thank you very much.

Reply Children
  • Hi Lan

    It seems the project is too large to build with Enable debug options set, the flash use overflows by around 8kB. 

    If you disable this option it should be possible to build it. 

    Best regards
    Torbjørn

  • Hi,

    Thank you for your time. This is exactly what I mentioned in the title of this topic. But you can not do anything for us. The reason is very simple as "We don't really have a lot of examples for doing proprietary 802.15.4 based protocols unfortunately, you probably need to start out with the 802154_phy_test sample. "

    So now, I will try to find out a way to fix this by myself.

    BR,

    Lan

  • Hi Lan

    landao said:
    Thank you for your time. This is exactly what I mentioned in the title of this topic.

    My apologies, you mentioned the debugging issue specifically for the hci_rpmsg sample, I didn't realize the build issues for 802154_phy_test was related to the same problem. 

    The network core of the nRF5340 has considerably less memory available than the application core, and these samples are apparently so close to the limit that there is no room for the additional debugging capabilities. 

    It's important to note that you can still debug code without the debug options set, but you won't have access to the same amount of information through the debugger. 

    landao said:
    So now, I will try to find out a way to fix this by myself.

    The best of luck Slight smile

    Best regards
    Torbjørn

Related