nrf52840-dk support

109 views
Skip to first unread message

Gábor Ziegler

unread,
Dec 28, 2019, 2:50:52 PM12/28/19
to ant-api
Hi,

Before starting ANT programming on the Adafruit nrf52840 Express feather, I thought it would be safer to try it with a devkit from NordicSemi. I have chosen the the devkit with the same MCU: nrf52840-DK.

Are there any tutorial, how to load ant-arduino (and antplus) onto that board? Do I have to load the s340 softdevice first?  It seems there is no S2xx softdevice for this SoC, i.e., no ANT-only sodtdevice...

Thanks, Gabor

Curtis Malainey

unread,
Jan 7, 2020, 6:13:20 PM1/7/20
to Gábor Ziegler, ant-api
Resending to mailing as I accidentally dropped it.
Hi Gabor,

Unfortunately this is not that easy. This is due to the licensing of the ANT devices which isn't very permissive for sharing. The way I got it to work when I tired it a couple years ago was I hacked the softdevice into the Arduino IDE config files similar to the BLE devices already there.

You have to copy the headers and the binary, modify the linker scripts based on your soft device, modify the defines so any BLE modules are added/substracted form the codebase (by changing the SXXX define). You need to modify the headers to enable the evaluation license. There was also a minor change to the headers that was causing a compilation error (can't recall exactly what it was) but you can reference the original BLE headers for the fix.

As for ant-arduino and antplus-arduino's readiness, they are not ready yet. I need to complete the NativeAnt driver and add the related calls to the message types. Antplus-arduino should require no changes. Hope that sheds some light on the situation at hand.

I have a Adafruit Feather nRF52840 Express now, I hope to connect it to my debugger and see if I can get it working with ANT. Unfortunately it will require modifying the device's bootloader which will be a non-trivial task but for anyone with a debugger it should be possible.

--
You received this message because you are subscribed to the Google Groups "ant-api" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ant-api+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ant-api/d8259207-7115-45d6-865f-f8fa326289d3%40googlegroups.com.

Gábor Ziegler

unread,
Jan 8, 2020, 3:03:14 PM1/8/20
to Curtis Malainey, ant-api
Ok, thanks. I do not know if it helps you, but today I finally received my SWD cable via the post, so I could connect the Feather to Segger OB on my  nrf52840-dk.

This is the memmap of the Adafruit Feather with the factory bootloader + app + BLE SD:
bild.png

Curtis Malainey

unread,
Jan 11, 2020, 9:23:14 PM1/11/20
to Gábor Ziegler, ant-api
Hi Gabor,

Apologise for the delay, I am traveling for work currently and won't be back till next week. Mind sending me how you you got that dump so I can try with the modified bootloader?

Curtis

Gábor Ziegler

unread,
Jan 12, 2020, 6:21:19 AM1/12/20
to Curtis Malainey, ant-api

Hi Curtis,

Don't worry, I can't devote enough time for this, either. :/

The memory dumps were easy.  I have made them with the GUI alternative of the CLI tool nrfjprog. See the guide for installing nRFGo Studio.
( As I had known nothing about embedded programming and NordicSemi chips, first I wanted to "RTFM".This is how I have found the tool.
For the memmaps I had to hook the nRF52840 Express to the onboard (OB) Segger built into the nRF52840-DK board from NordicSemi.  I suppose you can use a standalone Segger, too.
  1. Just connect the Feather to the Segger,..
  2. ... then the Segger to the PC.
  3. Power up both...
  4. ...and launch nRFGo Studio. 
  5. On the GUI select on Segger item identified by its serial number in the Device Manager pane. Wait for a few seconds until nRFGo Studio connects to the Segger, the Segger to the Feather and then it automatically shows the memory map:
    kép.png

Otherwise, I am quite hopeless now. I wanted to try modifying the bootloader myself. (My challenge is that I need to prioritize my wife's work on our  home computer, while my employer has disabled USB Mass Storage Devices on my work laptop due to some stupid security considerations. This makes working with UF2 based bootloaders, such as the Adafruit one, a nightmare. Furthermore, I used to be a SW developer for a telecom signalling load application more than a decade ago, but then I had worked in generic POSIX environment using ClearCase. Since then, I only produced slideware. This "git" thingy and embedded programming has a very steep learning curve for me, so far.) 

As a pipe cleaner first step I want to be able to recompile and upload the stock Adafruit bootloader with s140 SD, in order to understand the process and ensure that I have to troubleshoot only problems related to the s340 SD, not with my lack of knowledge. However, I have failed so far. I am trying to do this on various  Win 10 machines. Maybe that is the problem... :/
  • I could clone the bootloader from the official Adafruit GitHub repo, including tinyusb and nrfx sub-repos. The README sais that it comes with Segger Embedded Studio (SES) project file. (I have installed SES as part of my initial RTFM step.)
  • So,  I tried to compile with SES, but it failed due to files seemingly missing from the repo :/,  such as Adafruit_nRF52_Bootloader\lib\tinyusb\src\portable\nordic\nrf5x\hal_nrf5x.c... :/
  • Then I have had a long journey to get a working copy of the ARM-GCC toolchain on my machine. Very rough journey, I have failed to suceed with the Windows xPack variant, so I have ended up to use Ubuntu in Win10 WLS (Windows Linux Subsystem) . However, the net wisdom said that the Ubuntu ARM GCC packages are broken, so I have ended up installing it from tarball in my WLS home. That GCC has compiled the Adafruit booloader  with the included Makefile like a breeze. However, it failed to recognize the Segger from the WLS, so I couldn't flash it to the board as nrfjutil failed to execute... :/
  • I tried to burn the compiled bootloader (with the bootloader + s140 SD combined) in .hex form with nRFGoStudio, however, that failed. It programmed the bootloader, but failed to verify the image and indeed the board got bricked. :/
After some additional hours I managed to "unbrick" the Feather via the "official" Adafruit Arduino IDE toolchain and the Segger, at least, but now I am back to square one.
So, now I am stuck. :/

If you have time to eventually share how do you compile and programm your bootloader I woudl appreciate that. Please keep mind, that I have very little experience with this stuff yet, so pls. try to write down even the "obvious" stuff, since that is probably not obvious for me yet...
 
///Gábor

Gábor Ziegler

unread,
Jan 12, 2020, 6:41:56 PM1/12/20
to Curtis Malainey, ant-api

Curtis Malainey

unread,
Jan 16, 2020, 3:28:54 AM1/16/20
to Gábor Ziegler, ant-api
Hi Gabor, this all looks very interesting, I will definitely check it out when I am back home next week. Thanks for the detailed document.

Curtis

Gábor Ziegler

unread,
Jan 16, 2020, 5:21:22 AM1/16/20
to Curtis Malainey, ant-api
Thanks, meanwhile I am thinking if it makes sense for me to wait for your excellent work. IIRC you do not support yet native ANT+ SD access, do you? As I do not have an ANT radio module communicating via serial to some arduino but rather an nRF52840 SoC, therefore I am better to go ahead and start to learn/use native C++ programming using the nRF5 SDK, right?
///G

Gábor Ziegler

unread,
Jan 16, 2020, 11:16:24 AM1/16/20
to Curtis Malainey, ant-api
Also, if you have time, then checkout the SparkFun nRF5 SDK tutorial about adjusting the linker settings for memory maps: https://learn.sparkfun.com/tutorials/nrf52840-advanced-development-with-the-nrf5-sdk#building-blinky-for-the-sparkfun-nrf52840-mini-breakout 
Reply all
Reply to author
Forward
0 new messages