Nordic "nRF52840 Dongle" Support

Posted on
of 6
  • Figured it out: The dongle ships with a USB bootloader, located at the end of the flash. And the saved code area is defined right there. Details here

    Moved the saved code area a bit, and now everything seem to be working :)
    Board file and hex attached.

    (If I got the numbers right, but it's getting a bit late. Only tested with a small blinky code. Still, the 52840 has a ton of free flash, so moving the saved flash area is not a big deal)

    2 Attachments

  • Tested OK save().

    Compacting Flash...
    Calculating Size...
    Compressed 200000 bytes to 6294
      VERSION: "2v04.121",
      GIT_COMMIT: "572d768e",
      BOARD: "NRF52840DONGLE",
      FLASH: 1048576, RAM: 262144,
      SERIAL: "321d5edb-78df5aa8",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "etworkJS,neopixel",
      EXPTR: 536885656 }
  • Small update: I think solved the pin naming issue.
    Created alternate pin names like it's done with the NodeMCU pins. For example you P1.09 can be accessed as P1.p09. I think better than doing all the math to add 9 and 32 :)

    Or does anyone have a better idea for pin naming? P1.09 sort-of worked, but the autocomplete reported all kinds of weird ascii characters as properties. Espruino doesn't like properties starting with numbers, so decided to go with p as 'pin' prefix...

    @tcpipchip did you solve your pin naming problem?

    1 Attachment

  • I had aborted because was creating only a 800k size! I will test your version with new gpio map that you created! I will use on nina b302 :)

  • I tested the new version, thank you.

      VERSION: "2v04.160",
      GIT_COMMIT: "e4a306e3",
      BOARD: "NRF52840DONGLE",
      FLASH: 1048576, RAM: 262144,
      SERIAL: "321d5edb-78df5aa8",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "etworkJS,neopixel",
      EXPTR: 536885596 }
  • @AkosLukacs

    Can you map all pins ?

    For example, you forgot
    P0.p03´s working!

  • Only mapped the pins available on the Nordic Dongle. For example P0.03 is not accessible on it. Attached the spreadsheet I used to create the pin maps.

    But yes, I can map the rest of the pins, wanted to do that for the DK as that as all pins routed.

    1 Attachment

  • Nince @AkosLukacs

    Please, map them :)

    Thanks for all your help :)

  • wich are the default USART gpio txd / rxd used if i dont want USB serial ?

  • rx: p0.13 (d13)
    tx: p0.15 (d15)

  • Did you enable BLE in on your compile ?
    getting this error during my SCAN to BLE modules making advertising...

    1 Attachment

    • Sem título.png
  • The same error to

    var devices;
    NRF.findDevices(function(d) {
      devices = d;
    }, 1000);
    Uncaught Error: BLE error 0x6
     at line 38 col 8
    }, 1000);
    [  ]
    Uncaught Error: BLE error 0x8 (INVALID_STATE)
  • BLE is enabled, I can connect to the dongle via BLE & NUS.
    But the same command fails for me too. I can set up advertising, but can't send notifications.
    This is using a newer SDK version than the nRF52832 chips, and looks like there are missing things. :(

  • yes, that is a problem :(

    Maybe gordon can see that SCAN problem :(

  • That's a strange one - pretty sure I had stuff like that working just fine on the nRF52840 build. The only thing I knew was broken was setting the Scan Response data.

    I'm afraid I don't have time to look into that at the moment though

  • no problem! Verify when have time! 30 days is enough ? :)

  • Hello,

    good work on this! I ordered an makerdiary nRF52840 MDK USB Dongle (but own it not yet). Do you think this might work too?

    For a project I need the dongle to connect to a bluetooth device and act as an HID-USB-Device. Does the USBKeyboard-Module work? Do someone ever tested it?

    Thank you for your reply.

  • I have an MDK dongle, but so far I couldn't get either Espruino, or Nordic's official long-range demo to work.
    The official demo by makerdiary does work, and tried logitacker on it, that worked too.
    My latest theory is different bootloader, but haven't yet opened up to SWD erase the whole chip.

  • Hello,

    I tried to flash AkosLukacs's hex file from this page to my nrf52840 dongle using nrfutil:

    nrfutil pkg generate --hw-version 52 --sd-req 0 --application espruino_2v04.160_nrf52840_dongle.hex --application-version-string "2.4.0"
    nrfutil dfu usb-serial -pkg -p COM5 -b 115200

    it says that the device was programmed succesfully, but I can't connect to it (I do not see any BT device nor any COM port I can connect. the only port I see is the one I used for programming showing nRF52 SDFU USB (COM5))

    any hint what can be wrong ?

    thank your any advice...

  • I don't think you need to create a DFU package. I just used the nRF Connect application's programmer. AFAIK that just calls nrfjprog.
    I think you should try nRF Connect's gui, or just flash the hex with nrfjprog.

  • thank you, I was able to flash and connect using nrf connect!

  • I am new to all this, however I have been hacking various nrf5200 boards for a while. Anyone here used the Particle Debugger for $20.00 USD from Adafruit. It is fairly amazing, drag and drop .bin and .hex boot loading.

    Here is a long blog about what I was trying to do on PlatformIO

    Since I am new to the forum can someone summarize their experience with the NRF52840 USB dongle or similar with espruino? I have 3 of them.

  • You have to build the firmware yourself, but just built one two days ago, see the attached hex. The board file is above somewhere.
    Just plug it in a USB port, press the button to get into bootloader mode, and you can program it with Nordic's programmer.
    And start hacking. USB and BLE both work.

    1 Attachment

  • Any extra tricks. I can install your hex file. But my windows 10 computer does not seem to see the port unless I put it in bootloader mode, but then flashing does not work.. Chrome extension seems to work fine. Doesn't help that I haven't even used espruino before so not sure if I am doing anything really silly.

  • @k.zabloudil

    I am at the same step. Flashing bootloader seems fine. I think windows probably needs a driver. Will look a bit more.

    Just occurred to me that the problem is probably that I have never ran an official Espruino device. The driver that would normally install on first run is probably not installing. Will try that.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Nordic "nRF52840 Dongle" Support

Posted by Avatar for Stev @Stev