This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Board: nrf52dk_nrf52832 Do not work with Zephyr

I want to try Zephyr on the nrf52dk_nrf52832. (PCA10040)

I can not get it to work.

If I try to use -DBOARD=nrf52dk_nrf52810 All is OK

Here is what I do:

cd ~/zephyr_test/hello_world
mkdir _bld; cd _bld
cmake -DBOARD=nrf52dk_nrf52810 ..

The Output is:

Including boilerplate (Freestanding): /home/joe/zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/joe/zephyr_test/hello_world
-- Zephyr version: 2.4.99 (/home/joe/zephyrproject/zephyr)
-- Found Python3: /usr/bin/python3.7 (found suitable exact version "3.7.3") found components:  Interpreter  
-- Found west (found suitable version "0.8.0", minimum required is "0.7.1")
-- Board: nrf52dk_nrf52810
-- Cache files will be written to: /home/joe/.cache/zephyr
ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found toolchain: zephyr (/home/joe/zephyr-sdk-0.11.4)
-- Found dtc: /home/joe/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/joe/zephyrproject/zephyr/boards/arm/nrf52dk_nrf52810/nrf52dk_nrf52810.dts
-- Generated zephyr.dts: /home/joe/zephyr_test/hello_world/_bld/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/joe/zephyr_test/hello_world/_bld/zephyr/include/generated/devicetree_unfixed.h
Parsing /home/joe/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/joe/zephyrproject/zephyr/boards/arm/nrf52dk_nrf52810/nrf52dk_nrf52810_defconfig'
Merged configuration '/home/joe/zephyr_test/hello_world/prj.conf'
Configuration saved to '/home/joe/zephyr_test/hello_world/_bld/zephyr/.config'
Kconfig header saved to '/home/joe/zephyr_test/hello_world/_bld/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/joe/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/joe/zephyr_test/hello_world/_bld

I then run make and all is OK.

Than (in another terminal window):
minicom -D /dev/ttyACM0 -b 115200

I'm Flashing the board:
nrfjprog -f nrf52 --program ./zephyr/zephyr.hex --sectorerase
And reset it:
nrfjprog -f nrf52 --reset

In minicom I get:
*** Booting Zephyr OS build zephyr-v2.4.0-1657-g5a58ad508cb3  ***
Hello World! nrf52dk_nrf52810

So far All is OK.

*****************

I then do:
rm -r *
cmake -DBOARD=nrf52dk_nrf52832 ..

And The Output is:

Including boilerplate (Freestanding): /home/joe/zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/joe/zephyr_test/hello_world
-- Zephyr version: 2.4.99 (/home/joe/zephyrproject/zephyr)
-- Found Python3: /usr/bin/python3.7 (found suitable exact version "3.7.3") found components:  Interpreter  
-- Found west (found suitable version "0.8.0", minimum required is "0.7.1")
-- Board: nrf52dk_nrf52832
-- Cache files will be written to: /home/joe/.cache/zephyr
ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found toolchain: zephyr (/home/joe/zephyr-sdk-0.11.4)
-- Found dtc: /home/joe/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/joe/zephyrproject/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts
Error: nrf52dk_nrf52832.dts.pre.tmp:415.3-4 syntax error
FATAL ERROR: Unable to parse input tree
CMake Error at /home/joe/zephyrproject/zephyr/cmake/dts.cmake:206 (message):
 command failed with return code: 1
Call Stack (most recent call first):
 /home/joe/zephyrproject/zephyr/cmake/app/boilerplate.cmake:589 (include)
 /home/joe/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
 /home/joe/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:102 (include_boilerplate)
 CMakeLists.txt:5 (find_package)


****** And this is the end of the show ******

What is wrong?

