nRF52840 troubleshooting; I can't program it via visual studio code nor via my own uf2 files

Good Day All,

I'm having troubles with my nRF52840. (Specifically the nRF52840 18010 Holyiot module [http://www.holyiot.com/tp/2019042516322180424.pdf])
I've designed a pcb for controlling a bunch of hobby servos via pwm, while being powered by a 2~4S lipo with a dcdc converter for the servos and a couple LDOs for the other voltage levels.
I've been able to confirm the pcb working as intended through a uf2 file for a keyboard.

The problem I'm facing is with programming it myself however.
I've gone through this guide on how to install the Add-ons for visual studio code in order to program the nRF;
www.youtube.com/watch

My nRF doesn't show up as expected by the guide however.
I can put the nRF into usb drive mode and put uf2 files on it that way(which is how I confirmed the pcb to working as expected).
But even that way, any code that I convert to a uf2 file myself doesn't seem to run on the nRF (I don't get any output on the pins at least).
In VSC the nRF doesn't show up at all however.

The Info_UF2.txt in usb mode reports this:
> UF2 Bootloader 0.2.11 lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
> Model: Nordic nRF52840 DK
> Board-ID: nRF52840-pca10056-v1
> Date: May 4 2019
While the INDEX.htm points here:
> www.nordicsemi.com/.../nrf52840-dk


My current guess is that its because of the bootloader I installed;
github.com/.../Bootloader

Of those I installed the recommended one via an RPI 3B. (With help of others that is)
I'm open to other ideas however on why I can't program it like an Arduino with the VSC Add-Ons.

I've looked for the nRF bootloader for the devkit, as my custom pcb is basically just breaking the pins out directly (only with a voltage shifter for the 5V for the servos).
But it seems I'm too blind to find it, and I've only worked with Arduino thus far, so I'm quite confused in general.
I also couldn't seem to find a guide on how to install any bootloaders aside from the one mentioned above and for the arduino nrf boards.


Feel free to point me to a guide on how to install the correct booloader and/or other troubleshooting measures I could try.
If you feel up to it; I'm also more than happy to join a discord call to have someone guide me through it [I'm a mechanical engineer, so I have quite some trouble with programming anyway :(]

Ultimately my goal with this pcb is to control a hexapod I designed with the nRF doing the Inverse kinematic calculations, the pwm output as well as the wireless communication and battery voltage tracking.
I'm planning on another pcb which will act as the radio for the hexapod, but I want this one working first before ordering the radio pcb.

Kind Regards from germany

Parents
  • Hi Io, 

    I think what missing here is the programmer. 
    The youtube link you provided show how to get started with a Nordic's DK or at least you would need to have a Jlink programmer. 

    It's possible to flash firmware with the UF2 bootloader, but I don't think it's the best way to start your development. 
    My suggestion is to either get a Nordic DK (that you can use as the programmer for your custom board) or get a Jlink programmer. It will save you a lot of time for developing with Nordic. 

  • Hey Hung Bui,
    Thanks for answering.

    So i can't program the nrf with VSC via USB, but instead need to use a Jlink if i want to program via USB as it as shown in the video?

    If you have some guide using a Jlink to recommend feel free to post it as well.

    Edit:
    I've just took a look at the Segger J-Link, either I'm looking at the wrong thing, or those are really expensive (800€+).
    Might there be some cheaper alternatives?

  • Hi Io, 

    The interface in VSCode doesn't support the bootloader from Adafruit. It also doesn't generate the uf2 format. 

    From my point of view the bootloader is good for smaller application where you can upload and have a quick test or as you said to change a couple lines of code then upload again. I assume you still can do that with the uf2 bootloader, just not with VSCode, right ? 


    The UF2 bootloader doesn't offer you the possibility to debug, step in the code etc. If you are going to do actual development you would need to have a better way to do debugging that's why you should have a DK.  

  • From my point of view the bootloader is good for smaller application where you can upload and have a quick test or as you said to change a couple lines of code then upload again. I assume you still can do that with the uf2 bootloader, just not with VSCode, right ? 

    Hey,

    I haven't been able to make a uf2 file that works to be honest.
    I've gotten a working one from someone else, but can't make my own uf2 files.

    I'm sure im doing something wrong, otherwise it'd work, but I don't know what.

    If there's any plugins/guides you know of for VSC or arduino ide that output a working nrf uf2 please let me know so I can try those.
    Thus far I've been unsuccessful with the ones I found.

  • Hi Io, 
    Unfortunately I'm not familiar with the uf2 / Arduino environment neither. 

    That's the reason I would suggest to start with our DK. It has much more material for you to get started. For example you can take a look at our Nordic Dev Academy here: https://academy.nordicsemi.com/

  • Hey,

    Too bad, thanks for the help thus far anyway tho^^

    I've ordered a DK, but it'll take a bit to arrive.
    Will start with the academy course then, see how far I come.

    You don't happen to know someone who is familiar with creating uf2 files for the nRF?
    If you do, would you mind asking them to check this thread out?

    With kind regards

  • Hey Hung Bui,

    I've gotten the DK in and tried following the guide, yet it doesn't show up either.
    I've also re-installed visual studio code as well as the nrf command line tools, deleted everything in user and appdata regarding VSC and nrf command line tools i could find to install it again following the guide.

    Anything that might have changed in between when the videos where created and now?
    As recommended i used the latest builds for everything where i could choose.

    Or any way i can check the DK or my own PCB being even accessible by my PC in some other way that doesn't need any other programs?
    I've tried both DK and mine with multiple USB cables to no avail.

    I'm completely at a loss here as to what I can do to make things work...

Reply
  • Hey Hung Bui,

    I've gotten the DK in and tried following the guide, yet it doesn't show up either.
    I've also re-installed visual studio code as well as the nrf command line tools, deleted everything in user and appdata regarding VSC and nrf command line tools i could find to install it again following the guide.

    Anything that might have changed in between when the videos where created and now?
    As recommended i used the latest builds for everything where i could choose.

    Or any way i can check the DK or my own PCB being even accessible by my PC in some other way that doesn't need any other programs?
    I've tried both DK and mine with multiple USB cables to no avail.

    I'm completely at a loss here as to what I can do to make things work...

Children
Related