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 630.8k 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.
  • N ncollins

    @NeverDie Hoping you can help me with an WTNRF51822-S4AT problem where my stop recognizing interrupt events 2ish days after the last interrupt.

    The buttons sleep for 24 hours, then wake up and send battery level. Even though the interrupt stops triggering, they still send battery level.

    Possible some kind of timer is expiring?

    Any help is appreciated.

    // General settings
    #define SKETCH_NAME "ThinButton"
    #define SENSOR_NAME SKETCH_NAME
    #define SKETCH_VERSION "1.4"
    
    #define MY_NODE_ID 37
    
    
    #define MY_BAUD_RATE 115200
    //#define MY_DEBUG
    
    #define IS_NRF51 
    #define PIR_DETECTION_PIN 3
    #define SHORT_WAIT 50
    #define DEBOUNCE_MS 1000
    
    volatile bool motion_change=false;
    
    #define MY_RADIO_NRF5_ESB
    
    #include <MySensors.h>
    
    #define SLEEP_MS 1000 * 60 * 60 * 24
    
    #define   CHILD_ID_VOLT 1
    MyMessage msgBattery(CHILD_ID_VOLT, V_VOLTAGE);
    
    #define CHILD_ID_BTN 2
    #define BTN_PIN PIR_DETECTION_PIN
    MyMessage msgBtn(CHILD_ID_BTN, V_TRIPPED);
    
    void disableNfc() {  //only applied to nRF52
    
      #ifndef IS_NRF51
        //Make pins 9 and 10 usable as GPIO pins.
        NRF_NFCT->TASKS_DISABLE=1;  //disable NFC
        NRF_NVMC->CONFIG=1;  // Write enable the UICR
        NRF_UICR->NFCPINS=0; //Make pins 9 and 10 usable as GPIO pins.
        NRF_NVMC->CONFIG=0;  // Put the UICR back into read-only mode.
      #endif
    }
    
    void turnOffRadio() {
      NRF_RADIO->TASKS_DISABLE=1;
      while (!(NRF_RADIO->EVENTS_DISABLED)) {}  //until radio is confirmed disabled
    }
    
    void turnOffUarte0() {
      #ifndef IS_NRF51  
        NRF_UARTE0->TASKS_STOPRX = 1;
        NRF_UARTE0->TASKS_STOPTX = 1;
        NRF_UARTE0->TASKS_SUSPEND = 1;
        NRF_UARTE0->ENABLE=0;  //disable UART0
        while (NRF_UARTE0->ENABLE!=0) {};  //wait until UART0 is confirmed disabled.
      #endif
    
      #ifdef IS_NRF51
        NRF_UART0->TASKS_STOPRX = 1;
        NRF_UART0->TASKS_STOPTX = 1;
        NRF_UART0->TASKS_SUSPEND = 1;
        NRF_UART0->ENABLE=0;  //disable UART0
        while (NRF_UART0->ENABLE!=0) {};  //wait until UART0 is confirmed disabled.
      #endif
    }
    
    void turnOffAdc() {
      #ifndef IS_NRF51
        if (NRF_SAADC->ENABLE) { //if enabled, then disable the SAADC
          NRF_SAADC->TASKS_STOP=1;
          while (NRF_SAADC->EVENTS_STOPPED) {} //wait until stopping of SAADC is confirmed
          NRF_SAADC->ENABLE=0;  //disable the SAADC
          while (NRF_SAADC->ENABLE) {} //wait until the disable is confirmed
        }
      #endif
    }
    
    
    void turnOffHighFrequencyClock() {
        NRF_CLOCK->TASKS_HFCLKSTOP = 1;
        while ((NRF_CLOCK->HFCLKSTAT) & 0x0100) {}  //wait as long as HF clock is still running.
    }
    
    
    void mySleepPrepare() {  //turn-off energy drains prior to sleep
      turnOffHighFrequencyClock();
      turnOffRadio();
      turnOffUarte0();
    }
     
    
    void activateLpComp() {
      NRF_LPCOMP->PSEL=4; // monitor AIN0 (i.e. pin P0.02 on nRF52832 PIR Motion Sensor v607).
      while (!(NRF_LPCOMP->PSEL==4)) {} //wait until confirmed
      NRF_LPCOMP->REFSEL=3;  // choose 1/2 VDD as the reference voltage
      while (!(NRF_LPCOMP->REFSEL==3)) {} //wait until confirmed
      NRF_LPCOMP->ANADETECT=0;  //detect CROSS events on PIR detection pin
      while (NRF_LPCOMP->ANADETECT!=0) {} //wait until confirmed
      NRF_LPCOMP->INTENSET=B1000;  //Enable interrupt for CROSS event
      while (!(((NRF_LPCOMP->INTENSET)&B1000)==B1000)) {} //wait until confirmed
      NRF_LPCOMP->ENABLE=1;  //Enable LPCOMP
      while (!(NRF_LPCOMP->ENABLE==1)) {} //wait until confirmed
      NRF_LPCOMP->TASKS_START=1;  //start the LPCOMP
      while (!(NRF_LPCOMP->EVENTS_READY)) {}  //wait until ready
      
      NVIC_SetPriority(LPCOMP_IRQn, 15);
      NVIC_ClearPendingIRQ(LPCOMP_IRQn);
      NVIC_EnableIRQ(LPCOMP_IRQn);
    }
    
    void suspendLpComp() { //suspend getting more interrupts from LPCOMP before the first interrupt can be handled
      if ((NRF_LPCOMP->ENABLE) && (NRF_LPCOMP->EVENTS_READY)) {  //if LPCOMP is enabled
        NRF_LPCOMP->INTENCLR=B0100;  //disable interrupt from LPCOMP
        while (((NRF_LPCOMP->INTENCLR)&B0100)==B0100) {} //wait until confirmed
      }
    }
    
    void resumeLpComp() { //suspend getting interrupts from LPCOMP
      NRF_LPCOMP->INTENSET=B0100;  //Enable interrupt for UP event
      while (((NRF_LPCOMP->INTENSET)&B1000)!=B0100) {} //wait until confirmed
    }
    // setup
    void setup() {
      hwInit();
      hwPinMode(PIR_DETECTION_PIN,INPUT);
    
      disableNfc();  //remove unnecessary energy drains
      turnOffAdc();  //remove unnecessary energy drains
      activateLpComp();
      motion_change=false;
    }
    
    void mySleep(uint32_t ms) {
       mySleepPrepare();  //Take steps to reduce drains on battery current prior to sleeping
       sleep(ms);
    }
    
    
    // presentation
    void presentation() {
      sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
    
      present(CHILD_ID_VOLT, S_MULTIMETER, SENSOR_NAME);
      wait(SHORT_WAIT);
      present(CHILD_ID_BTN, S_MOTION, SENSOR_NAME);
      wait(SHORT_WAIT);
    }
    
    unsigned long lastTripped = millis();
    
    // loop
    void loop() {
      mySleep(SLEEP_MS);
      
      if(motion_change){
        unsigned long ms = millis();
        long timeDiff = ms - lastTripped; 
        
        if(timeDiff < 0 || timeDiff > 1000){ 
          send(msgBtn.set((uint8_t) 1));
        }
         
        NRF_LPCOMP->EVENTS_CROSS=0;
        motion_change=false;
        lastTripped = millis();
      } else {
        
        send(msgBattery.set(getInternalVoltage(),3));
      }
    }
    
    float getInternalVoltage(){
      return ((float)hwCPUVoltage())/1000.0;
    }
    
    
    #if __CORTEX_M == 0x04
    #define NRF5_RESET_EVENT(event)                                                 \
            event = 0;                                                                   \
            (void)event
    #else
    #define NRF5_RESET_EVENT(event) event = 0
    #endif
    
    
    // This must be in one line
    extern "C" { void LPCOMP_IRQHandler(void) {motion_change=true; NRF5_RESET_EVENT(NRF_LPCOMP->EVENTS_CROSS); NRF_LPCOMP->EVENTS_CROSS=0; MY_HW_RTC->CC[0]=(MY_HW_RTC->COUNTER+2);}}
    
    W Offline
    W Offline
    waspie
    wrote on last edited by
    #1780

    @ncollins I had the same problem and sort of "solved" it by having it reboot every 3 hours (or maybe it was 6).

    I don't know how to use the nrf5x stuff anywhere near well enough to actually fix it but it seems to work.

    N 1 Reply Last reply
    0
    • W waspie

      @ncollins I had the same problem and sort of "solved" it by having it reboot every 3 hours (or maybe it was 6).

      I don't know how to use the nrf5x stuff anywhere near well enough to actually fix it but it seems to work.

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

      @waspie I was actually about to go down that route. Would you mind posting a code snippet for how you're triggering the reboot?

      W 1 Reply Last reply
      0
      • N ncollins

        @waspie I was actually about to go down that route. Would you mind posting a code snippet for how you're triggering the reboot?

        W Offline
        W Offline
        waspie
        wrote on last edited by waspie
        #1782

        @ncollins

        throw this somewhere in your code:

        void reboot() {
          wdt_disable();
          wdt_enable(WDTO_15MS);
          while (1) {}
        }
        

        and then calling the reboot (in the entire loop):

        void loop() {
        
          if (motion_change) {
            motionDetected=!motionDetected;
            if (motionDetected) {
              send(msg.set("1"));  // motion detected
            }
            else {
              digitalWrite(LED_BUILTIN,LOW);  //turn-off LED to signify motion no longer detected
              send(msg.set("0"));  // send all-clear to prepare for future detections
            }    
            
            NRF_LPCOMP->EVENTS_CROSS=0;
            motion_change=false;
          }
          else { //must be a scheduled wake-up.  Time to report voltage as a heartbeat.
            batteryVoltage=((float)hwCPUVoltage())/1000.0;  //take voltage measurement after transmission to hopefully measure lowest voltage that occurs. 
            send(msg_S_MULTIMETER_V_VOLTAGE.set(batteryVoltage,3));  //send battery voltage with 3 decimal places
            time = millis();
            if (time > 14400000 ) {
              reboot();
            }
          }
          mySleep(1200000);  //sleep for 20 minutes
        }```
        N 2 Replies Last reply
        2
        • W waspie

          @ncollins

          throw this somewhere in your code:

          void reboot() {
            wdt_disable();
            wdt_enable(WDTO_15MS);
            while (1) {}
          }
          

          and then calling the reboot (in the entire loop):

          void loop() {
          
            if (motion_change) {
              motionDetected=!motionDetected;
              if (motionDetected) {
                send(msg.set("1"));  // motion detected
              }
              else {
                digitalWrite(LED_BUILTIN,LOW);  //turn-off LED to signify motion no longer detected
                send(msg.set("0"));  // send all-clear to prepare for future detections
              }    
              
              NRF_LPCOMP->EVENTS_CROSS=0;
              motion_change=false;
            }
            else { //must be a scheduled wake-up.  Time to report voltage as a heartbeat.
              batteryVoltage=((float)hwCPUVoltage())/1000.0;  //take voltage measurement after transmission to hopefully measure lowest voltage that occurs. 
              send(msg_S_MULTIMETER_V_VOLTAGE.set(batteryVoltage,3));  //send battery voltage with 3 decimal places
              time = millis();
              if (time > 14400000 ) {
                reboot();
              }
            }
            mySleep(1200000);  //sleep for 20 minutes
          }```
          N Offline
          N Offline
          ncollins
          wrote on last edited by
          #1783

          @waspie appreciate it, thank you

          1 Reply Last reply
          2
          • Sergio RiusS Offline
            Sergio RiusS Offline
            Sergio Rius
            wrote on last edited by
            #1784

            @NeverDie Interesting. What have pulled you from nrf52 towards PICs?
            Can you post a link on the board you ordered, (or one like that)? Thanks.

            NeverDieN 1 Reply Last reply
            0
            • Sergio RiusS Sergio Rius

              @NeverDie Interesting. What have pulled you from nrf52 towards PICs?
              Can you post a link on the board you ordered, (or one like that)? Thanks.

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

              @sergio-rius I'm still deciding. What's holding me back from plunging into pic is that. it appears, the pics won't be able to leverage the arduino libraries. For that reason, I think I'm probably better off staying arduino compatible. In the end, it may be less effort to simply write my own OTA firmware update bootloader.

              1 Reply Last reply
              1
              • NeverDieN NeverDie

                @Terrence said in Minimalist SAMD21 TQFP32 Pro Mini:

                @NeverDie I love the Feather boards. Currently working with the RFM69 feather. Build in battery connector/charger is very nice to have.

                Have you found a cheaper source than Amazon for buying them?

                S Offline
                S Offline
                siamola
                wrote on last edited by
                #1786

                @neverdie said in nRF5 action!:

                @Terrence said in Minimalist SAMD21 TQFP32 Pro Mini:

                @NeverDie I love the Feather boards. Currently working with the RFM69 feather. Build in battery connector/charger is very nice to have.

                Have you found a cheaper source than Amazon for buying them?

                where it's just every pin of the SAMD21 mapped to a post, and it's only just the SAMD21 chip on the board. Then I can experiment on breadboard and figure out what I want and what works before finally reducing it to a subsequent PCB.

                1 Reply Last reply
                0
                • Sergio RiusS Offline
                  Sergio RiusS Offline
                  Sergio Rius
                  wrote on last edited by
                  #1787

                  Any charitative soul can help me prepare a black magic probe? I'm following the guides but at some point I can't continue.
                  For example, following this one: https://hackaday.io/project/28180-bluetooth-gamepad-phone-case/log/71316-stm32-black-magic-probe-flashing
                  I do:

                  $ mkdir mbp && cd mbp
                  $ wget https://raw.githubusercontent.com/jsnyder/stm32loader/master/stm32loader.py
                  $ chmod 774 stm32loader.py
                  $ sudo apt install python-pip
                  $ pip install pyserial # There I remove '--assume-yes' as this is a wrong parameter
                  
                  # Then here starts the funk
                  $ sudo apt install arm-none-eabi-gdb  # The package does not exist.
                  # I found online that it may be already incorporated and my worth a try, so I continue.
                  # So I change the boot0 jumper to 1, that it not said in the guide, connect the two boards and plug it into the computer.
                  
                  $ dmesg | grep tty
                  # Nothing.
                  
                  $ sudo dmesg | tail
                  [10680.891711] usb 1-12: Product: STM32 STLink
                  [10680.891714] usb 1-12: Manufacturer: STMicroelectronics
                  [10680.891716] usb 1-12: SerialNumber: PÿqRpQP2$g
                  [11990.202434] usb 1-12: USB disconnect, device number 7
                  [11998.926846] usb 1-12: new full-speed USB device number 8 using xhci_hcd
                  [11999.076060] usb 1-12: New USB device found, idVendor=0483, idProduct=3748, bcdDevice= 1.00
                  [11999.076066] usb 1-12: New USB device strings: Mfr=1, Product=2, SerialNumber=3
                  [11999.076069] usb 1-12: Product: STM32 STLink
                  [11999.076072] usb 1-12: Manufacturer: STMicroelectronics
                  [11999.076074] usb 1-12: SerialNumber: PÿqRpQP2$g
                  # But no usb port. So I add udev rule.
                  
                  $ ls -l /dev/stl*
                  lrwxrwxrwx 1 root root 15 oct 15 14:32 /dev/stlinkv2_12 -> bus/usb/001/008
                  
                  $ sudo ./stm32loader.py -p /dev/stlinkv2_12
                  Traceback (most recent call last):
                    File "./stm32loader.py", line 427, in <module>
                      cmd.open(conf['port'], conf['baud'])
                    File "./stm32loader.py", line 71, in open
                      timeout=5               # set a timeout value, None for waiting forever
                    File "/home/sergio/.local/lib/python2.7/site-packages/serial/serialutil.py", line 240, in __init__
                      self.open()
                    File "/home/sergio/.local/lib/python2.7/site-packages/serial/serialposix.py", line 272, in open
                      self._reconfigure_port(force_update=True)
                    File "/home/sergio/.local/lib/python2.7/site-packages/serial/serialposix.py", line 326, in _reconfigure_port
                      raise SerialException("Could not configure port: {}".format(msg))
                  serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')
                  
                  $ sudo apt install gdb-multiarch
                  # Same effect.
                  

                  And here I am. Does anyone knows what kind of magic is required to put inside this little thing? :smirk:

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

                    @Sergio-Rius
                    I can't help you with blackmagic probe unfortunately.
                    Just personal opinion, I prefer Segger probe.
                    For example, Segger EDU mini is cheap. for the price don't bother with clones..

                    • very affordable
                    • compatible with a lot of IDEs, and when you use it with Segger IDE then you get best integration
                    • segger provides lot of tools for debugging for free
                    • easy updates and drivers install

                    The only cons to a jlink probe could be no additional uart, but I don't need uart for debug&prints (segger ozone and rtt tools), and nor uploading sketch.

                    Or a nrf5dk board is a nice alternative too, a little bit more expensive than EDU Mini but you get jlink+devboard+ later you could hook a power profiler kit on it ;)
                    Still a jlink mini at hand is quite useful.

                    Like I said just personal, I'm sure BMP is nice too, I guess you'll get it working before you can get a jlink :)

                    1 Reply Last reply
                    0
                    • Sergio RiusS Sergio Rius

                      Any charitative soul can help me prepare a black magic probe? I'm following the guides but at some point I can't continue.
                      For example, following this one: https://hackaday.io/project/28180-bluetooth-gamepad-phone-case/log/71316-stm32-black-magic-probe-flashing
                      I do:

                      $ mkdir mbp && cd mbp
                      $ wget https://raw.githubusercontent.com/jsnyder/stm32loader/master/stm32loader.py
                      $ chmod 774 stm32loader.py
                      $ sudo apt install python-pip
                      $ pip install pyserial # There I remove '--assume-yes' as this is a wrong parameter
                      
                      # Then here starts the funk
                      $ sudo apt install arm-none-eabi-gdb  # The package does not exist.
                      # I found online that it may be already incorporated and my worth a try, so I continue.
                      # So I change the boot0 jumper to 1, that it not said in the guide, connect the two boards and plug it into the computer.
                      
                      $ dmesg | grep tty
                      # Nothing.
                      
                      $ sudo dmesg | tail
                      [10680.891711] usb 1-12: Product: STM32 STLink
                      [10680.891714] usb 1-12: Manufacturer: STMicroelectronics
                      [10680.891716] usb 1-12: SerialNumber: PÿqRpQP2$g
                      [11990.202434] usb 1-12: USB disconnect, device number 7
                      [11998.926846] usb 1-12: new full-speed USB device number 8 using xhci_hcd
                      [11999.076060] usb 1-12: New USB device found, idVendor=0483, idProduct=3748, bcdDevice= 1.00
                      [11999.076066] usb 1-12: New USB device strings: Mfr=1, Product=2, SerialNumber=3
                      [11999.076069] usb 1-12: Product: STM32 STLink
                      [11999.076072] usb 1-12: Manufacturer: STMicroelectronics
                      [11999.076074] usb 1-12: SerialNumber: PÿqRpQP2$g
                      # But no usb port. So I add udev rule.
                      
                      $ ls -l /dev/stl*
                      lrwxrwxrwx 1 root root 15 oct 15 14:32 /dev/stlinkv2_12 -> bus/usb/001/008
                      
                      $ sudo ./stm32loader.py -p /dev/stlinkv2_12
                      Traceback (most recent call last):
                        File "./stm32loader.py", line 427, in <module>
                          cmd.open(conf['port'], conf['baud'])
                        File "./stm32loader.py", line 71, in open
                          timeout=5               # set a timeout value, None for waiting forever
                        File "/home/sergio/.local/lib/python2.7/site-packages/serial/serialutil.py", line 240, in __init__
                          self.open()
                        File "/home/sergio/.local/lib/python2.7/site-packages/serial/serialposix.py", line 272, in open
                          self._reconfigure_port(force_update=True)
                        File "/home/sergio/.local/lib/python2.7/site-packages/serial/serialposix.py", line 326, in _reconfigure_port
                          raise SerialException("Could not configure port: {}".format(msg))
                      serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')
                      
                      $ sudo apt install gdb-multiarch
                      # Same effect.
                      

                      And here I am. Does anyone knows what kind of magic is required to put inside this little thing? :smirk:

                      monteM Online
                      monteM Online
                      monte
                      wrote on last edited by
                      #1789

                      @sergio-rius I too have struggled to flash st-link clone with bmp firmware, but eventually I managed to do it. Unfortunately I don't remember what exactly I did, but I remember that I came to a solution when decided to try another st-link as a destination. If I remember correctly, there are different stm32 chips on these boards and some of them have insufficient amount of flash memory for bmp firmware.

                      arm-none-eabi-gdb package is not available in ubuntu's repositories starting from 18.04. You can either download toolchain from eclipse's github archive or try to install older package as described here.

                      Also, I used info from this blogs when flashed my st-link:
                      http://blog.linuxbits.io/2016/02/15/cheap-chinese-st-link-v-2-programmer-converted-to-black-magic-probe-debugger/
                      http://nuft.github.io/arm/2015/08/24/blackmagic-stlink.html

                      As for buying stuff, don't forget you can buy ready to use BMP from their creators too ;)

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

                        Maybe this will help: I once looked into the Black Magic Probe, but came to the conclusion that it was basically a PC program that they crammed onto the "probe." Therefore, unless I'm mistaken, you could run the very same source software from either a PC or a linux box and get the same results. I don't recall any advantage to running it on the so-called "probe" that the authors picked.

                        monteM 1 Reply Last reply
                        1
                        • NeverDieN NeverDie

                          Maybe this will help: I once looked into the Black Magic Probe, but came to the conclusion that it was basically a PC program that they crammed onto the "probe." Therefore, unless I'm mistaken, you could run the very same source software from either a PC or a linux box and get the same results. I don't recall any advantage to running it on the so-called "probe" that the authors picked.

                          monteM Online
                          monteM Online
                          monte
                          wrote on last edited by
                          #1791

                          @neverdie and how do you suggest connecting SWD and SWCLK lines from MCU to computer, not using the "probe"?

                          Sergio RiusS NeverDieN 2 Replies Last reply
                          0
                          • monteM monte

                            @neverdie and how do you suggest connecting SWD and SWCLK lines from MCU to computer, not using the "probe"?

                            Sergio RiusS Offline
                            Sergio RiusS Offline
                            Sergio Rius
                            wrote on last edited by
                            #1792

                            @monte I guess he means taking the debugger program to the computer layer and leave only the com channel to a TTL device.

                            monteM 1 Reply Last reply
                            0
                            • Sergio RiusS Sergio Rius

                              @monte I guess he means taking the debugger program to the computer layer and leave only the com channel to a TTL device.

                              monteM Online
                              monteM Online
                              monte
                              wrote on last edited by
                              #1793

                              @sergio-rius but debugger is running on a computer side anyway, as far as I understand. And BMP is the "thing" that connects it to MCU via SWD.

                              Sergio RiusS 1 Reply Last reply
                              0
                              • monteM monte

                                @sergio-rius but debugger is running on a computer side anyway, as far as I understand. And BMP is the "thing" that connects it to MCU via SWD.

                                Sergio RiusS Offline
                                Sergio RiusS Offline
                                Sergio Rius
                                wrote on last edited by
                                #1794

                                @monte I may be wrong, but from what I understand while reading on it, it seems that the debugger is implemented in the probe. The program you run is an interface.
                                I see it like a Ilogger interface that you implement in a program.

                                monteM 1 Reply Last reply
                                0
                                • Sergio RiusS Sergio Rius

                                  @monte I may be wrong, but from what I understand while reading on it, it seems that the debugger is implemented in the probe. The program you run is an interface.
                                  I see it like a Ilogger interface that you implement in a program.

                                  monteM Online
                                  monteM Online
                                  monte
                                  wrote on last edited by
                                  #1795

                                  @sergio-rius well, I guess you are right. I revisited description of BMP and it says, that it runs GBD server on itself and eliminates need for STlink server. So I guess you could do all the same with just an st-link...however it seems that it would require more setup and I don't think that it will be easier than flashing BMP firmware :)
                                  Just a snippet from their wiki:
                                  "There are a few advantages of the Black Magic Probe. BMP is open-source, meaning that you can look inside it if you need or want to. We are getting support for new ARM Cortex-M based chips on a regular basis, so you are not limited to just the STM32. We have preliminary support for Cortex-A this will result in the ability to use the probe with Raspberry PI and Beagle Bone Black and many others. The Black Magic Probe also supports JTAG not only SWD, because not all microcontrollers use SWD. Also JTAG makes it possible to chain together more than one microcontroller. The GDB server is implemented on the probe itself, this means we do not use some proprietary protocol to talk to your debugger software, making the setup more repeatable and removing the need for custom config files."

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

                                    "BMP is open-source, meaning that you can look inside it if you need or want to"

                                    "The GDB server is implemented on the probe itself, this means we do not use some proprietary protocol to talk to your debugger software"

                                    sounds so useful when you simply want to upload fw and debug :sweat_smile:
                                    open-source does not mean better quality than proprietary imho, it can be a burden too. I prefer mature product for working.

                                    is BMP compatible/integrated with as many IDE as a proprietary probe?
                                    If for instance someday you want to use it with Segger IDE+nordic sdk, is it compatible? I don't think so.
                                    I "compared" probes recently and decided to stick to jlink. The second probe in my list is cmsis-dap/daplink, looks nice too, but don't need it (at least, not so far)

                                    I use many different toolchains and CLI too. So when there is a tool that just needs download and exec to install driver, autoupdates etc, without spending life in CLI, I don't hesitate.

                                    struggling or working..

                                    monteM 1 Reply Last reply
                                    0
                                    • scalzS scalz

                                      "BMP is open-source, meaning that you can look inside it if you need or want to"

                                      "The GDB server is implemented on the probe itself, this means we do not use some proprietary protocol to talk to your debugger software"

                                      sounds so useful when you simply want to upload fw and debug :sweat_smile:
                                      open-source does not mean better quality than proprietary imho, it can be a burden too. I prefer mature product for working.

                                      is BMP compatible/integrated with as many IDE as a proprietary probe?
                                      If for instance someday you want to use it with Segger IDE+nordic sdk, is it compatible? I don't think so.
                                      I "compared" probes recently and decided to stick to jlink. The second probe in my list is cmsis-dap/daplink, looks nice too, but don't need it (at least, not so far)

                                      I use many different toolchains and CLI too. So when there is a tool that just needs download and exec to install driver, autoupdates etc, without spending life in CLI, I don't hesitate.

                                      struggling or working..

                                      monteM Online
                                      monteM Online
                                      monte
                                      wrote on last edited by monte
                                      #1797

                                      @scalz well, that's nice that you know what you want and can get it, but that doesn't mean that's suitable for everybody else. That's good to have a choice, but when you need it done, you better find a way to get it done easier and faster.
                                      So I went to local store, bought second st-link clone for 4$ and then spent a few hours figuring out, how to properly flash it. The day after I could unlock my Ebyte e73 board, with newly acquired BMP.
                                      If I'd took the route suggested by you, I would spend minimum 30$ and 1-2 weeks of waiting time. And then I would still need to figure out how to work with that proprietary software.
                                      I am far from experienced programmer, so I can't get use of BMP's full potential, but now I have a very useful tool in my arsenal, that can be used with variety of different chips.
                                      Also, in my opinion, the main advantage of opensource not the software itself, but a community. Your experience may vary, but I'd say you have better chances finding solution in opensource community, than on commercial software forum, unless you have some kind of paid support subscription.

                                      1 Reply Last reply
                                      0
                                      • monteM monte

                                        @neverdie and how do you suggest connecting SWD and SWCLK lines from MCU to computer, not using the "probe"?

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

                                        @monte said in nRF5 action!:

                                        @neverdie and how do you suggest connecting SWD and SWCLK lines from MCU to computer, not using the "probe"?

                                        st-link. Roger Clark previously had a youtube video showing this setup, but it looks as though he has since deleted all his videos: https://www.youtube.com/user/synergie8/featured

                                        Anyhow, I'm not trying to dissuade anyone from using BMP. If you want a probe that has a command line interface built into it, then AFAIK it's still available.

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

                                          @monte said in nRF5 action!:

                                          @scalz well, that's nice that you know what you want and can get it, but that doesn't mean that's suitable for everybody else. That's good to have a choice, but when you need it done, you better find a way to get it done easier and faster.

                                          Why so much impatience :) So many things to tinker.. I mean you can get a jlink in 2days if you need it. I ordered mine while I was waiting for stuff coming from China..and in my case, there is no close-door store for geeks.
                                          Do you mean you would suggest a nrf5 newcomer to diy a BMP for mcu flashing??

                                          When I got my jlink, I didn't have to flash it to make it working.. I just had to donwload win drivers, install them, and voilà.
                                          Which proprietary sw do you think you need to learn?? I don't use any special sw for flashing..just regular IDEs like arduino/vs studio, or more advanced like Segger (free) or Keil. For all these IDEs, I just click on a button to upload fw, simple. There is nordic windows apps, or nrfjlink in CLI too.

                                          I know the power of oss and its flaws, same for commercial, in practice it's not rare to see communities sitting/waiting for updates (not hard to find examples on github), whereas money makes commercial products live.
                                          No need to debate on this, it's useless debate I think
                                          The reality is different here, I think you'll find more subscriptions-free resources on internet about Jlink than BMP, and for a reason ;) I agree that you'll find lot of howtos save a few bucks by diy-ing and flashing a BMP..
                                          everyone acts in one's own interest :)
                                          Just to sum up my thought, I think for a newcomer it's easier to get started with a Jlink vs diy probe that you need to flash with what, a probe ??

                                          Below is a screenshot of a running nrf5 test, stability test.. but for example you can see, I don't use any additional uart for debug printing, and fw is just uploaded by a click in IDE.
                                          0_1571301587440_Capture.PNG

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


                                          17

                                          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