0

nRF52840 AdafruitBSP failure on nRF52840-DK and custom board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

nRF52840 AdafruitBSP failure on nRF52840-DK and custom board

by cbarringer on Fri May 31, 2019 12:06 pm

Ok I’m at my wit’s end with this which means it’s time to ask for help :)

I’m trying to program a Nordic nrf52840 bluetooth MCU which I have on my own custom board. The actual module is on a Rigado BMD-340 - more or less identical to the MDBT50Q-1M module used on your nRF52840 Feather module. I also see that the board support package you've made for Arduino has comparability with the standard nrf52840-DK and many of your advanced tutorials indicate the ability to use a J-link to program this MCU directly.

My actual toolchain is VS Code with the PlatformIO plugin - they support your boards and the Arduino/Adafruit BSP for this MCU but allow an option to upload with J-link unlike the normal Arduino IDE.

Unfortunately, I have completely failed to get any code running on my module OR a standard nrf52840-DK with the AdafruitBSP. I'm trying to blink an LED attached to pin P0.07. Interestingly enough, I've tried similar setups and programs with BOTH Zephyr RTOS as well as the MBED ecosystem - they BOTH can blink my LED just fine - so my hardware is good.

I'd really like to take advantage of your work on this MCU because it's much simpler than MBED or Zephyr's insanely complex bluetooth architectures.

1. Why might I not be able to toggle an I/O pin on the dev kit or my custom board when using this software package and a J-link directly?

2. How can I define and use a custom board of my own while still using the Adafruit BSP?

3. Is pin 7 hard-coded in some variant file somewhere making this harder to use? If yes, where would I find this?

Here are some screenshots of my PlatformIO setup which does NOT work:

Arduino_INI_FILE.PNG
Arduino_INI_FILE.PNG (25.99 KiB) Viewed 118 times

ArduinoHelloWorld.PNG
ArduinoHelloWorld.PNG (16.4 KiB) Viewed 118 times

ArduinoUpload.PNG
ArduinoUpload.PNG (51.8 KiB) Viewed 118 times


Any assistance is greatly appreciated! Thanks!

cbarringer
 
Posts: 8
Joined: Sat Jun 10, 2017 11:55 am

Re: nRF52840 AdafruitBSP failure on nRF52840-DK and custom b

by cbarringer on Fri May 31, 2019 4:17 pm

!UPDATE!

I have things sorta working finally!

It appears that the Adafruit nrf52840 bootloader MUST be burned separately onto the chip (I used the Arduino IDE for this with the J-link burn boot-loader option)

Now, my PlatformIO J-Link upload works properly. And I can also upload the normal way with the arduino ide over the virtual com port created by the bootloader.

I'm honestly not sure how things are working in the background - my guess is that the J-Link upload script is placing the "code" in a random start place in memory and simply expects some previously installed boot-loader to be present in order to actually begin running that code. So, maybe I was uploading code to a random memory location with nothing to start it up. The memory map page for the nrf52840 shows numbers completely different than the numbers in all scripts and config files I found within the AdafruitBSP so I still don't know how things are configured exactly.

It would still be nice to know the proper way to setup my own board file for my custom PCB. I think i've found the proper "pca10056" folder with the variant files. Gonna try to copy it, edit it for my custom PCB, and see if I can use that.

cbarringer
 
Posts: 8
Joined: Sat Jun 10, 2017 11:55 am

Please be positive and constructive with your questions and comments.