Problem building "Hello Axon" Edge AI app using current documentation

Was excited to get an (apparently) early copy of the nRF54LM20B-DK so that I could explore all the Edge AI capabilities of the system (using both Neuton and Axon models). In the Axon case , I searched for any applicable code samples, videos, courseware, etc.  Only thing I found that appeared to be (currently) complete enough to be useful was the standard online software documentation (as opposed to anything in the Edge AI Lab web pages, for example).

 In particular, the "Hello Axon" sample looked like a good place to start, especially since it uses synthetic data to train the model, rather than requiring some sensor (e.g., motion sensor as in the Thingy 53 Edge AI sample code).  Proceeded through the documented steps up until I hit the Building and Running section.  But the abbreviated instructions there left me in a lurch.  Any attempt to build failed with Include errors on finding logging/log.h.  Normally I would expect to just examine the folder structure, find the appropriate file and patch the Include statement, but since we have a more complicated environment, I suspect the root cause of the error lies deeper.


Any suggestions on how to proceed? (I certainly would appreciate more detailed instructions in the Building and Running section -- and left a web page comment to that effect.)

Notes:

  • The "piggyback" procedure to create an integrated "Edge AI" version of the nRF SDK seems clumsy (acting as if you are building an app in order to merge in the Edge AI library).  I suspect Nordic will smooth this out in the future.  Is there currently any way to validate the integrated library other than building samples with it?
  • Other documentation suggests that the Hello Axon build requires the 3.3.0-preview2 branch of the SDK.   I presume the west instructions invoked in integrating the Edge AI library took care of this (and did notice the 3.3.0-preview2 tag appearing in the console output)
  • On a related question, other Edge AI sample code for motion sensing on this and related nRF5xxx devices require a peripheral MEMS board (9-axis? Probably a Bosch sensor.) But there is no documentation on this board, either to build or buy one.  I suspect a Sparkfun or Adafruit board might suffice.  Any hints on this subject?


As ever, thanks for any comments and suggestions.  Looking forward to fully exercising the nRF54LM20B,

Mike
[email protected] and [email protected]