Same Error with samples/basic/blinky   and   samples/bluetooth/beacon (the one I tested).
Guess it is the same with ALL "samples" that use "nrf52dk_nrf52832",
When I test with "nrf52dk_nrf52810", it is OK

  • No.
    I did not do anything but install Linux and then Zephyr according to the installation procedure at the Zephyr site. When I try something new, I like to make it as clean as possible.

  • Thank you for getting back quickly.

    I just had a brief chat with the team. One suggestion/recommendation was to try the latest tagged release of the SDK, v2.4.0.

  • I had the latest release installed (at least I thought so), I tried to update it, in every way I could think of.
    Nothing helped.
    I then made a new Zephyr install on a different PC (with the same OS). This worked as it should.
    I then copied the "~/zephyrproject/zephyr" directory from the new Zephyr installation to the PC with the faulty installation. And after that the "nrf52dk_nrf52832target" worked as it should.
    I have no idea of what might have gone wrong, but it seems like all is OK now.

    So now I can start on what I wanted to do with Zephyr:
    Get the "zephyr/samples/lorawan/class_a/" to compile for the "nrf52dk_nrf52832target".

    What do I have to change to achieve this?

    I do not expect it to work, but if I can get it to compile, I can then start with the configuration and "twisting" to, hopefully, get it to run on nrf52832.
    I think I know enough about LoRaWan and nrf52832 to manage this, but I do NOT know much about Zephyr.
    So a little help to get this started would be nice.

    I think it should be easier to get the LoRaWan Stack run on Zephyr, then it was to get LoRaWan run on "bare metal" nrf52832 (with my tiny little "jos").
    But I need a decent starting point.
    I have done a lot of work to get this far with LoRawan and nrf52832, and if I can get it to run with Zephyr, this should be a BIG step forward with my project.

    I know that all I want and need is already in place in mbed, but I do not know much about mbed either. But the little I have seen from both mbed and Zephyr, I think Zephyr is far closer to what I feel comfortable with. But sadly, it have little support for LoRaWan.

  • Good to hear that you are now able to build without any errors. However, I do not know exactly what may have caused the error. One thing you could try though is to compare the .dts files from your working and non-working installation folders (/home/joe/zephyrproject/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts). Like suggested by Eirik Aanonsen, there might be a clue in this file. When I insert a syntax error myself in this file I see a similar error as you do in the output.

    In general it is recommended to work on the latest tagged release(at the moment v1.4.0), and only work on the master branch when specific new features are to be explored.

    I will get back to you regarding the new topic, LoRaWan.

  • There was an erroneous line in the "nrf52dk_nrf52832.dts" file, and it was an painful and embarrassing discovery to see it. I changed the line;
    compatible = "nordic,nrf-uarte";
    to;
    compatible = "nordic,nrf-uart";
    And when I should put back the original line, I commented out the one I changed, and .... I used WRONG comment character, it feels like I want to disappear in a hole in the ground, almost ....

    Well, it was all my fault, sorry about that.

    But I'm still eager to run LoRaWan on Zephyr and nrf52dk (PCA_10040).

    During the LoRaWan porting to nrf52832, I used the "NucleoL476" with a "SX1276MB1MAS" shield as a reference, I compared my various nRF52 boards to this (made some timestamp code in the drivers to compere the timing of the various drivers).
    I tested on my own hardware, the ee02 board from Telenor and the PCA_10040 with the SX1276MB1MAS shield. All of them run the latest Semtech LoRaWan Stack .

    I want to be able to communicate with my LoRaWan nodes via BLE as well.
    And then I'm in need for Zephyr.
    Zephyr can also give me filesystem, near-field com and over the air firmware update. Something I think all LoRaWan nodes should have...
    I want to use BLE as a kind of keyboard and display into the node. And use it for setup, config, maintenance and debugging.

    So what I should like to see is some kind of tutorial on how to port the "zephyr/samples/lorawan/class_a/" from stm32 to nRF52.
    Do I have to rewrite the radio drivers for nRF52?
    Or other parts?
    Or a list of things that need modification...

Related