I've been using STM32 controllers with LoRaWan mostly GNU based and bare metal. Recently, I have been looking at the STM Nucleo STMWB32 communicating with a Raspberry Pi and I have it working but not well. Recently, Kevin Townsend (I just purchased his book) suggested I look into using Zephyr and also recommended Nordic devices. Based on his recommendation, I have been trying to get an nRF25840-DK started but despite spending considerable time, I can't get through the very first simplest step of downling the hex onto the device and running it. I do have the App installed, but am pretty sure the hex is not running. Setup: Ubuntu 18.04:
> uname -a
Linux granite10192.168.1.23 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
The getting started guide suggests copying the hex to the drive folder that opens when the device is connected, and that the app will start automatically. The drive opens, I copy the hex, but it doesn't start. Pushing button 1, the LED 1 is supposed to blink once a second showing advertising. It doesn't. I have attempted to load the hex using the nRF Connect v3.3.3. programmer and writing the hex to the device and then re-reading the device. This seems to work (see log below), but I can not get the program to run.
From the getting started guide:
1.2.Download the Heart Rate Monitor (HRM) demo application from nRF52840 DK Downloads, nRF52833
DK Downloads, or nRF52 DK Downloads and extract it into a folder of your choice.
Power up the development kit:
a) Connect one end of a micro-USB 2.0 cable to the Universal Serial Bus (USB) connector on the kit
and the other end to one of your PC's USB host ports.
b) Slide the power switch to ON.
3.Observe that LED1 starts blinking.
LED1 does not start blinking.
I disconnected from the Connect programmer, and once again tried copying heart_rate_demo.hex to the USB drive, the folder closed, a second opened, the file had disappeared, but pushing button 1 did nothing.
I downloaded Segger Embedded Studio and tried going through their getting started guide, but go stuck at:
CMakeLists.txt - the location of the CMakeLists.txt
project file of the sample that you want to work with (for example, the full path to ncs/nrf/applications/asset_tracker/CMakeLists.txt
)
I can not find the path to ncs/nrf/applications/asset_tracker/CMakeLists.txt.
I looked in my $HOME/.config/nrfconnect/ but can not find anything there. I also used locate but couldn't find ncs/nrf/applications.
> ls $HOME/.nrfconnect-apps/
. local pc-nrfconnect-gettingstarted.svg pc-nrfconnect-rssi.svg
.. node_modules pc-nrfconnect-linkmonitor.svg pc-nrfconnect-toolchain-manager.svg
apps.json pc-nrfconnect-ble.svg pc-nrfconnect-ppk.svg pc-nrfconnect-tracecollector.svg
external pc-nrfconnect-dtm.svg pc-nrfconnect-programmer.svg updates.json
> ls $HOME/Dropbox/Nordic/arm_segger_embedded_studio_v452_linux_x64_nordic
. .. bin gcc html include lib llvm packages samples source targets
Next I tried:
> cd /
> sudo find . -iname CMakeLists.txt
this found lots of CMakeLists.txt, but none under an ncs/nrf/applications tree.
I also downloaded Zephyr and in $HOME/Dropbox/Nordic/Zephyr/zephyrproject/zephyr I can see some CMakeLists.txt file, but I can't figure out how to use this to get started. I can see some examples, but under the board folders, there doesn't seem to be anything for the nRF52840 DK.
I have used openocd quite a bit and have no problem with it, but I have not used JLink previously. I have purchased a Segger USB debugger, but until I get at least something to run on the nRF52840-DK, I don't really know how to get started with this.
Finally, should I be using nRF Connect, or Zephyr, or Segger Embedded Studio, or $HOME/Dropbox/Nordic/s11/ or $HOME/Dropbox/Nordic/nRF_CLTools/ or nRF SDK tools? or do I need to try them all first? Or should I just try to take a bare metal approach with GNU gcc and gdb, something I am familiar and comfortable with, and it does seem there may be some examples under $HOME/Dropbox/Nordic/s11/?
Finally, am I the only one having problems like this? How where others successfully able to get over this very simple "Getting Started" step? I always thought the point of using "Getted Started" projects was to make getting started easy; I guess I was sadly mistaken.
2020-05-20T22:10:04.472Z INFO Parsing HEX file: /home/martin/Dropbox/Nordic/heart_rate_demo/heart_rate_demo.hex
2020-05-20T22:10:04.571Z INFO File was last modified at 11/03/2016, 10:18:22
2020-05-20T22:10:04.712Z INFO SoftDevice detected, id 0x81 (S132 v2.0.0)
2020-05-20T22:11:38.148Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-20T22:11:42.437Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-21T20:29:49.011Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-21T20:31:21.736Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-21T20:36:40.552Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-21T21:10:32.857Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-21T21:26:07.387Z VERBOSE Could not fetch serial number for serial port at /dev/ttyACM0
2020-05-25T18:19:17.044Z INFO Using nrfjprog to communicate with target
2020-05-25T18:19:19.277Z INFO Using J-Link Software version 6.72
2020-05-25T18:19:20.599Z INFO Segger serial: 683455871
2020-05-25T18:19:20.600Z INFO Segger speed: 2000 kHz
2020-05-25T18:19:20.600Z INFO Segger version: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
2020-05-25T18:19:20.612Z INFO Core probed: 683455871.
2020-05-25T18:19:20.612Z INFO Core RAM: 256KiB.
2020-05-25T18:19:20.612Z INFO Core ROM: 1024KiB in pages of 4KiB.
2020-05-25T18:19:20.741Z INFO Model: NRF52840_xxAA_REV1.
2020-05-25T18:19:22.137Z INFO Core0: Reading device non-volatile memory. This may take a few seconds.
2020-05-25T18:19:22.211Z INFO Core0: UICR has been read. Click read button to read full non-volatile memory.
2020-05-25T18:19:22.349Z INFO SoftDevice detected, id 0x81 (S132 v2.0.0)
2020-05-25T18:19:26.185Z INFO Using nrfjprog to communicate with target
2020-05-25T18:19:27.497Z INFO Using J-Link Software version 6.72
2020-05-25T18:19:28.808Z INFO Segger serial: 683455871
2020-05-25T18:19:28.808Z INFO Segger speed: 2000 kHz
2020-05-25T18:19:28.809Z INFO Segger version: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
2020-05-25T18:19:28.819Z INFO Core probed: 683455871.
2020-05-25T18:19:28.819Z INFO Core RAM: 256KiB.
2020-05-25T18:19:28.819Z INFO Core ROM: 1024KiB in pages of 4KiB.
2020-05-25T18:19:28.949Z INFO Model: NRF52840_xxAA_REV1.
2020-05-25T18:19:30.215Z INFO Core0: Reading device non-volatile memory. This may take a few seconds.
2020-05-25T18:19:44.281Z INFO Core0: Non-volatile memory has been read. 5 non-empty memory blocks identified
2020-05-25T18:19:44.404Z INFO SoftDevice detected, id 0x91 (S132 v3.1.0)
2020-05-25T18:19:44.408Z INFO SoftDevice detected, id 0x81 (S132 v2.0.0)