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. My Project
  3. nRF5 action!

nRF5 action!

Scheduled Pinned Locked Moved My Project
1.9k Posts 49 Posters 631.4k Views 44 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.
  • NeverDieN Offline
    NeverDieN Offline
    NeverDie
    Hero Member
    wrote on last edited by NeverDie
    #373

    You would think that the programmer device would just do a mass erase as part of its standard procedure, though, so it's a bit odd that it would require me to do it manually. The mass erase that Roger Clark did with his Black Magic Probe seemed nearly instant. I don't have a Black Magic Probe though.

    In any case, I can't use the above sketch to do ia mass erase because it presumes I can already load a sketch onto the target--i.e. it presumes the fundamental problem is solved already.

    What's the preferred way to do a mass erase? I seem to remember seeing a mass erase as an option in one of the Nordic utility softwares, but I don't recall now which one. Anyone happen to know?

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

      Looking further into it, what I may need to first do is UNLOCK the Ebyte module, which appears to be a separate step from mass erasing: https://mcuoneclipse.com/2014/10/05/unlocking-and-erasing-flash-with-segger-j-link/

      T 1 Reply Last reply
      0
      • NeverDieN NeverDie

        Looking further into it, what I may need to first do is UNLOCK the Ebyte module, which appears to be a separate step from mass erasing: https://mcuoneclipse.com/2014/10/05/unlocking-and-erasing-flash-with-segger-j-link/

        T Offline
        T Offline
        Toyman
        wrote on last edited by
        #375

        @NeverDie may be some hints here:
        https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/flashing-the-bootloader

        And also pay attention to their Adalink tool. The support for nrf52 was added recently.

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

          By switching to a Windows 10 computer, I was able to get J-link working over USB from windows. Then I opened up J-Link Command, which mostly utiizes a command line interface. It turns out that for unlocking, the nRF52836 is not on the list of devices (see below), so I simply then issued a mass erase command, which looks as though it may have worked:

          J-Link>unlock
          Syntax: unlock <DeviceName>
          ---Supported devices---
            LM3Sxxx [<Auto>]
            Kinetis
            EFM32Gxxx
            LPC5460x
          J-Link>erase
          Erasing device (nRF52832_xxAA)...
          J-Link: Flash download: Total time needed: 0.336s (Prepare: 0.064s, Compare: 0.000s, Erase: 0.263s, Program: 0.000s, Verify: 0.000s, Restore: 0.008s)
          Erasing done.
          J-Link>mem 0 100
          00000000 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000010 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000020 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000030 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000040 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000050 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000060 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000070 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000080 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          00000090 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          000000A0 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          000000B0 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          000000C0 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          000000D0 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          000000E0 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          000000F0 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
          J-Link>
          

          :)

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

            I received the following message from the Ebyte seller:

            Sorry that the two files are incorrect, please just ignore or delete them.
            We will send correct files later.
            
            Thank you!
            
            M 1 Reply Last reply
            0
            • NeverDieN Offline
              NeverDieN Offline
              NeverDie
              Hero Member
              wrote on last edited by NeverDie
              #378

              It worked! After doing the above mass erase, the nRF52832 Ebyte Module successfully programmed from the NRF52 DK. I uploaded the mysensors lightsensor sketch, and the serialGateway running on the NRF52 DK is receiving its messages. :)

              Many thanks to mfalkvidd for his mass erase suggestion and for his link to the Roger Clark youtube video, which had further mass erase commentary.

              Also, many thanks to d00616 for his excellent guide:
              https://www.openhardware.io/view/376/MySensors-NRF5-Platform
              Without that, I would have been lost on how to set anything up.

              Thanks to everyone else too who made comments and suggestions. This has been a great group effort with a successful outcome. :) :) :)

              T 1 Reply Last reply
              4
              • NeverDieN NeverDie

                It worked! After doing the above mass erase, the nRF52832 Ebyte Module successfully programmed from the NRF52 DK. I uploaded the mysensors lightsensor sketch, and the serialGateway running on the NRF52 DK is receiving its messages. :)

                Many thanks to mfalkvidd for his mass erase suggestion and for his link to the Roger Clark youtube video, which had further mass erase commentary.

                Also, many thanks to d00616 for his excellent guide:
                https://www.openhardware.io/view/376/MySensors-NRF5-Platform
                Without that, I would have been lost on how to set anything up.

                Thanks to everyone else too who made comments and suggestions. This has been a great group effort with a successful outcome. :) :) :)

                T Offline
                T Offline
                Toyman
                wrote on last edited by
                #379

                @NeverDie wow!!! Will you write a short tutorial? Is mas erase needed for EVERY time the sketch is uploaded?

                NeverDieN 1 Reply Last reply
                0
                • Nca78N Offline
                  Nca78N Offline
                  Nca78
                  Hardware Contributor
                  wrote on last edited by
                  #380

                  That's great news @NeverDie, thank you for your efforts and thank you also to everyone who helped !
                  My modules will arrive tomorrow or on Wednesday and you have saved me hours of suffering :D

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

                    Just now did a very quick range test, and the Ebyte nRF52832 module seems roughly comparable to the nRF52 DK for range. i.e. much better than the Adafruit nRF52832 Feather and also much better than the non-amplified nRF24L01+'s. So, whew! What a relief that is. At least for me, that means I won't need to wait for the nRF52840.

                    So, now the next question is whether the Ebyte nRF52832 can be made to run in DCDC mode, instead of LDO mode, to make it more suited for battery operation. At the moment, I'm not even sure how big or small a power savings that would equate to. Anyone know?

                    d00616D 1 Reply Last reply
                    0
                    • NeverDieN NeverDie

                      Just now did a very quick range test, and the Ebyte nRF52832 module seems roughly comparable to the nRF52 DK for range. i.e. much better than the Adafruit nRF52832 Feather and also much better than the non-amplified nRF24L01+'s. So, whew! What a relief that is. At least for me, that means I won't need to wait for the nRF52840.

                      So, now the next question is whether the Ebyte nRF52832 can be made to run in DCDC mode, instead of LDO mode, to make it more suited for battery operation. At the moment, I'm not even sure how big or small a power savings that would equate to. Anyone know?

                      d00616D Offline
                      d00616D Offline
                      d00616
                      Contest Winner
                      wrote on last edited by
                      #382

                      @NeverDie said in nRF5 Bluetooth action!:

                      So, now the next question is whether the Ebyte nRF52832 can be made to run in DCDC mode, instead of LDO mode, to make it more suited for battery operation. However, at the moment, I'm not even sure how big or small a power savings that would equate to. Anyone know?

                      There is no DCDC support for ESB radio at the moment. The DCDC mode is only efficient on high current states, like enabled radio and should only enabled in an defined voltage range.

                      1 Reply Last reply
                      1
                      • T Toyman

                        @NeverDie wow!!! Will you write a short tutorial? Is mas erase needed for EVERY time the sketch is uploaded?

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

                        @Toyman said in nRF5 Bluetooth action!:

                        Is mas erase needed for EVERY time the sketch is uploaded?

                        Roger Clark says not. I can't say for sure yet, as I haven't yet tried. I think the answer will probably turn out to be that if you aren't doing anything to specifically protect certain flash memory locations after programming it, then you would only need to do it once to undo and erase whatever came on the chip from the factory.

                        1 Reply Last reply
                        0
                        • scalzS Offline
                          scalzS Offline
                          scalz
                          Hardware Contributor
                          wrote on last edited by scalz
                          #384

                          @NeverDie
                          like said above DCDC needs to be enabled. Then, the mcu will automatically switch between LDO mode (for light loads) and DCDC mode for higher currents loads like when mcu is wake up, or during radio comms etc.. Can be interesting in some cases.
                          in datasheet, DCDC mode can divide by two mcu power consumption. Side effects could be -1dB sensitivity, so it's better to filter well by using two inductors (see ref design)

                          1 Reply Last reply
                          2
                          • d00616D Offline
                            d00616D Offline
                            d00616
                            Contest Winner
                            wrote on last edited by
                            #385

                            I have found a simple way to mass erase the MCU. Select "None" as SoftDevice and use the "Burn Bootloader" function. There is an error generated but the device is erased.

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

                              @mtiutiu said in nRF5 Bluetooth action!:

                              I'm going to try this one too when I have time wt51822-s4at

                              I used your link to order some of those modules just now. They're so small and cheap that they might be nice for simple things.

                              With the Ebyte module now working, I'm feeling emboldened again. :)

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

                                Which nRF52832 pins do I use for the mysensors implementation of UART Tx and Rx on the nRF52832? When I looked in Nordic's nRF52832 datasheet (http://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.3.pdf), I didn't see any pins specifically assigned/reserved for that purpose.

                                1 Reply Last reply
                                0
                                • scalzS Offline
                                  scalzS Offline
                                  scalz
                                  Hardware Contributor
                                  wrote on last edited by scalz
                                  #388

                                  by default nrf52dk is RX(24) and TX(25).
                                  for adafruit, i have not installed the board..but you can check in adafruit howto (or in their variant files).

                                  Peripherals are not fixed, that's a big advantage vs simple 8bits mcu. You define them when doing your design (sometimes it may need some checks in datasheet, depends on mcu).

                                  So, for your ebyte module your options are:

                                  • create a new board for the board manager (see variant files) regarding a specific design.
                                  • or you don't care of this for the moment, and you can simply use nrf52dk board and use the same mapping.
                                  • or, in the same order, use adafruit board and their mapping (or sparkfun board etc.., no matter, just check their board map pictures )
                                  d00616D NeverDieN 3 Replies Last reply
                                  1
                                  • scalzS scalz

                                    by default nrf52dk is RX(24) and TX(25).
                                    for adafruit, i have not installed the board..but you can check in adafruit howto (or in their variant files).

                                    Peripherals are not fixed, that's a big advantage vs simple 8bits mcu. You define them when doing your design (sometimes it may need some checks in datasheet, depends on mcu).

                                    So, for your ebyte module your options are:

                                    • create a new board for the board manager (see variant files) regarding a specific design.
                                    • or you don't care of this for the moment, and you can simply use nrf52dk board and use the same mapping.
                                    • or, in the same order, use adafruit board and their mapping (or sparkfun board etc.., no matter, just check their board map pictures )
                                    d00616D Offline
                                    d00616D Offline
                                    d00616
                                    Contest Winner
                                    wrote on last edited by
                                    #389

                                    @scalz said in nRF5 Bluetooth action!:

                                    So, for your ebyte module your options are:

                                    I working on the fourth option, I publish soon:

                                    • Define the pin mapping in your sketch, then its part of your code

                                    Like @scalz has written. Place the MCU in your layout and define the pin mapping later. Exceptions are analog pins, comparator pins , NFC pins, reset... The pins are documented in Infocenter: Pin assignments Please look at the "GPIO usage restrictions" chapter too.

                                    1 Reply Last reply
                                    3
                                    • NeverDieN NeverDie

                                      @mtiutiu said in nRF5 Bluetooth action!:

                                      I'm going to try this one too when I have time wt51822-s4at

                                      I used your link to order some of those modules just now. They're so small and cheap that they might be nice for simple things.

                                      With the Ebyte module now working, I'm feeling emboldened again. :)

                                      mtiutiuM Offline
                                      mtiutiuM Offline
                                      mtiutiu
                                      Hardware Contributor
                                      wrote on last edited by mtiutiu
                                      #390

                                      @NeverDie

                                      For the ebyte nrf52832 based modules did you had to wire some external components? Are there some other requirements for it in order to work?

                                      Thanks.

                                      NeverDieN 1 Reply Last reply
                                      0
                                      • mtiutiuM mtiutiu

                                        @NeverDie

                                        For the ebyte nrf52832 based modules did you had to wire some external components? Are there some other requirements for it in order to work?

                                        Thanks.

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

                                        @mtiutiu said in nRF5 Bluetooth action!:

                                        @NeverDie

                                        For the ebyte nrf52832 based modules did you had to wire some external components? Are there some other requirements for it in order to work?

                                        Thanks.

                                        For proof of concept purposes, I had just 4 wires connected for programming: PWR, GND, SWDIO, and SWDCLK. After programming for range testing: just PWR and GND. I'll soon be adding UART Tx so that I can also read its serial console output.

                                        1 Reply Last reply
                                        0
                                        • scalzS scalz

                                          by default nrf52dk is RX(24) and TX(25).
                                          for adafruit, i have not installed the board..but you can check in adafruit howto (or in their variant files).

                                          Peripherals are not fixed, that's a big advantage vs simple 8bits mcu. You define them when doing your design (sometimes it may need some checks in datasheet, depends on mcu).

                                          So, for your ebyte module your options are:

                                          • create a new board for the board manager (see variant files) regarding a specific design.
                                          • or you don't care of this for the moment, and you can simply use nrf52dk board and use the same mapping.
                                          • or, in the same order, use adafruit board and their mapping (or sparkfun board etc.., no matter, just check their board map pictures )
                                          NeverDieN Offline
                                          NeverDieN Offline
                                          NeverDie
                                          Hero Member
                                          wrote on last edited by NeverDie
                                          #392

                                          @scalz
                                          Thanks for the explanation. I had been programming it as a "Generic nRF82832," and I don't know what that mapping is. However, I can just as easily pick one of the alternatives you listed, such as the D.K, to get a predictable pin mapping.

                                          @d00616
                                          Your idea of having the pin mapping be selectable within the sketch sounds great! A+. I'm really looking forward to that and hope that you can do it soon. It sounds much easier for noobs like me than having to futz about with finding/changing/installing other files, and maybe also making it easier to share with and/or borrow from other makers.

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


                                          21

                                          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