NRF_802154_USE_RAW_API is always being set to 1

We want to use the non raw functions of 802154 such as "nrf_802154_transmit" however they're compiled out by the definition of NRF_802154_USE_RAW_API being set to 1.

How do we ensure this is set to 0?

Using extra CMake arguments didn't work:  Defining preprocessor options using Visual Studio Code 

I've tried variations of the below in the top level CMakeLists.txt file:

add_definitions(-DNRF_802154_USE_RAW_API=0)
add_compile_options(-DNRF_802154_USE_RAW_API=0)
add_compile_definitions(-DNRF_802154_USE_RAW_API=0)
target_compile_options(-DNRF_802154_USE_RAW_API=0)
and also adding CONFIG_IEEE802154_RAW_MODE=n in the overlay file appears to do nothing.
We're trying to get the server and client echo samples to compile having added this:
Parents
  • Hello,

    After you set CONFIG_IEEE802154_USE_RAW_API=0 in your configurations and build. Does the build log give any warnings saying something like "tried setting it to n, but got value y." ?

    If you can't find it, then you can also search for the file autoconf,h" inside your build folder. You should probably see at least two of them (one for each core). Do you see CONFIG_IEEE802154_RAW_MODE in any of those files? If so, what are their values?

    That being said, I am not familiar with those samples, and whether they actually are set up to use the nrf_802154 API, or zephyr's 802154 stack. Is there any particular reason why you need to use 802154 directly? Do you intend to use it with OpenThread or Zigbee?

    Best regards,

    Edvin

  • Hello Edvin,

    The build log doesn't have anything like that. There are two autoconf.h files as you say, there are the sub directories if that helps:
    build\zephyr\include\generated
    build\multiprotocol_rpmsg\zephyr\include\generated

    However, CONFIG_IEEE802154_RAW_MODE isn't shown in either file.

    For legacy reasons we have to use 'simple' 802.15.4. We were forced to write our own stack to use multiprotocol on the nrf52840 as detailed in this ticket:  nrf52840 Bluetooth and 802.15.4 multiprotocol example project from 4 years ago. But now are you saying there's a complete 802.15.4 stack built into zephyr which we could use?

  • Hi Edvin,

    Thank you for getting back to me with this. Completely understand about the incorrect use of the MAC header, even after removing the header from my work project the same issue was present, so felt the more simplified a sample the better.

    I've made the edits in both projects but unfortunately they both have build errors for both the 52840 and 5340

    For the 52840

    d:\WorkspaceVSCodeGitHub\nrf_802154_rxclient\src\echo-client.c:77:35: error: expected ')' before numeric constant
    77 | SYS_INIT(init_802154, POST_KERNEL, 80);

    I've used SYS_INIT previously without issues so rather confused by that one.

    5340

    d:\WorkspaceVSCodeGitHub\nrf_802154_rxclient\src\echo-client.c:25:10: fatal error: nrf_802154.h: No such file or directory
    25 | #include "nrf_802154.h"

    I get these errors whether it uses command line of VS code to build.

    For additional info:

    I've got both projects in this directory:

    D:\WorkspaceVSCodeGitHub
    The SDK is located here: D:\NCS\v2.2.0

    and the command line build I've run from this location D:\NCS\v2.2.0\zephyr is:

    for 5340 

    west build --build-dir d:\WorkspaceVSCodeGitHub\nrf_802154_rxclient\build_5340_term d:\WorkspaceVSCodeGitHub\nrf_802154_rxclient --pristine --board nrf5340dk_nrf5340_cpuapp -DCONFIG_NRF_802154_RADIO_DRIVER="y" -D802154_rpmsgCONFIG_NRF_802154_RADIO_DRIVER=y

    52840
    west build --build-dir d:\WorkspaceVSCodeGitHub\nrf_802154_tx_HW\build_52840_term d:\WorkspaceVSCodeGitHub\nrf_802154_tx_HW --pristine --board nrf52840dk_nrf52840 -DCONFIG_NRF_802154_RADIO_DRIVER="y"

    Equivalent changes for relevant project names. Feels like I'm missing something very simple.

    BR,
    Richard

  • Hi Richard, 

    Edvin is currently out of office. I will forward your answer to our IEEE guys. 

    One thing I do note from the west build commands included is that they are missing a double dash "--" in front of -DCONFIG_NRF_802154_RADIO_DRIVER=y

    How did you add this line to your build?

    Kind regards,
    Øyvind

  • Hi Øyvind,

    Thank you, I added the double dash but get the same errors on both projects.

    When building via VS code I've added "-- -DCONFIG_NRF_802154_RADIO_DRIVER=y" in to Extra CMake arguments.

    The command lines done from the SDK zephyr location with the projects in a different directory.

    KR,

    Richard

  • Hi Øyvind,

    I will forward your answer to our IEEE guys. 

    Nearly 2 weeks now, what is the update please? 2 months after raising this ticket and still no resolution.

    Richard

  • Hello Richard,

    I will ping our IEEE guys on our internal ticket. 

    BR,
    Edvin

Reply Children
Related