PS: I expect that "Edge AI", "Axon", "nRF54LM20B", etc., would all be useful tags to add to this message.  Why can't I enter them?

  •  It would be helpful to see the build log output. Supporting 3rd party boards is something we should definitely do, especially if these are upstream. Any particular board you'd like to use?

  • Thanks for the quick response.  Three issues in reply (two old, one new):

    1. I went back to a clean VS Code workspace, nRF Connect extension and set of SDK installations.  Also reviewed the stated SDK requirements and updated things such as the west version.  Proceeded through the steps outlined above and ended up back at the Building and Running section as before.
      1. This left me with VS Code in the state represented by the attached screenshot, with the desired main.c file open in an editor pane.  It would be useful if you could review the structure of this workspace to see if it looks correct.
        VS Code screenshot.pdf
      2. Now comes the problem.  How do I "build and compile" this app as instructed.  In the normal app building process (without Edge AI), the build process with the VS Code extension presents a configuration page for setting the target board, etc.  How do I invoke that process now?  Trying to compile directly (clicking on the triangle icon (Run C/C++ file) leads immediately to Include errors as noted before.
      3. So what I really need here is an expansion of the "build and compile" instructions with explicit instructions at what to do at this point.  
    2. Sorry for the confusion about the add-on board.  It's the board that contains a ad hoc motion sensor which is used with your Edge AI sample code for gesture recognition with Nordic dev kits that don't otherwise contain a motion sensor (like the Thingy 53).  The docs don't give it a part number or full schematic.  (I can find the exact reference in your docs if that would be useful).
    3. In carefully reviewing the prerequisites for nRF SDK development, I noted the following table in the Requirements reference webpage.  It appears to imply that development is only supported on Macs with Apple Silicon (i.e., not Intel-based) and only macOS Tahoe (26).  Is this correct?
      OS support table.pdf

    Hope this clarifies my original query,

    Mike

  • OK, let me answer my own question (#1) -- and I should admit, with the help of AI. Here's a query I tried in a normal Google search:
    AI Query.pdf

    And here's the response I received (two pieces to avoid some unintentional "redacting" in creating the PDF:

    AI Response1.pdf

    what are the steps to build and compile an nrf Connect app in VS code once the app is copied from an example - Google Search.pdf

    Here's the critical step: "3.1 In the APPLICATIONS view, click on Add Build Configuration."

    Obvious, huh?  Certainly to old hands with VS Code and the nRF Connect extension.  But not to me. In the normal case of creating an app from sample code, this step is automatically done in code generation by the extension, complete with a warning to set the configuration if the user attempts to compile the app before doing so.  

    Once I added a configuration (using the only possible hardware, the nRF54LM20B-DK and no other inputs), the app compiled correctly as shown below, yielding a zephyr.elf file, ready for flashing to the dev board.

     *  Executing task: nRF Connect: Generate config nrf54lm20dk/nrf54lm20b/cpuapp for edge-ai/samples/axon/hello_axon
    
    Building hello_axon
    west build --build-dir /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon --pristine --board nrf54lm20dk/nrf54lm20b/cpuapp --cmake-only -- -DCONFIG_DEBUG_THREAD_INFO=y
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /opt/nordic/ncs/toolchains/0c0f19d91c/opt/[email protected]/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/mike/Library/Caches/zephyr
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf54lm20dk, qualifiers: nrf54lm20b/cpuapp
    Parsing /Users/mike/workspaceEdgeAI/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/_sysbuild/empty.conf'
    Merged configuration '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/_sysbuild/empty.conf'
    Configuration saved to '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/zephyr/.config'
    Kconfig header saved to '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/_sysbuild/autoconf.h'
    --
       ********************************
       * Running CMake for hello_axon *
       ********************************
    Loading Zephyr default modules (Zephyr base).
    -- Application: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon
    -- CMake version: 4.2.1
    -- Found Python3: /opt/nordic/ncs/toolchains/0c0f19d91c/opt/[email protected]/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/mike/Library/Caches/zephyr
    -- Zephyr version: 4.3.99 (/Users/mike/workspaceEdgeAI/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf54lm20dk, qualifiers: nrf54lm20b/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/opt/nordic/ncs/toolchains/0c0f19d91c/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/opt/nordic/ncs/toolchains/0c0f19d91c/opt/zephyr-sdk)
    -- Found Dtc: /opt/nordic/ncs/toolchains/0c0f19d91c/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
    -- Found BOARD.dts: /Users/mike/workspaceEdgeAI/zephyr/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts
    -- Found devicetree overlay: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/zephyr.dts
    -- Generated pickled edt: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/Kconfig
    Loaded configuration '/Users/mike/workspaceEdgeAI/zephyr/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig'
    Merged configuration '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/prj.conf'
    Merged configuration '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/.config.sysbuild'
    Configuration saved to '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/.config'
    Kconfig header saved to '/Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /opt/nordic/ncs/toolchains/0c0f19d91c/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/0c0f19d91c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- CONFIG_NRF_AXON_INTERLAYER_BUFFER_SIZE 16
    -- CONFIG_NRF_AXON_PSUM_BUFFER_SIZE 0
    -- linking imported library /Users/mike/workspaceEdgeAI/edge-ai/lib/axon/bin/arm/libnrf-axon-driver-internal.a
    -- Using ccache: /opt/nordic/ncs/toolchains/0c0f19d91c/bin/ccache
    -- Found gen_kobject_list: /Users/mike/workspaceEdgeAI/zephyr/scripts/build/gen_kobject_list.py
    CMake Warning at /Users/mike/workspaceEdgeAI/zephyr/CMakeLists.txt:2350 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done (26.3s)
    -- Generating done (0.9s)
    -- Build files have been written to: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon
    -- Configuring done (38.6s)
    -- Generating done (0.1s)
    -- Build files have been written to: /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build
     *  Terminal will be reused by tasks, press any key to close it.
    
     *  Executing task: nRF Connect: Build [incremental]: hello_axon/build
    
    Building hello_axon
    west build --build-dir /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon
    
    [6/280] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.3.99 (/Users/mike/workspaceEdgeAI/zephyr), build: ncs-v3.2.0-rc1-9912-g4b6df5ff11b1
    [280/280] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       65268 B      1940 KB      3.29%
                 RAM:        8504 B       511 KB      1.63%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /Users/mike/workspaceEdgeAI/edge-ai/samples/axon/hello_axon/build/hello_axon/zephyr/zephyr.elf for board: nrf54lm20dk/nrf54lm20b/cpuapp
    [8/8] Completed 'hello_axon'
     *  Terminal will be reused by tasks, press any key to close it.
    

    So we can close my question #1, leaving #2 and #3 open yet.

    I have carefully documented this interaction here, hoping it will be users to others trying to use the Edge AI library.  I also suggest the following corrections:

    Suggested changes in Edge AI and nRF Connect:

    1. [Documentation] Following my experience as a curmudgeonly leader of software development teams, read the associated documentation for MIS-understanding, and correct appropriately.  If there's any way to read it wrong, someone will do it.  For the case in question, a bit more detail in the Building and Running section, e.g., the steps outlined in the AI response I got would be very useful.
    2. [nRF Extension] Is there any reason why the extension should not automatically add the blank configuration as part of generating the code?  Might require a dialog with the user to select which of the Edge AI is the desired target app.

    Thanks for your attention to these issues

    Mike

Related