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:
  • Hello Richard,

    I am very sorry for the late reply. I will do my best to prioritize this ticket. I will run your project tomorrow (It is currently 10:30pm, and I am at home. I need to be in the office to run it on 2xnRF5340 DKs.

    I am sorry for the inconvenience.

    Please be aware that I can't guarantee that I can give you a final answer tomorrow, but I will at least give you an update. A custom 802.15.4 stack is not something that we officially support, but I will do my best to figure out why the nRF5340 doesn't receive the callbacks.

    Best regards,

    Edvin

  • How do you build the project, and do I need to do something in order to transfer the messages, or do they start automatically once both devices are switched on?

    I tried building using "west build -b nrf5340dk_nrf5340_cpuapp -- -DCONF_FILE="overlay-802154.conf" ", but it fails with:

    C:/Nordic_Semiconductor/SDKs/ncs/my_projects/2.1.2/customer/echo_client_rx/src/echo-client.c:23:10: fatal error: nrf_802154.h: No such file or directory
       23 | #include "nrf_802154.h"

    (Using NCS v2.1.2, both on the transmitter and the receiver)

    What command did you use to build the applications? Or did you use VS code? If so, what does your build configuration look like? If you use ninja directly, please let me know all the commands you used to build. 

    BR,
    Edvin

  • Thank you Edvin,

    Once they're built nothing needs to be done, just see the nrf terminal output for the messages. I built both projects using VS Code.

    Both build configs are set up like this:

    FYI I noticed that the new release candidate of the SDK was using zephyr 3.2 which no longer requires IP so ran this test there but the same message occurs.

    This should probably be in a new ticket - but where does the build config setup get saved so that it I could have included that in the files sent? Best guess is it'll be part of the VS Code workspace file?

    BR,

    Richard

  • Richard said:
    This should probably be in a new ticket - but where does the build config setup get saved so that it I could have included that in the files sent? Best guess is it'll be part of the VS Code workspace file?

    You can right click on the build "folder" in VS Code, and select "Save configuration as preset", which will create a .json file in your application folder. If you create a new build configuration in a project folder where this .json file is present, you will get the option to generate from that preset. 

    However, your echo-client.c has, on line 23:

    #include "nrf_802154.h"

    but the compiler doesn't know where to pick it up from. Did you copy this file and paste it somewhere in your NCS repository?

    Can you please try to build it in a pristine version of NCS to see if you get the same error?

    Or can you upload your .json file?

    BR,

    Edvin

  • I've not done anything with the nrf_802154.h file manually. I've just done a pristine build on the 2.2.0rc on my laptop which I installed yesterday so no updates and that was fine.

    JSON file type not allowed as attachment apparently, but this is the code:

    {
        "version": 2,
        "cmakeMinimumRequired": {
            "major": 3,
            "minor": 20
        },
        "configurePresets": [
            {
                "name": "build_5340_802154",
                "displayName": "Build for NRF5340 DK NRF5340 application MCU",
                "generator": "Ninja",
                "binaryDir": "${sourceDir}/build_5340_802154",
                "cacheVariables": {
                    "NCS_TOOLCHAIN_VERSION": "NONE",
                    "BOARD": "nrf5340dk_nrf5340_cpuapp",
                    "BOARD_ROOT": "${sourceDir}/",
                    "CONF_FILE": "${sourceDir}/prj.conf",
                    "OVERLAY_CONFIG": "${sourceDir}/overlay-802154.conf"
                }
            }
        ]
    }

    I'll spend a bit of time putting this into a github repo as it might be a bit easier

Related