Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Everything nRF52840

Everything nRF52840

Scheduled Pinned Locked Moved Hardware
323 Posts 28 Posters 50.5k Views 33 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • RedferneR Redferne

    @NeverDie I never liked the Arduino IDE, so I think PlatformIO is next logical step, it is very easy to get going and it opens up for advanced usage. Your own choice of editor, has great debugging capabilities with VSCode integration.

    If you build the PCA10059 example I linked you should have GPIO (digital) access to all 47 pins. I've made it simple in the pca10059 variant so that D0 (0) is p0.00 -> D47 (47) is p1.15.

    Some external pins on the dongle which I have tested:
    Serial pins RX->P1.10, TX->P1.13
    I2C, TWIM, Wire on pins CLK->P0.29, SDA->P0.31
    SPI here MISO->P0.13, MOSI->P0.15, CLK->P0.17, CS->P0.22

    H Offline
    H Offline
    heinzv
    wrote on last edited by heinzv
    #134

    @redferne thanks for your effort spent to support nRF52840 for VS Code/Platform.io. I'll certaily give it a try. The good thing with platform.io is that it's easier to use/import existing arduino (ino) projects than in e.g. Segger Studio which only supports licensed J-Link flash/debug adapters.

    Two questions:
    1.) Does your "port" support also the 15.2 SDK features of the 840 (Softdevice S140, BLE 5.0 long range, ZigBee, Thread ...)
    2.) What flash method is supprted/used or you're using? Just plug the USB dongle in and it can be uploaded?

    Oh, a third question: If I use bare nrf840 Modules, what flash adapter/mode would you recommend or have you tested (I have the 840 DK board, a ST-Link v2 and a Balc Magic Probe adapter)?

    1 Reply Last reply
    0
    • NeverDieN Offline
      NeverDieN Offline
      NeverDie
      Hero Member
      wrote on last edited by
      #135

      @nc78 Earlier you had asked about vendors for the dongle. I found an alternative dongle that ships from China:
      https://www.tindie.com/products/Zelin/nrf52840-micro-dev-kit-usb-dongle/
      Price is very similar. I like it better than the Nordic dongle, because it exposes pins P0.06 and P0.08, which are used by the DK for UART communications.

      RedferneR Nca78N 2 Replies Last reply
      0
      • NeverDieN NeverDie

        @nc78 Earlier you had asked about vendors for the dongle. I found an alternative dongle that ships from China:
        https://www.tindie.com/products/Zelin/nrf52840-micro-dev-kit-usb-dongle/
        Price is very similar. I like it better than the Nordic dongle, because it exposes pins P0.06 and P0.08, which are used by the DK for UART communications.

        RedferneR Offline
        RedferneR Offline
        Redferne
        wrote on last edited by
        #136

        @heinzv

        1. It does use the S140 v6.1.0 Softdevice, however I have only "ported"/test the most basic SDK 15.2 BLE feature of @sandeepmistry BLEPheriphal BLEPeripheral. The example shows as BLEService and Read/Writeable BLECharCharacteristic used to toggling the onboard LED. I was hoping we could get more developers involved and "port" the missing pieces, if there's interrest. My main focus was just to get something Arduino-like running using PlatformIO build system on the cheap (~$10) NRF52840 dongle.

        2. I have tested Black Magic Probe (Bluepill) and JLink Mini on the PCA10059 with great success. It also possible to use the nrfutil to create a dfu.zip. The Nordic Open DFU Bootloader (which is pre-flashed on PCA10059) allows easy programming without soldering, just plug-in USB.

        First get and install the nrfutil from here

        1. Linux environment example, first build the PCA10059 example project:
        pio run -e ble
        
        1. Generate a dfu.zip including the softdevice:
        nrfutil pkg generate --hw-version 52 --debug-mode --sd-req 0x00 --sd-id 0xAE --application .pioenvs/ble/userfirmware.hex --softdevice ~/.platformio/packages/framework-arduinonordicnrf5/cores/nRF5/SDK/components/softdevice/s140/hex/s140_nrf52_6.1.0_softdevice.hex dfu.zip
        
        1. Plugin the PCA10059 dongle in a USB port. Make sure that the Bootloader is executing by checking the RED led, should be "breathing". Else press the reset button. Now flash the new firmware, here the dongle was enumerated as ACM3.
        nrfutil dfu usb-serial --package dfu.zip --port /dev/ttyACM3
        

        ... and Bob's your uncle :smile_cat:

        H 2 Replies Last reply
        3
        • NeverDieN NeverDie

          @nc78 Earlier you had asked about vendors for the dongle. I found an alternative dongle that ships from China:
          https://www.tindie.com/products/Zelin/nrf52840-micro-dev-kit-usb-dongle/
          Price is very similar. I like it better than the Nordic dongle, because it exposes pins P0.06 and P0.08, which are used by the DK for UART communications.

          Nca78N Offline
          Nca78N Offline
          Nca78
          Hardware Contributor
          wrote on last edited by
          #137

          @neverdie said in Everything nRF52840:

          @nc78 Earlier you had asked about vendors for the dongle. I found an alternative dongle that ships from China:
          https://www.tindie.com/products/Zelin/nrf52840-micro-dev-kit-usb-dongle/
          Price is very similar. I like it better than the Nordic dongle, because it exposes pins P0.06 and P0.08, which are used by the DK for UART communications.

          Thank you for the link, it looks like an interesting dongle. But after asking for a quote at Arrows and giving up (looked like a big mess to get items shipped here as it cannot be included in another order and they would only deliver in US), I realized that they now have them in stock.
          So I bought 2 at 9.5$ each + 12% discount on the website, so less than 8.5$ each and as I bought other items (including BT840 modules) I have free express shipping too. Cheapest price + free express shipping, I think it's called "having it both ways" ;) So I'll be able to join the little nrf52840 club next week.

          1 Reply Last reply
          1
          • RedferneR Redferne

            @heinzv

            1. It does use the S140 v6.1.0 Softdevice, however I have only "ported"/test the most basic SDK 15.2 BLE feature of @sandeepmistry BLEPheriphal BLEPeripheral. The example shows as BLEService and Read/Writeable BLECharCharacteristic used to toggling the onboard LED. I was hoping we could get more developers involved and "port" the missing pieces, if there's interrest. My main focus was just to get something Arduino-like running using PlatformIO build system on the cheap (~$10) NRF52840 dongle.

            2. I have tested Black Magic Probe (Bluepill) and JLink Mini on the PCA10059 with great success. It also possible to use the nrfutil to create a dfu.zip. The Nordic Open DFU Bootloader (which is pre-flashed on PCA10059) allows easy programming without soldering, just plug-in USB.

            First get and install the nrfutil from here

            1. Linux environment example, first build the PCA10059 example project:
            pio run -e ble
            
            1. Generate a dfu.zip including the softdevice:
            nrfutil pkg generate --hw-version 52 --debug-mode --sd-req 0x00 --sd-id 0xAE --application .pioenvs/ble/userfirmware.hex --softdevice ~/.platformio/packages/framework-arduinonordicnrf5/cores/nRF5/SDK/components/softdevice/s140/hex/s140_nrf52_6.1.0_softdevice.hex dfu.zip
            
            1. Plugin the PCA10059 dongle in a USB port. Make sure that the Bootloader is executing by checking the RED led, should be "breathing". Else press the reset button. Now flash the new firmware, here the dongle was enumerated as ACM3.
            nrfutil dfu usb-serial --package dfu.zip --port /dev/ttyACM3
            

            ... and Bob's your uncle :smile_cat:

            H Offline
            H Offline
            heinzv
            wrote on last edited by
            #138

            @redferne wow and thanks again for your fast and complte/detailed answer.
            I like especially

            • that you already started to use/support softdevices S140 and thus BLE 5.0, thread and Zigbee is "potentially" available
            • that you also succesfully use Black Magic Probe, as I also wante to use it because it works in Arduino IDE and Platform.io and it supports also an UART Port to communicate (I also use Blue/Blackpill BMP's)

            It would be great if it would be posssible (if not already) to use BLE 5.0 with the long range feature (that is not supported by the older S132 or nRF52832). Zigbee would be also great. But not sure what of the features (for a reliable longer indoor range) would be usable from within the MySensors project (beside using the nRF52 as/with the nRF24 proticol).

            1 Reply Last reply
            0
            • U Offline
              U Offline
              Uhrheber
              wrote on last edited by
              #139

              One interesting thing I stumbled upon:

              https://github.com/insane-adding-machines/unicore-mx

              UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X

              Supports nRF51/52

              mtiutiuM NeverDieN 2 Replies Last reply
              0
              • U Uhrheber

                One interesting thing I stumbled upon:

                https://github.com/insane-adding-machines/unicore-mx

                UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X

                Supports nRF51/52

                mtiutiuM Offline
                mtiutiuM Offline
                mtiutiu
                Hardware Contributor
                wrote on last edited by
                #140
                This post is deleted!
                1 Reply Last reply
                0
                • U Uhrheber

                  One interesting thing I stumbled upon:

                  https://github.com/insane-adding-machines/unicore-mx

                  UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X

                  Supports nRF51/52

                  NeverDieN Offline
                  NeverDieN Offline
                  NeverDie
                  Hero Member
                  wrote on last edited by NeverDie
                  #141

                  @uhrheber said in Everything nRF52840:

                  One interesting thing I stumbled upon:

                  https://github.com/insane-adding-machines/unicore-mx

                  UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X

                  Supports nRF51/52

                  I looked at the link, but I can't figure out what problem it's solving. What's the headline on that?

                  1 Reply Last reply
                  1
                  • RedferneR Redferne

                    @heinzv

                    1. It does use the S140 v6.1.0 Softdevice, however I have only "ported"/test the most basic SDK 15.2 BLE feature of @sandeepmistry BLEPheriphal BLEPeripheral. The example shows as BLEService and Read/Writeable BLECharCharacteristic used to toggling the onboard LED. I was hoping we could get more developers involved and "port" the missing pieces, if there's interrest. My main focus was just to get something Arduino-like running using PlatformIO build system on the cheap (~$10) NRF52840 dongle.

                    2. I have tested Black Magic Probe (Bluepill) and JLink Mini on the PCA10059 with great success. It also possible to use the nrfutil to create a dfu.zip. The Nordic Open DFU Bootloader (which is pre-flashed on PCA10059) allows easy programming without soldering, just plug-in USB.

                    First get and install the nrfutil from here

                    1. Linux environment example, first build the PCA10059 example project:
                    pio run -e ble
                    
                    1. Generate a dfu.zip including the softdevice:
                    nrfutil pkg generate --hw-version 52 --debug-mode --sd-req 0x00 --sd-id 0xAE --application .pioenvs/ble/userfirmware.hex --softdevice ~/.platformio/packages/framework-arduinonordicnrf5/cores/nRF5/SDK/components/softdevice/s140/hex/s140_nrf52_6.1.0_softdevice.hex dfu.zip
                    
                    1. Plugin the PCA10059 dongle in a USB port. Make sure that the Bootloader is executing by checking the RED led, should be "breathing". Else press the reset button. Now flash the new firmware, here the dongle was enumerated as ACM3.
                    nrfutil dfu usb-serial --package dfu.zip --port /dev/ttyACM3
                    

                    ... and Bob's your uncle :smile_cat:

                    H Offline
                    H Offline
                    heinzv
                    wrote on last edited by
                    #142

                    @redferne I was trying to get your platform and board extention as wellas the BLE library added to platformio, but got stuck afetr many many hours and many attempts (too much to add all the problems in one post). I'm using platformio with Windows 10 (I guess you use it with Linux/Ubuntu and also with a couple of command line tools)

                    I was trying to install this two:
                    https://github.com/Redferne/arduino-nRF5
                    Redferne/arduino-BLEPeripheral

                    I was trying to build a couple of simple examples and also the

                    C:\users\internet.platformio\lib\BLEPeripheral\src\BLEBondStore.cpp:11:12: fatal error: nrf_soc.h: No such file or directory

                    and
                    C:\users\internet.platformio\lib\BLEPeripheral\src/BLEPeripheral.h:136:5: error: 'nRF52840' does not name a type; did you mean 'NRF52840'?

                    and all other following errors are probably the result of the above ones.

                    Any hints?

                    Another question: How to define/declare the usage of the S140 softdevice in the project?
                    Using the PlatformIO IDE, not the command line.

                    RedferneR 1 Reply Last reply
                    0
                    • NeverDieN Offline
                      NeverDieN Offline
                      NeverDie
                      Hero Member
                      wrote on last edited by
                      #143

                      As pointed out by @reinhold, here's a handy tool for programming your nRF52840 dongle, and possibly other nRF52 projects too:
                      alt text
                      https://www.tindie.com/products/ElectronutLabs/pogoprog-model-c-pogo-pin-programmer-swd-2-pack/

                      I think I'd like it better if it could somehow latch itself to the board, though, so that I could also get debugging information hands free without having to continually press the tool up against the board.

                      1 Reply Last reply
                      0
                      • H heinzv

                        @redferne I was trying to get your platform and board extention as wellas the BLE library added to platformio, but got stuck afetr many many hours and many attempts (too much to add all the problems in one post). I'm using platformio with Windows 10 (I guess you use it with Linux/Ubuntu and also with a couple of command line tools)

                        I was trying to install this two:
                        https://github.com/Redferne/arduino-nRF5
                        Redferne/arduino-BLEPeripheral

                        I was trying to build a couple of simple examples and also the

                        C:\users\internet.platformio\lib\BLEPeripheral\src\BLEBondStore.cpp:11:12: fatal error: nrf_soc.h: No such file or directory

                        and
                        C:\users\internet.platformio\lib\BLEPeripheral\src/BLEPeripheral.h:136:5: error: 'nRF52840' does not name a type; did you mean 'NRF52840'?

                        and all other following errors are probably the result of the above ones.

                        Any hints?

                        Another question: How to define/declare the usage of the S140 softdevice in the project?
                        Using the PlatformIO IDE, not the command line.

                        RedferneR Offline
                        RedferneR Offline
                        Redferne
                        wrote on last edited by
                        #144

                        @heinzv I'm sorry if I was unclear. I have only updated and tested one example which is the PCA10059 It should build without errors, but you might need to specify build type as "ble" or "dongle" as per the readme.

                        To enable the NRF52840 support use these flags:

                        -DNRF52 -DNRF52840 -DNRF52840_XXAA
                        

                        and if building with the BLE Peripheral library and Softdevice S140 add:

                        -DNRF52 -DNRF52840 -DNRF52840_XXAA -DNRF52_S140
                        
                        1 Reply Last reply
                        0
                        • NeverDieN Offline
                          NeverDieN Offline
                          NeverDie
                          Hero Member
                          wrote on last edited by
                          #145

                          I have basic radio code now working in micropython: https://github.com/rabbithat/micropython_nRF52840/blob/master/README.md

                          So, I'm inching closer toward being able to do OTA code updates. :smiley:

                          1 Reply Last reply
                          3
                          • alowhumA Offline
                            alowhumA Offline
                            alowhum
                            Plugin Developer
                            wrote on last edited by
                            #146

                            @neverdie Does this also mean we're slightly closer to a MySensors implementation in MicroPython?

                            NeverDieN 1 Reply Last reply
                            0
                            • alowhumA alowhum

                              @neverdie Does this also mean we're slightly closer to a MySensors implementation in MicroPython?

                              NeverDieN Offline
                              NeverDieN Offline
                              NeverDie
                              Hero Member
                              wrote on last edited by
                              #147

                              @alowhum said in Everything nRF52840:

                              @neverdie Does this also mean we're slightly closer to a MySensors implementation in MicroPython?

                              Theoretically. ;)

                              1 Reply Last reply
                              1
                              • NeverDieN Offline
                                NeverDieN Offline
                                NeverDie
                                Hero Member
                                wrote on last edited by NeverDie
                                #148

                                By the way, I have it now to where you can send long strings (up to 255 characters if so desired) in a single packet from one node to another using micropython: https://github.com/rabbithat/Micropython_nRF52840_send

                                So, it's starting to get useful. I expect OTA code updates should be within range fairly soon. Since it's all written in micropython, I'll be able OTA update even the radio code as well, which is slick. :sunglasses:

                                1 Reply Last reply
                                2
                                • alowhumA Offline
                                  alowhumA Offline
                                  alowhum
                                  Plugin Developer
                                  wrote on last edited by
                                  #149

                                  Very cool!

                                  1 Reply Last reply
                                  0
                                  • NeverDieN Offline
                                    NeverDieN Offline
                                    NeverDie
                                    Hero Member
                                    wrote on last edited by NeverDie
                                    #150

                                    I have my first pass on nRF52840 OTA updates working with micropython. So, proof of concept works. :smile: I feel I should improve the code a bit before posting it though. I should probably add a hash function like MD5 or SHA256 to make sure the transmitted update is valid before making it go live.

                                    monteM O 2 Replies Last reply
                                    3
                                    • NeverDieN NeverDie

                                      I have my first pass on nRF52840 OTA updates working with micropython. So, proof of concept works. :smile: I feel I should improve the code a bit before posting it though. I should probably add a hash function like MD5 or SHA256 to make sure the transmitted update is valid before making it go live.

                                      monteM Offline
                                      monteM Offline
                                      monte
                                      wrote on last edited by
                                      #151

                                      @neverdie YAY for transport-agnostic mysensors-python-edition!

                                      1 Reply Last reply
                                      2
                                      • NeverDieN NeverDie

                                        I have my first pass on nRF52840 OTA updates working with micropython. So, proof of concept works. :smile: I feel I should improve the code a bit before posting it though. I should probably add a hash function like MD5 or SHA256 to make sure the transmitted update is valid before making it go live.

                                        O Offline
                                        O Offline
                                        Omemanti
                                        wrote on last edited by
                                        #152

                                        @neverdie would this also be usable for the nrf52832? (Not asking for an ETA here :))

                                        1 Reply Last reply
                                        0
                                        • WormholeW Offline
                                          WormholeW Offline
                                          Wormhole
                                          wrote on last edited by
                                          #153

                                          Hi,

                                          I've recently purchased a couple of the nrf52840 dongles and was searching web for ways to flash them and came across this post. I am a complete NOOB with this stuff, so I've found the information here really useful, so thanks to all who have contributed.

                                          During my searches, I can across this; HOME SMART MESH (https://www.homesmartmesh.com/). It seems very similar to what MySensors is doing, but geared towards nrf5 hardware. Was wondering if you had seem this before, or had any thoughts on the project re: pros and cons?

                                          H 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          14

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular