How to compile v3.0.x/modules/hal/nordic/nrfx/samples ?

I was able to complie many of the nrfx/samples under SDK v2.5.0 using VS Code IDE but cannot successfully compile any under SDK v3.0.0 .

The [Building and running]: <../../README.md#building-and-running> link referenced in the README.md file of each sample doesn't exist.

While the <../../README.md#building-and-running> link did not exist for v2.5.0 either at least  I was able to successfully compile and flash many of the examples.

Now I am stumped.  Attempts via 'Build system default', 'Use Sysbuild', or 'No sysbuild', or trying  'west build --board ..' via a 'nRF Serial Terminal' all fail.

Please tell me how to compile the 'v3.0.x/modules/hal/nordic/nrfx/samples'.

My need to make use of the Easy-DMA capability of nrf5340 spim4 , PWM, and also implement a delay line effect on a digital input signal. All without consuming excessive CPU cycles.

Thanks,

-JLE

Parents
  • Hi JLE,

    Is this the error you have got?

    CMake Error at CMakeLists.txt:11 (GET_DEVICE_CONFIG_FILES):
      GET_DEVICE_CONFIG_FILES Macro invoked with incorrect arguments for macro
      named: GET_DEVICE_CONFIG_FILES

    If so, I have narrowed down the issue to the BOARD variable being not set when this CMake line is run:
    hal_nordic/nrfx/samples/src/nrfx_spim/non_blocking/CMakeLists.txt at nrfx-3.9.0 · zephyrproject-rtos/hal_nordic

    I am unclear why yet. I will continue investigating it and update you this week.

    Hieu

  • Hi Hieu,

    (1) The Cmake error is indeed what occurred when I was using sysbuild. 

    Note the 'src/nrfx_spim/non_blocking' sample compiles for me when using 'No sysbuild'.

    Unfortunately I was trying to compile the 'nrfx-samples-v3.0.0/src/nrfx_rng' sample when I filed my report. That specific sample fails under 'Use sysbuild', 'No sysbuild' , and 'west ...' command line scenarios. That sample is a red herring for my underlying issue.

    My desire is for 'Use sysbuild' to work for all of the nrfx samples since I am trying to upgrade my project (which was organized using the directory structure of the nrfx samples) to SDK v3.0.0. In other words I have hierarchically organized  legacy library source code needed by many of my apps residing within the equivalent of a  'samples/common' directory'. 

    Looking forward to you update regarding the BOARD variable.

    (2) Is there a guide for the correct way within the SDK v3.0.0 framework to develop (or use  available open source ) common source code used by multiple apps? I am not referring to a zephyr driver module for a sensor but more like a quaternion math library. 

    -jle

Reply
  • Hi Hieu,

    (1) The Cmake error is indeed what occurred when I was using sysbuild. 

    Note the 'src/nrfx_spim/non_blocking' sample compiles for me when using 'No sysbuild'.

    Unfortunately I was trying to compile the 'nrfx-samples-v3.0.0/src/nrfx_rng' sample when I filed my report. That specific sample fails under 'Use sysbuild', 'No sysbuild' , and 'west ...' command line scenarios. That sample is a red herring for my underlying issue.

    My desire is for 'Use sysbuild' to work for all of the nrfx samples since I am trying to upgrade my project (which was organized using the directory structure of the nrfx samples) to SDK v3.0.0. In other words I have hierarchically organized  legacy library source code needed by many of my apps residing within the equivalent of a  'samples/common' directory'. 

    Looking forward to you update regarding the BOARD variable.

    (2) Is there a guide for the correct way within the SDK v3.0.0 framework to develop (or use  available open source ) common source code used by multiple apps? I am not referring to a zephyr driver module for a sensor but more like a quaternion math library. 

    -jle

Children
  • Hi JLE,

    jle said:
    Unfortunately I was trying to compile the 'nrfx-samples-v3.0.0/src/nrfx_rng' sample when I filed my report. That specific sample fails under 'Use sysbuild', 'No sysbuild' , and 'west ...' command line scenarios. That sample is a red herring for my underlying issue.

    This is unfortunate. I will have to revisit this later to see what is wrong with that sample in particular.

    The fact that no-sysbuild works is a big clue. With that, I found that the BOARD variable stays in the list of Sysbuild CMake variable and isn't passed down to the application build.

    Adding these lines before GET_DEVICE_CONFIG_FILES() in the samples' CMakeLists.txt fixes that build issue:

    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    zephyr_get(BOARD SYSBUILD GLOBAL)

    Having said that, I don't think it's a good idea to use the nrfx samples' structure everywhere. The nrfx samples try to be as OS-agnostic as possible, so it has that peculiar setup with the "common" directory.

    jle said:
    (2) Is there a guide for the correct way within the SDK v3.0.0 framework to develop (or use  available open source ) common source code used by multiple apps? I am not referring to a zephyr driver module for a sensor but more like a quaternion math library. 

    I recommend going over the guides here:

    https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/zephyr/connectivity/bluetooth/bluetooth-dev.html
    https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/zephyr/develop/application/index.html

    I believe the application types you are interested in would be Freestanding Application or Workspace Application.

    If you are not totally familiar with Zephyr concepts yet, I recommend the online courses on our Developer Academy website.

    I hope that is enough for you to progress now. I will figure out what else is wrong with the RNG sample in one to three business days.

    Hieu

Related