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. Development
  3. GUIDE - NRF5 / NRF51 / NRF52 for beginners

GUIDE - NRF5 / NRF51 / NRF52 for beginners

Scheduled Pinned Locked Moved Development
102 Posts 26 Posters 18.2k Views 26 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.
  • O Omemanti

    @ileneken3 Have you considered building a new gateway with a nrf52?
    You know now that the IDE is programming correctly. Try combining a ftdi and nrf52 to get a serial gateway.

    Also I would hook up the gateway and prototype board to a serial monitor. ( So both boards onto my PC)
    You can both monitor the node and the gateway directly from the RX and use https://www.mysensors.org/controller/myscontroller to act as controller.
    I find it handy to cut out things like domoticz when troubleshooting (the less variables the better)

    ileneken3I Offline
    ileneken3I Offline
    ileneken3
    wrote on last edited by
    #22

    @omemanti
    I was looking at the output of mysgw running on a Raspberry PI - so Domoticz is not really in the picture. But - your advise made me think I should try programming the chip on the development board directly before using an external one. And it works! I can see the registration of the Mysensors device.
    So I guess everything is OK in terms of IDE and Mysensors code, and there must be something wrong with my external board. I will have to try a different one, and/or look over the soldering.

    Happy Holidays!

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

      Just paste your hex file to the JLINK drive that appears when you connect your DK. That will handle the upload for you. It's as simple as that.

      ileneken3I 1 Reply Last reply
      0
      • NeverDieN NeverDie

        Just paste your hex file to the JLINK drive that appears when you connect your DK. That will handle the upload for you. It's as simple as that.

        ileneken3I Offline
        ileneken3I Offline
        ileneken3
        wrote on last edited by
        #24

        @neverdie
        Unfortunately, nothing is that simple - at least for me. I have gone in circles with the J-LINK drivers. In order to use the Arduino IDE for programming, you must use the WinUSB driver installed by Zadig. But if you do that, the nRFgo Studio no longer recognizes any J-LINK device. So I re-install RFgo Studio, and then I can't use the Arduino IDE anymore!

        But I can work around those issues, because everything programs and works right when programming the device on the NRF DK board. The problem is I can't do anything with the two external boards I tried. With one, I was able to unlock it with a "Recover" in nRFgo Studio, but the programming doesn't seem to cause the chip to do anything (nothing logged by the gateway). With the other, I can't unlock the board - it always says: "Recover failed: Unknown error".
        Both boards are E73 - but one is marked as E73-2G4M04S and the other is E73-2G4M04S1B.

        Any ideas?

        O NeverDieN 2 Replies Last reply
        0
        • ileneken3I ileneken3

          @neverdie
          Unfortunately, nothing is that simple - at least for me. I have gone in circles with the J-LINK drivers. In order to use the Arduino IDE for programming, you must use the WinUSB driver installed by Zadig. But if you do that, the nRFgo Studio no longer recognizes any J-LINK device. So I re-install RFgo Studio, and then I can't use the Arduino IDE anymore!

          But I can work around those issues, because everything programs and works right when programming the device on the NRF DK board. The problem is I can't do anything with the two external boards I tried. With one, I was able to unlock it with a "Recover" in nRFgo Studio, but the programming doesn't seem to cause the chip to do anything (nothing logged by the gateway). With the other, I can't unlock the board - it always says: "Recover failed: Unknown error".
          Both boards are E73 - but one is marked as E73-2G4M04S and the other is E73-2G4M04S1B.

          Any ideas?

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

          @ileneken3

          the difference between E73-2G4M04S and E73-2G4M04S1B is that the last one seems to be from a new batch. I got both, the only difference was that the last one I needed to recover and the other one (old) I only had to "burn bootloader".

          your problem with the Arduino IDE seems to have something to do with the Sandeep installation, see the comment of @Toyman: https://forum.mysensors.org/topic/6961/nrf5-action/1749

          1 Reply Last reply
          0
          • ileneken3I ileneken3

            @neverdie
            Unfortunately, nothing is that simple - at least for me. I have gone in circles with the J-LINK drivers. In order to use the Arduino IDE for programming, you must use the WinUSB driver installed by Zadig. But if you do that, the nRFgo Studio no longer recognizes any J-LINK device. So I re-install RFgo Studio, and then I can't use the Arduino IDE anymore!

            But I can work around those issues, because everything programs and works right when programming the device on the NRF DK board. The problem is I can't do anything with the two external boards I tried. With one, I was able to unlock it with a "Recover" in nRFgo Studio, but the programming doesn't seem to cause the chip to do anything (nothing logged by the gateway). With the other, I can't unlock the board - it always says: "Recover failed: Unknown error".
            Both boards are E73 - but one is marked as E73-2G4M04S and the other is E73-2G4M04S1B.

            Any ideas?

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

            @ileneken3 What I meant was just export your .hex file and then drop it on the virtual JLINK drive to do the chip programming, not try to burn it directly from the IDE. That way you only depend on the DK doing it's job, not on an arduino IDE, where some versions don't seem to work well. Anyhow, that's how I do it now, and, at least for me, it seems to work the most reliably.

            That said, I haven't tried the E73-2G4M04S1B, so can't really say regarding that one specifically. On the inside they should all be the same chip though, so I'm surprised to hear that it may have different requirements.

            These days I'm largely focused on the nRF52840 and driving it with Forth. Maybe later I may circle back to the 832.

            ileneken3I 1 Reply Last reply
            0
            • NeverDieN NeverDie

              @ileneken3 What I meant was just export your .hex file and then drop it on the virtual JLINK drive to do the chip programming, not try to burn it directly from the IDE. That way you only depend on the DK doing it's job, not on an arduino IDE, where some versions don't seem to work well. Anyhow, that's how I do it now, and, at least for me, it seems to work the most reliably.

              That said, I haven't tried the E73-2G4M04S1B, so can't really say regarding that one specifically. On the inside they should all be the same chip though, so I'm surprised to hear that it may have different requirements.

              These days I'm largely focused on the nRF52840 and driving it with Forth. Maybe later I may circle back to the 832.

              ileneken3I Offline
              ileneken3I Offline
              ileneken3
              wrote on last edited by
              #27

              @neverdie

              Yes, I understood what you meant. I will only do the "Export compiled Binary" from the IDE, and leave the drivers as J-Link commander or nrfGo Studio wants them.

              In: https://www.openhardware.io/view/376/MySensors-NRF5-Platform it says:
              "Currently, the nRF52832 and nRF51822 are supported so we recommend sticking with those for now."

              I noticed that my board: (E73-2G4M04S) is labeled "NRF52810". So is that why after programming it nothing works (nothing seen on gateway) :( ?

              If so, I messed up on that order.

              But I am also trying the E73 2G4M04S1B, which at least from the AliExpress order
              https://www.aliexpress.com/item/CDEBYTE-E73-2G4M04S-BLE-4-2-5-0-long-distance-100m-2-4GHz-SMD-ARM-Core/32820692238.html?spm=a2g0s.9042311.0.0.27424c4dSKBLn7

              says it is nRF52832. (It isn't labeled on the board though). For this module, I can't unlock it using "Recover" from nRfgoStudio. It always fails with a message "Recover failed: Unknown error".

              From the command line, if I do

              nrfjprog.exe -f NRF52 --recover --log

              and it comes back immediately with:

              Recovering device. This operation might take 30s.
              ERROR: Recover failed. Please make sure that the correct device family is given
              ERROR: and try again.

              The key error from the log seems to be:

              2018-Dec-27 12:25:22 . . . . . nRF52_power_debug_and_system_regions
              2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register
              2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
              2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register: JLink: returns -1
              2018-Dec-27 12:25:23 . . . . . . nRF52_write_debug_port_register: JLink: (0005ms, 0288ms total)
              2018-Dec-27 12:25:23 . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

              2018-Dec-27 12:25:23 . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

              If I do: nrfjprog.exe -f NRF51 --recover --log

              it actually makes LD5 on the DK board flash for 30 seconds, but still returns failure with the exact same message.

              Any other tricks for "recover/unlock" of those boards?

              Thanks!

              NeverDieN O 2 Replies Last reply
              0
              • ileneken3I ileneken3

                @neverdie

                Yes, I understood what you meant. I will only do the "Export compiled Binary" from the IDE, and leave the drivers as J-Link commander or nrfGo Studio wants them.

                In: https://www.openhardware.io/view/376/MySensors-NRF5-Platform it says:
                "Currently, the nRF52832 and nRF51822 are supported so we recommend sticking with those for now."

                I noticed that my board: (E73-2G4M04S) is labeled "NRF52810". So is that why after programming it nothing works (nothing seen on gateway) :( ?

                If so, I messed up on that order.

                But I am also trying the E73 2G4M04S1B, which at least from the AliExpress order
                https://www.aliexpress.com/item/CDEBYTE-E73-2G4M04S-BLE-4-2-5-0-long-distance-100m-2-4GHz-SMD-ARM-Core/32820692238.html?spm=a2g0s.9042311.0.0.27424c4dSKBLn7

                says it is nRF52832. (It isn't labeled on the board though). For this module, I can't unlock it using "Recover" from nRfgoStudio. It always fails with a message "Recover failed: Unknown error".

                From the command line, if I do

                nrfjprog.exe -f NRF52 --recover --log

                and it comes back immediately with:

                Recovering device. This operation might take 30s.
                ERROR: Recover failed. Please make sure that the correct device family is given
                ERROR: and try again.

                The key error from the log seems to be:

                2018-Dec-27 12:25:22 . . . . . nRF52_power_debug_and_system_regions
                2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register
                2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
                2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register: JLink: returns -1
                2018-Dec-27 12:25:23 . . . . . . nRF52_write_debug_port_register: JLink: (0005ms, 0288ms total)
                2018-Dec-27 12:25:23 . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

                2018-Dec-27 12:25:23 . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

                If I do: nrfjprog.exe -f NRF51 --recover --log

                it actually makes LD5 on the DK board flash for 30 seconds, but still returns failure with the exact same message.

                Any other tricks for "recover/unlock" of those boards?

                Thanks!

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

                @ileneken3 I suggest posting a query on the nordic devzone forum. A Nordic engineer will get assigned to it and give you an answer. I've tried this a few times, and I had good luck with it. Generally 24 hour turnaround on weekdays, and no answers on weekends. So, if you post it now, you may get an answer tomorrow. It's in Nordic's interest to help developers unlock these chips, and if there are any secrets to doing so, Nordic will certainly know them.

                It sounds as though once you get past the unlock issue, it will be easier for you.

                1 Reply Last reply
                0
                • ileneken3I ileneken3

                  @neverdie

                  Yes, I understood what you meant. I will only do the "Export compiled Binary" from the IDE, and leave the drivers as J-Link commander or nrfGo Studio wants them.

                  In: https://www.openhardware.io/view/376/MySensors-NRF5-Platform it says:
                  "Currently, the nRF52832 and nRF51822 are supported so we recommend sticking with those for now."

                  I noticed that my board: (E73-2G4M04S) is labeled "NRF52810". So is that why after programming it nothing works (nothing seen on gateway) :( ?

                  If so, I messed up on that order.

                  But I am also trying the E73 2G4M04S1B, which at least from the AliExpress order
                  https://www.aliexpress.com/item/CDEBYTE-E73-2G4M04S-BLE-4-2-5-0-long-distance-100m-2-4GHz-SMD-ARM-Core/32820692238.html?spm=a2g0s.9042311.0.0.27424c4dSKBLn7

                  says it is nRF52832. (It isn't labeled on the board though). For this module, I can't unlock it using "Recover" from nRfgoStudio. It always fails with a message "Recover failed: Unknown error".

                  From the command line, if I do

                  nrfjprog.exe -f NRF52 --recover --log

                  and it comes back immediately with:

                  Recovering device. This operation might take 30s.
                  ERROR: Recover failed. Please make sure that the correct device family is given
                  ERROR: and try again.

                  The key error from the log seems to be:

                  2018-Dec-27 12:25:22 . . . . . nRF52_power_debug_and_system_regions
                  2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register
                  2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
                  2018-Dec-27 12:25:22 . . . . . . nRF52_write_debug_port_register: JLink: returns -1
                  2018-Dec-27 12:25:23 . . . . . . nRF52_write_debug_port_register: JLink: (0005ms, 0288ms total)
                  2018-Dec-27 12:25:23 . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

                  2018-Dec-27 12:25:23 . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

                  If I do: nrfjprog.exe -f NRF51 --recover --log

                  it actually makes LD5 on the DK board flash for 30 seconds, but still returns failure with the exact same message.

                  Any other tricks for "recover/unlock" of those boards?

                  Thanks!

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

                  @ileneken3 sorry, can't help you anymore.

                  I can only tell that I installed the segger drivers, and everything as described by @d00616

                  Most issues I have, happen when I did some soldering wrong or when I've been messing around with drivers. A clean setup almost always solve my problems

                  I used both old and new ebyte modules and they work like a charm.0_1545943568844_IMG_20181227_213333.jpg
                  0_1545943598576_IMG_20181227_213249.jpg

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    Sancho119
                    wrote on last edited by
                    #30

                    Hi,

                    I'm trying to begin with nrf52832.
                    I have follow advice, with soldering 4 wires. I use STlink v2, downloading soft before use it.
                    When i try to erase the nrf52832, with sketch "mass_erase" in exemple, i have the following error :

                    Arduino : 1.8.7 (Windows 10), Carte : "MyBoardNRF5 nRF52832, None, Crystal Oscillator, Don't enable"

                    C:\Users\Sancho\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/stlink-v2.cfg -c transport select hla_swd; set WORKAREASIZE 0x4000; -f target/nrf52.cfg -c init; halt; nrf51 mass_erase; program {{{build.core.path}/SDK/components/softdevice/none/hex/none_nrf52_{softdeviceversion}_softdevice.hex}} verify reset; shutdown;
                    Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                    Licensed under GNU GPL v2
                    For bug reports, read
                    http://openocd.org/doc/doxygen/bugs.html
                    debug_level: 2
                    0x4000
                    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
                    adapter speed: 10000 kHz
                    Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                    Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                    Info : clock speed 4000 kHz
                    Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
                    Info : using stlink api v2
                    Info : Target voltage: 3.280426
                    Error: init mode failed (unable to connect to the target)
                    in procedure 'init'
                    in procedure 'ocd_bouncer'

                    Erreur lors de la gravure de la séquence d'initialisation.

                    I try to upload an empty sketch (MyBoardNRF5), and have this message :

                    Arduino : 1.8.7 (Windows 10), Carte : "MyBoardNRF5 nRF52832, None, Crystal Oscillator, Don't enable"

                    Le croquis utilise 10508 octets (2%) de l'espace de stockage de programmes. Le maximum est de 524288 octets.
                    C:\Users\Sancho\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/stlink-v2.cfg -c transport select hla_swd; set WORKAREASIZE 0x4000; -f target/nrf52.cfg -c program {{C:\Users\Sancho\AppData\Local\Temp\arduino_build_74329/MyBoardNRF5.ino.hex}} verify reset; shutdown;
                    Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                    Licensed under GNU GPL v2
                    For bug reports, read
                    http://openocd.org/doc/doxygen/bugs.html
                    debug_level: 2
                    0x4000
                    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
                    adapter speed: 10000 kHz
                    Une erreur est survenue lors du transfert du croquis
                    Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                    Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                    Info : clock speed 4000 kHz
                    Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
                    Info : using stlink api v2
                    Info : Target voltage: 3.280426
                    Error: init mode failed (unable to connect to the target)
                    in procedure 'program'
                    in procedure 'init' called at file "embedded:startup.tcl", line 473
                    in procedure 'ocd_bouncer'
                    ** OpenOCD init failed **
                    shutdown command invoked

                    Can you help me please ?

                    monteM 1 Reply Last reply
                    0
                    • S Sancho119

                      Hi,

                      I'm trying to begin with nrf52832.
                      I have follow advice, with soldering 4 wires. I use STlink v2, downloading soft before use it.
                      When i try to erase the nrf52832, with sketch "mass_erase" in exemple, i have the following error :

                      Arduino : 1.8.7 (Windows 10), Carte : "MyBoardNRF5 nRF52832, None, Crystal Oscillator, Don't enable"

                      C:\Users\Sancho\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/stlink-v2.cfg -c transport select hla_swd; set WORKAREASIZE 0x4000; -f target/nrf52.cfg -c init; halt; nrf51 mass_erase; program {{{build.core.path}/SDK/components/softdevice/none/hex/none_nrf52_{softdeviceversion}_softdevice.hex}} verify reset; shutdown;
                      Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                      Licensed under GNU GPL v2
                      For bug reports, read
                      http://openocd.org/doc/doxygen/bugs.html
                      debug_level: 2
                      0x4000
                      Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
                      adapter speed: 10000 kHz
                      Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                      Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                      Info : clock speed 4000 kHz
                      Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
                      Info : using stlink api v2
                      Info : Target voltage: 3.280426
                      Error: init mode failed (unable to connect to the target)
                      in procedure 'init'
                      in procedure 'ocd_bouncer'

                      Erreur lors de la gravure de la séquence d'initialisation.

                      I try to upload an empty sketch (MyBoardNRF5), and have this message :

                      Arduino : 1.8.7 (Windows 10), Carte : "MyBoardNRF5 nRF52832, None, Crystal Oscillator, Don't enable"

                      Le croquis utilise 10508 octets (2%) de l'espace de stockage de programmes. Le maximum est de 524288 octets.
                      C:\Users\Sancho\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/stlink-v2.cfg -c transport select hla_swd; set WORKAREASIZE 0x4000; -f target/nrf52.cfg -c program {{C:\Users\Sancho\AppData\Local\Temp\arduino_build_74329/MyBoardNRF5.ino.hex}} verify reset; shutdown;
                      Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                      Licensed under GNU GPL v2
                      For bug reports, read
                      http://openocd.org/doc/doxygen/bugs.html
                      debug_level: 2
                      0x4000
                      Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
                      adapter speed: 10000 kHz
                      Une erreur est survenue lors du transfert du croquis
                      Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                      Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                      Info : clock speed 4000 kHz
                      Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
                      Info : using stlink api v2
                      Info : Target voltage: 3.280426
                      Error: init mode failed (unable to connect to the target)
                      in procedure 'program'
                      in procedure 'init' called at file "embedded:startup.tcl", line 473
                      in procedure 'ocd_bouncer'
                      ** OpenOCD init failed **
                      shutdown command invoked

                      Can you help me please ?

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

                      @sancho119 what exact model of a board do you have? Did you try to switch SWDIO and SWCLK, maybe they are messed up? Or lose connection? To erase softdevice you can simply chose Tools>Softdevice>"None" and then press "Burn bootloader" button.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Sancho119
                        wrote on last edited by
                        #32

                        Hello
                        it's a E73 2G4M04S1B from EBYTE
                        When i switch SWDIO and SWCLK, i can see the led of STLink V2 changing from red to blue, but when i try to uplod empty sketch (MyBoardNRF5), i have this error :

                        C:\Users\Sancho\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/stlink-v2.cfg -c transport select hla_swd; set WORKAREASIZE 0x4000; -f target/nrf52.cfg -c program {{C:\Users\Sancho\AppData\Local\Temp\arduino_build_432557/MyBoardNRF5.ino.hex}} verify reset; shutdown;
                        Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                        Licensed under GNU GPL v2
                        For bug reports, read
                        http://openocd.org/doc/doxygen/bugs.html
                        debug_level: 2
                        0x4000
                        Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
                        adapter speed: 10000 kHz
                        Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                        Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                        Info : clock speed 4000 kHz
                        Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
                        Info : using stlink api v2
                        Info : Target voltage: 3.283200
                        Info : nrf52.cpu: hardware has 0 breakpoints, 2 watchpoints
                        Error: timed out while waiting for target halted
                        TARGET: nrf52.cpu - Not halted
                        in procedure 'program'
                        in procedure 'reset' called at file "embedded:startup.tcl", line 478
                        in procedure 'ocd_bouncer'

                        embedded:startup.tcl:454: Error: ** Unable to reset target **
                        in procedure 'program'
                        in procedure 'program_error' called at file "embedded:startup.tcl", line 479
                        at file "embedded:startup.tcl", line 454
                        le port série sélectionné at file "embedded:startup.tcl", line 454
                        n'existe pas ou votre Arduino n'est pas connectée

                        N 1 Reply Last reply
                        0
                        • S Sancho119

                          Hello
                          it's a E73 2G4M04S1B from EBYTE
                          When i switch SWDIO and SWCLK, i can see the led of STLink V2 changing from red to blue, but when i try to uplod empty sketch (MyBoardNRF5), i have this error :

                          C:\Users\Sancho\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/stlink-v2.cfg -c transport select hla_swd; set WORKAREASIZE 0x4000; -f target/nrf52.cfg -c program {{C:\Users\Sancho\AppData\Local\Temp\arduino_build_432557/MyBoardNRF5.ino.hex}} verify reset; shutdown;
                          Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                          Licensed under GNU GPL v2
                          For bug reports, read
                          http://openocd.org/doc/doxygen/bugs.html
                          debug_level: 2
                          0x4000
                          Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
                          adapter speed: 10000 kHz
                          Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                          Info : Unable to match requested speed 10000 kHz, using 4000 kHz
                          Info : clock speed 4000 kHz
                          Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
                          Info : using stlink api v2
                          Info : Target voltage: 3.283200
                          Info : nrf52.cpu: hardware has 0 breakpoints, 2 watchpoints
                          Error: timed out while waiting for target halted
                          TARGET: nrf52.cpu - Not halted
                          in procedure 'program'
                          in procedure 'reset' called at file "embedded:startup.tcl", line 478
                          in procedure 'ocd_bouncer'

                          embedded:startup.tcl:454: Error: ** Unable to reset target **
                          in procedure 'program'
                          in procedure 'program_error' called at file "embedded:startup.tcl", line 479
                          at file "embedded:startup.tcl", line 454
                          le port série sélectionné at file "embedded:startup.tcl", line 454
                          n'existe pas ou votre Arduino n'est pas connectée

                          N Offline
                          N Offline
                          ncollins
                          wrote on last edited by
                          #33

                          @sancho119 No matter what I tried, I could not unlock the E73 with the STLink.

                          I had to buy a jlink clone, download a bunch of segger debugging tools, use the segger tools to override the lock flag. After that I could flash the bootloader.

                          https://github.com/micooke/arduino-nRF5-smartwatches/blob/master/nrf52_disable_read_protection.txt

                          #To share my experience with the nRF52832.
                          #I was unable to disable the read protection / flash lock with a BMP or ST-Link V2, but i was successful with a J-Link.
                          
                          #When nRF52832 chip is read protected / locked, the first step is to try:
                          nrfjprog –recover -f nrf52
                          
                          #This performs the same task as:
                          Jlink -if swd -device nrf52
                          J-Link>SWDSelect
                          J-Link>SWDWriteDP 1, 0x50000000
                          J-Link>SWDWriteDP 2, 0x01000000
                          J-Link>SWDWriteAP 1, 0x00000001
                          
                          #Wait until AP 2 is 0, and the operation is complete
                          J-Link>SWDReadAP 2
                          
                          #If two successive reads from AP 3 produce 0, then 1 then protection is disabled
                          J-Link>SWDReadAP 3
                          J-Link>SWDReadAP 3
                          
                          #Tested with JLink v6.20b
                          
                          monteM 1 Reply Last reply
                          0
                          • N ncollins

                            @sancho119 No matter what I tried, I could not unlock the E73 with the STLink.

                            I had to buy a jlink clone, download a bunch of segger debugging tools, use the segger tools to override the lock flag. After that I could flash the bootloader.

                            https://github.com/micooke/arduino-nRF5-smartwatches/blob/master/nrf52_disable_read_protection.txt

                            #To share my experience with the nRF52832.
                            #I was unable to disable the read protection / flash lock with a BMP or ST-Link V2, but i was successful with a J-Link.
                            
                            #When nRF52832 chip is read protected / locked, the first step is to try:
                            nrfjprog –recover -f nrf52
                            
                            #This performs the same task as:
                            Jlink -if swd -device nrf52
                            J-Link>SWDSelect
                            J-Link>SWDWriteDP 1, 0x50000000
                            J-Link>SWDWriteDP 2, 0x01000000
                            J-Link>SWDWriteAP 1, 0x00000001
                            
                            #Wait until AP 2 is 0, and the operation is complete
                            J-Link>SWDReadAP 2
                            
                            #If two successive reads from AP 3 produce 0, then 1 then protection is disabled
                            J-Link>SWDReadAP 3
                            J-Link>SWDReadAP 3
                            
                            #Tested with JLink v6.20b
                            
                            monteM Offline
                            monteM Offline
                            monte
                            wrote on last edited by
                            #34

                            @ncollins have you tried this: https://github.com/AndruPol/nrf52832-recover ?

                            1 Reply Last reply
                            0
                            • N Offline
                              N Offline
                              ncollins
                              wrote on last edited by
                              #35

                              At the time, I did not have a BMP or any STM32 capable of being flashed as a programmer.

                              I figured the jlink clone might be useful in the future, but I definitely think the BMP / diy programmer is the way I would have gone if I had one sitting around.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                Sancho119
                                wrote on last edited by
                                #36

                                @ncollins
                                @monte
                                thx for these advices.
                                I think i will try with BMP clone (STM32F103C8T6), cheaper than J-link (i must only wait 1 month to have it, buying it in china...)
                                is it possible to erase E73 with BMP in win10 ?

                                1 Reply Last reply
                                0
                                • berkseoB Offline
                                  berkseoB Offline
                                  berkseo
                                  wrote on last edited by berkseo
                                  #37

                                  https://translate.google.ru/translate?sl=auto&tl=en&u=http%3A%2F%2Fmysensors.ru%2Fforum%2Fviewtopic.php%3Ff%3D5%26t%3D456

                                  https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRFgo-Studio/Download#infotabs

                                  1 Reply Last reply
                                  1
                                  • S Offline
                                    S Offline
                                    Sancho119
                                    wrote on last edited by
                                    #38

                                    Hello,

                                    Some news !
                                    i buy a Jlink, and success in erase my nrf52832 with nrf prog, using method of berkseo.

                                    Next i try to upload a basic sketch (blink) :

                                    #define MY_RADIO_NRF5_ESB
                                    #include <nrf.h>
                                    #include <MySensors.h>

                                    void setup() {
                                    Serial.begin(9600);
                                    hwPinMode(LED_BUILTIN,OUTPUT_H0H1);
                                    }

                                    void loop() {
                                    digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
                                    delay(1000); // wait for a second
                                    digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
                                    delay(1000); // wait for a second
                                    }

                                    I have this :

                                    Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                                    Licensed under GNU GPL v2
                                    For bug reports, read
                                    http://openocd.org/doc/doxygen/bugs.html
                                    debug_level: 2
                                    0
                                    adapter speed: 10000 kHz
                                    cortex_m reset_config sysresetreq
                                    Info : No device selected, using first device.
                                    Info : J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
                                    Info : Hardware version: 7.00
                                    Info : VTarget = 3.300 V
                                    Info : clock speed 10000 kHz
                                    Info : SWD IDCODE 0x2ba01477
                                    Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
                                    nrf52.cpu: target state: halted
                                    target halted due to debug-request, current mode: Thread
                                    xPSR: 0x01000000 pc: 0x0000051c msp: 0x20010000
                                    ** Programming Started **
                                    auto erase enabled
                                    Warn : Unknown device (HWID 0x00000139)
                                    Warn : not enough working area available(requested 32)
                                    Warn : no working area available, falling back to slow memory writes
                                    wrote 12288 bytes from file C:\Users\Sancho\AppData\Local\Temp\arduino_build_76789/NRF5_blink_led8.ino.hex in 4.155332s (2.888 KiB/s)
                                    ** Programming Finished **
                                    ** Verify Started **
                                    Warn : not enough working area available(requested 52)
                                    verified 10812 bytes in 0.165932s (63.632 KiB/s)
                                    ** Verified OK **
                                    ** Resetting Target **
                                    shutdown command invoked

                                    I think its good, but when i put a led with a resistance on P0.08, nothing :(

                                    could you help me more ?

                                    T 1 Reply Last reply
                                    0
                                    • S Sancho119

                                      Hello,

                                      Some news !
                                      i buy a Jlink, and success in erase my nrf52832 with nrf prog, using method of berkseo.

                                      Next i try to upload a basic sketch (blink) :

                                      #define MY_RADIO_NRF5_ESB
                                      #include <nrf.h>
                                      #include <MySensors.h>

                                      void setup() {
                                      Serial.begin(9600);
                                      hwPinMode(LED_BUILTIN,OUTPUT_H0H1);
                                      }

                                      void loop() {
                                      digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
                                      delay(1000); // wait for a second
                                      digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
                                      delay(1000); // wait for a second
                                      }

                                      I have this :

                                      Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                                      Licensed under GNU GPL v2
                                      For bug reports, read
                                      http://openocd.org/doc/doxygen/bugs.html
                                      debug_level: 2
                                      0
                                      adapter speed: 10000 kHz
                                      cortex_m reset_config sysresetreq
                                      Info : No device selected, using first device.
                                      Info : J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
                                      Info : Hardware version: 7.00
                                      Info : VTarget = 3.300 V
                                      Info : clock speed 10000 kHz
                                      Info : SWD IDCODE 0x2ba01477
                                      Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
                                      nrf52.cpu: target state: halted
                                      target halted due to debug-request, current mode: Thread
                                      xPSR: 0x01000000 pc: 0x0000051c msp: 0x20010000
                                      ** Programming Started **
                                      auto erase enabled
                                      Warn : Unknown device (HWID 0x00000139)
                                      Warn : not enough working area available(requested 32)
                                      Warn : no working area available, falling back to slow memory writes
                                      wrote 12288 bytes from file C:\Users\Sancho\AppData\Local\Temp\arduino_build_76789/NRF5_blink_led8.ino.hex in 4.155332s (2.888 KiB/s)
                                      ** Programming Finished **
                                      ** Verify Started **
                                      Warn : not enough working area available(requested 52)
                                      verified 10812 bytes in 0.165932s (63.632 KiB/s)
                                      ** Verified OK **
                                      ** Resetting Target **
                                      shutdown command invoked

                                      I think its good, but when i put a led with a resistance on P0.08, nothing :(

                                      could you help me more ?

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

                                      @sancho119 said in GUIDE - NRF5 / NRF51 / NRF52 for beginners:

                                      Hello,

                                      Some news !
                                      i buy a Jlink, and success in erase my nrf52832 with nrf prog, using method of berkseo.

                                      Next i try to upload a basic sketch (blink) :

                                      #define MY_RADIO_NRF5_ESB
                                      #include <nrf.h>
                                      #include <MySensors.h>

                                      void setup() {
                                      Serial.begin(9600);
                                      hwPinMode(LED_BUILTIN,OUTPUT_H0H1);
                                      }

                                      void loop() {
                                      digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
                                      delay(1000); // wait for a second
                                      digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
                                      delay(1000); // wait for a second
                                      }

                                      I have this :

                                      Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
                                      Licensed under GNU GPL v2
                                      For bug reports, read
                                      http://openocd.org/doc/doxygen/bugs.html
                                      debug_level: 2
                                      0
                                      adapter speed: 10000 kHz
                                      cortex_m reset_config sysresetreq
                                      Info : No device selected, using first device.
                                      Info : J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
                                      Info : Hardware version: 7.00
                                      Info : VTarget = 3.300 V
                                      Info : clock speed 10000 kHz
                                      Info : SWD IDCODE 0x2ba01477
                                      Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
                                      nrf52.cpu: target state: halted
                                      target halted due to debug-request, current mode: Thread
                                      xPSR: 0x01000000 pc: 0x0000051c msp: 0x20010000
                                      ** Programming Started **
                                      auto erase enabled
                                      Warn : Unknown device (HWID 0x00000139)
                                      Warn : not enough working area available(requested 32)
                                      Warn : no working area available, falling back to slow memory writes
                                      wrote 12288 bytes from file C:\Users\Sancho\AppData\Local\Temp\arduino_build_76789/NRF5_blink_led8.ino.hex in 4.155332s (2.888 KiB/s)
                                      ** Programming Finished **
                                      ** Verify Started **
                                      Warn : not enough working area available(requested 52)
                                      verified 10812 bytes in 0.165932s (63.632 KiB/s)
                                      ** Verified OK **
                                      ** Resetting Target **
                                      shutdown command invoked

                                      I think its good, but when i put a led with a resistance on P0.08, nothing :(

                                      could you help me more ?

                                      LED_BUILTIN corresponds to po17

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        p359
                                        wrote on last edited by
                                        #40

                                        Hi. Are the steps in first post still valid please?

                                        I'm trying without luck to get first nrf52 programmed. I get a weird error"Error resolving FQBN: missing" in Arduino IDE when I try to verify any basic sketch, even blink. Thanks for any thoughts

                                        N 1 Reply Last reply
                                        0
                                        • P p359

                                          Hi. Are the steps in first post still valid please?

                                          I'm trying without luck to get first nrf52 programmed. I get a weird error"Error resolving FQBN: missing" in Arduino IDE when I try to verify any basic sketch, even blink. Thanks for any thoughts

                                          N Offline
                                          N Offline
                                          ncollins
                                          wrote on last edited by
                                          #41

                                          @p359 Which version of Arduino IDE are you using? I was seeing that with 1.8.10, but I ended up downgrading to 1.8.6 to test and it worked.

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


                                          13

                                          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