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.9k 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.
  • ahmedadelhosniA ahmedadelhosni

    @Uhrheber Great. Thanks for the help.

    So if I understand well. If I have a TIVA board like TM4C123G Launchpad and it is ARM Mx also, then I can use it to program my nRF ?

    This is the datasheet for the board : http://www.ti.com/lit/ug/spmu296/spmu296.pdf

    I searched and found those links describing how to use the Launchad but I am not sure whether this will work for nRF also or not.

    http://processors.wiki.ti.com/index.php/Stellaris_LM4F120_LaunchPad_Debug_How_To
    http://ucsolutions.blogspot.com.eg/2014/08/ti-launchpad-as-external-debugger-with.html

    Thanks.

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

    @ahmedadelhosni said in nRF5 Bluetooth action!:

    @Uhrheber Great. Thanks for the help.

    So if I understand well. If I have a TIVA board like TM4C123G Launchpad and it is ARM Mx also, then I can use it to program my nRF ?

    This is the datasheet for the board : http://www.ti.com/lit/ug/spmu296/spmu296.pdf

    I searched and found those links describing how to use the Launchad but I am not sure whether this will work for nRF also or not.

    http://processors.wiki.ti.com/index.php/Stellaris_LM4F120_LaunchPad_Debug_How_To
    http://ucsolutions.blogspot.com.eg/2014/08/ti-launchpad-as-external-debugger-with.html

    Thanks.

    I think it's a question of the licence of the programmer that is on your board.
    For example the J-Link version on the NRF52 DK is only allowed to program NRF52 and NRF51 chips. It's logic because the NRF52DK is just over 30$ while a J-Link programmer is x00$.
    You have pins SWDIO and SWDCLK on pins PC0 and PC1 of your board so just try it and you will know :)

    ahmedadelhosniA 1 Reply Last reply
    0
    • Nca78N Nca78

      @ahmedadelhosni said in nRF5 Bluetooth action!:

      @Uhrheber Great. Thanks for the help.

      So if I understand well. If I have a TIVA board like TM4C123G Launchpad and it is ARM Mx also, then I can use it to program my nRF ?

      This is the datasheet for the board : http://www.ti.com/lit/ug/spmu296/spmu296.pdf

      I searched and found those links describing how to use the Launchad but I am not sure whether this will work for nRF also or not.

      http://processors.wiki.ti.com/index.php/Stellaris_LM4F120_LaunchPad_Debug_How_To
      http://ucsolutions.blogspot.com.eg/2014/08/ti-launchpad-as-external-debugger-with.html

      Thanks.

      I think it's a question of the licence of the programmer that is on your board.
      For example the J-Link version on the NRF52 DK is only allowed to program NRF52 and NRF51 chips. It's logic because the NRF52DK is just over 30$ while a J-Link programmer is x00$.
      You have pins SWDIO and SWDCLK on pins PC0 and PC1 of your board so just try it and you will know :)

      ahmedadelhosniA Offline
      ahmedadelhosniA Offline
      ahmedadelhosni
      wrote on last edited by ahmedadelhosni
      #1221

      @Nca78 Yeah actually this makes sense. I forgot about the licence thing. Actually I didn't bug the boards and I want to get everything at once without missing anything. I am in a hurry :D

      it is strange that this clone can do the work as @Uhrheber mentioned.

      http://s.click.aliexpress.com/deep_link.htm?dl_target_url=https%3A%2F%2Fwww.aliexpress.com%2Fitem%2FHot-Sale-1PCS-ST-LINK-Stlink-ST-Link-V2-Mini-STM8-STM32-Simulator-Download-Programmer-Programming%2F32343514985.html%3Fspm%3D2114.search0104.3.26.LR8eH0%26ws_ab_test%3Dsearchweb0_0&aff_short_key=e2Vzr3v

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Toyman
        wrote on last edited by
        #1222

        Guys, your best bet is to reflash STM32 Bluepill into BlackMagicProbe.
        It's awesome!
        https://medium.com/@paramaggarwal/converting-an-stm32f103-board-to-a-black-magic-probe-c013cf2cc38c

        1 Reply Last reply
        0
        • NeverDieN NeverDie

          Anyhow, the basic question remains and boils down to this: Can I have both

              // Enable interrupt
            NVIC_SetPriority(LPCOMP_IRQn, 15);
            NVIC_ClearPendingIRQ(LPCOMP_IRQn);
            NVIC_EnableIRQ(LPCOMP_IRQn);
          

          AND an equivalent incantation for the RTC both active at the same time? Or am I forced into having it be just one or the other?

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

          @NeverDie said in nRF5 Bluetooth action!:

          Anyhow, the basic question remains and boils down to this: Can I have both

              // Enable interrupt
            NVIC_SetPriority(LPCOMP_IRQn, 15);
            NVIC_ClearPendingIRQ(LPCOMP_IRQn);
            NVIC_EnableIRQ(LPCOMP_IRQn);
          

          AND an equivalent incantation for the RTC both active at the same time? Or am I forced into having it be just one or the other?

          @d00616 Any thoughts or comments regarding this?

          d00616D 1 Reply Last reply
          0
          • NeverDieN NeverDie

            @NeverDie said in nRF5 Bluetooth action!:

            Anyhow, the basic question remains and boils down to this: Can I have both

                // Enable interrupt
              NVIC_SetPriority(LPCOMP_IRQn, 15);
              NVIC_ClearPendingIRQ(LPCOMP_IRQn);
              NVIC_EnableIRQ(LPCOMP_IRQn);
            

            AND an equivalent incantation for the RTC both active at the same time? Or am I forced into having it be just one or the other?

            @d00616 Any thoughts or comments regarding this?

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

            @NeverDie said in nRF5 Bluetooth action!:

            @d00616 Any thoughts or comments regarding this?

            Sorry, I can't help here. Maybe, the interrupt priority can be used only once and you have to use another priority for RTC or LPCOMP.

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

              I tried out the Fanstel BT832X (i.e. nRF52832 with PA and LNA) today:
              alt text

              Good news:

              1. Even without the PA turned on, the range seems a lot better than if transmitting from an Ebyte module.
              2. Also, I've confirmed that it comes with DCDC built-in.
              3. With the PA turned on, the range is comparable to, and perhaps even better than, the RFaxis I reviewed earlier in this thread.

              With the PA turned on, it consumes about 250ma.

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

                @d00616 I hooked up the Fanstel BT832A. Although it appeared to flash and verify correctly, I couldn't get it to do anything--not even blink. Is there any chance that it's downsized flash/memory has something to do with it? "Flash/RAM memories in BT832 are 512KB/64KB. They are 192KB/24KB in BT832A." So, as an experiment, I hooked up a BT832 in its place on the same board, and it's able to transmit and blink just fine. In total, the only differences between the two are:

                1. Cortex M4F in BT832 has hardware DSP and floating point instructions. Cortex M4 in BT832A has hardware DSP instructions but it does not have floating point unit to support hardware instruction.
                2. Flash/RAM memories in BT832 are 512KB/64KB. They are 192KB/24KB in BT832A.
                3. BT832 has NFC tag interface. BT832A does not have NFC tag
                  interface.

                I think we can rule out #3. So, if it isn't #2, then is perhaps #1 a factor? I wouldn't think so.

                The solder connections seemed correct. I suppose it's possible I simply got a bad module, but I'm doubtful that's it.

                Here's a photo of it installed on a BT832X board, which is pin-for-pin compatible:
                0_1509216144568_BT832A.jpg

                d00616D 1 Reply Last reply
                0
                • NeverDieN NeverDie

                  @d00616 I hooked up the Fanstel BT832A. Although it appeared to flash and verify correctly, I couldn't get it to do anything--not even blink. Is there any chance that it's downsized flash/memory has something to do with it? "Flash/RAM memories in BT832 are 512KB/64KB. They are 192KB/24KB in BT832A." So, as an experiment, I hooked up a BT832 in its place on the same board, and it's able to transmit and blink just fine. In total, the only differences between the two are:

                  1. Cortex M4F in BT832 has hardware DSP and floating point instructions. Cortex M4 in BT832A has hardware DSP instructions but it does not have floating point unit to support hardware instruction.
                  2. Flash/RAM memories in BT832 are 512KB/64KB. They are 192KB/24KB in BT832A.
                  3. BT832 has NFC tag interface. BT832A does not have NFC tag
                    interface.

                  I think we can rule out #3. So, if it isn't #2, then is perhaps #1 a factor? I wouldn't think so.

                  The solder connections seemed correct. I suppose it's possible I simply got a bad module, but I'm doubtful that's it.

                  Here's a photo of it installed on a BT832X board, which is pin-for-pin compatible:
                  0_1509216144568_BT832A.jpg

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

                  @NeverDie said in nRF5 Bluetooth action!:

                  I think we can rule out #3. So, if it isn't #2, then is perhaps #1 a factor? I wouldn't think so.

                  I think, you have to do more things:

                  1. Change compiler attributes to disable FPU support
                  2. Change the memory layout in linker scripts. Look into boards definition. Linker scripts are placed under ./cores/nRF5/SDK/components/toolchain/gcc/ The SDK14 has scripts supporting the nrf52810
                  3. The SDK14 has an dedicated startup code (gcc_startup_nrf52810.S), I don't know if this relevant for arduino-nrf5

                  I think there is more to do than compile the code. I think the SDK code for arduino-nrf5 must be updated to SDK 14, then a nre MCU must be defined.

                  I have compared the startup code. The difference is in the interrupt vector. It should work with the NRF52832 startup code, but the linker script must be changed.

                  NeverDieN 1 Reply Last reply
                  2
                  • d00616D d00616

                    @NeverDie said in nRF5 Bluetooth action!:

                    I think we can rule out #3. So, if it isn't #2, then is perhaps #1 a factor? I wouldn't think so.

                    I think, you have to do more things:

                    1. Change compiler attributes to disable FPU support
                    2. Change the memory layout in linker scripts. Look into boards definition. Linker scripts are placed under ./cores/nRF5/SDK/components/toolchain/gcc/ The SDK14 has scripts supporting the nrf52810
                    3. The SDK14 has an dedicated startup code (gcc_startup_nrf52810.S), I don't know if this relevant for arduino-nrf5

                    I think there is more to do than compile the code. I think the SDK code for arduino-nrf5 must be updated to SDK 14, then a nre MCU must be defined.

                    I have compared the startup code. The difference is in the interrupt vector. It should work with the NRF52832 startup code, but the linker script must be changed.

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

                    @d00616 Also, at least so far, I haven't been able to get the Fanstel modules to receive anything. At first I thought it must be an LNA thing, but I tried it just now on a Fanstel module without LNA, and although it can transmit and blink just fine, the regular receive code isn't working. Any theories on that?
                    0_1509217353206_BT832.jpg

                    d00616D 1 Reply Last reply
                    0
                    • NeverDieN NeverDie

                      @d00616 Also, at least so far, I haven't been able to get the Fanstel modules to receive anything. At first I thought it must be an LNA thing, but I tried it just now on a Fanstel module without LNA, and although it can transmit and blink just fine, the regular receive code isn't working. Any theories on that?
                      0_1509217353206_BT832.jpg

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

                      @NeverDie said in nRF5 Bluetooth action!:

                      @d00616 Also, at least so far, I haven't been able to get the Fanstel modules to receive anything. At first I thought it must be an LNA thing, but I tried it just now on a Fanstel module without LNA, and although it can transmit and blink just fine, the regular receive code isn't working. Any theories on that?

                      I think this could be the memory layout -> linker script. My try to port Arduino to nrf51 in 2014 is failed at the same state. Blink was ok. Using something with memory are failed. The reason was a wrong linker script. At this time Nordic hasen't released (L)GPG compatible scripts.

                      Edit: I think it's possible to add the 82810 to https://github.com/mysensors/ArduinoHwNRF5 by changing the board definition and add the missing linker script into the variant folder.

                      NeverDieN 1 Reply Last reply
                      1
                      • d00616D d00616

                        @NeverDie said in nRF5 Bluetooth action!:

                        @d00616 Also, at least so far, I haven't been able to get the Fanstel modules to receive anything. At first I thought it must be an LNA thing, but I tried it just now on a Fanstel module without LNA, and although it can transmit and blink just fine, the regular receive code isn't working. Any theories on that?

                        I think this could be the memory layout -> linker script. My try to port Arduino to nrf51 in 2014 is failed at the same state. Blink was ok. Using something with memory are failed. The reason was a wrong linker script. At this time Nordic hasen't released (L)GPG compatible scripts.

                        Edit: I think it's possible to add the 82810 to https://github.com/mysensors/ArduinoHwNRF5 by changing the board definition and add the missing linker script into the variant folder.

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

                        @d00616 I'm puzzled then. The module that you are using (https://www.aliexpress.com/item/NRF52832-Mini-Development-Board-Gold-Core-board-Wireless-Bluetooth-Transceiver-Module/32798618219.html?spm=2114.search0204.3.1.BEAy98&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_10151_5700015_5620015_10130_10068_10344_10345_10547_10342_10546_10343_10340_10341_10548_10545_10541_10307_5640015_10060_10155_10154_10056_10055_10539_10538_5370015_10537_10536_10059_10534_10533_100031_10103_10102_10142_10107_10324_10325_5760015_10084_10083_10178_5750015_10312_10313_10314_10073_5630015,searchweb201603_30,ppcSwitch_4_ppcChannel&btsid=011daf01-f75a-4448-9202-405ef9dcacd9&algo_expid=acb605b8-ed11-4497-8757-d77cd4b3550b-0&algo_pvid=acb605b8-ed11-4497-8757-d77cd4b3550b) allegedly comes with 512k flash and 64k ram. So, what, if any, difference is there between that and the Fanstel module with the same amount of flash and ram?

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

                          OK, I need to confirm it, but I have a theory now that the Fanstel modules don't have 32K clock crystals in them. That would explain why that have pinouts for XTAL1 and XTAL2. It might also be hanging my code, which assumes there is a clock crystal and tries to turn it on. My using pin P0.02 to control the LED might be a deadly brew that causes the hang. I'll post a follow-up if that's what turns out to be the actual root of what superficially seemed like an "Rx problem."

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

                            It's confirmed. Son of a gun, they don't have the 32K clock crystal on the module. On the datasheet, it says that for battery operation, "We suggest adding a 32.768 kHz crystal and 2 capacitors as shown in the upper left corner of the evaluation board schematics."

                            I'll add pads for it on the breakout board.

                            1 Reply Last reply
                            1
                            • NeverDieN NeverDie

                              OK, I need to confirm it, but I have a theory now that the Fanstel modules don't have 32K clock crystals in them. That would explain why that have pinouts for XTAL1 and XTAL2. It might also be hanging my code, which assumes there is a clock crystal and tries to turn it on. My using pin P0.02 to control the LED might be a deadly brew that causes the hang. I'll post a follow-up if that's what turns out to be the actual root of what superficially seemed like an "Rx problem."

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

                              @NeverDie said in nRF5 Bluetooth action!:

                              My using pin P0.02 to control the LED might be a deadly brew that causes the hang.

                              Correction: Use of P0.02 to control the LED shouldn't be a problem, as it corresponds to AIN0 and isn't involved in XTAL. Therefore, I edited the original post to strike-through this sentence.

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

                                Good news! Switching over to the RC oscillator totally fixed the problem. Both the Fanstel BT832 and BT832X now receive just fine. :)

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

                                  In fact, both the Fanstel BT832 and the BT832X (with no LNA turned on) have much better receive range than an Ebyte module. They are head and shoulders better. In turn the BT832X (again, even with no LNA turned on) has a noticeably better receive range than the BT832.

                                  So, at this point, I'm sold on the Fanstel modules for the most common uses. The Fanstel modules also have a smaller footprint than the Ebyte modules. The Ebyte modules might be better for those cases where you need a lot of easily accessible pins to do something, but that's about it I think.

                                  Nca78N T 2 Replies Last reply
                                  0
                                  • NeverDieN NeverDie

                                    In fact, both the Fanstel BT832 and the BT832X (with no LNA turned on) have much better receive range than an Ebyte module. They are head and shoulders better. In turn the BT832X (again, even with no LNA turned on) has a noticeably better receive range than the BT832.

                                    So, at this point, I'm sold on the Fanstel modules for the most common uses. The Fanstel modules also have a smaller footprint than the Ebyte modules. The Ebyte modules might be better for those cases where you need a lot of easily accessible pins to do something, but that's about it I think.

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

                                    @NeverDie said in nRF5 Bluetooth action!:

                                    In fact, both the Fanstel BT832 and the BT832X (with no LNA turned on) have much better receive range than an Ebyte module. They are head and shoulders better. In turn the BT832X (again, even with no LNA turned on) has a noticeably better receive range than the BT832.

                                    So, at this point, I'm sold on the Fanstel modules for the most common uses. The Fanstel modules also have a smaller footprint than the Ebyte modules. The Ebyte modules might be better for those cases where you need a lot of easily accessible pins to do something, but that's about it I think.

                                    Now we need to convince Fanstel to find another shipping method outside the US :D

                                    JokgiJ 1 Reply Last reply
                                    0
                                    • NeverDieN NeverDie

                                      In fact, both the Fanstel BT832 and the BT832X (with no LNA turned on) have much better receive range than an Ebyte module. They are head and shoulders better. In turn the BT832X (again, even with no LNA turned on) has a noticeably better receive range than the BT832.

                                      So, at this point, I'm sold on the Fanstel modules for the most common uses. The Fanstel modules also have a smaller footprint than the Ebyte modules. The Ebyte modules might be better for those cases where you need a lot of easily accessible pins to do something, but that's about it I think.

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

                                      @NeverDie it looks like we found an ideal gateway.
                                      What about the code they provide to activate PA+LNA?
                                      Can it be used in mysensors?

                                      NeverDieN 2 Replies Last reply
                                      0
                                      • NeverDieN Offline
                                        NeverDieN Offline
                                        NeverDie
                                        Hero Member
                                        wrote on last edited by
                                        #1238

                                        I tried out the sub-dime sized BC832 on a quick port of the BC832X breakout board:
                                        0_1509402087595_bc832.jpg

                                        What I'm finding is that the Rx range for the BC832 is about the same as for the Ebyte nRF52832 module: I'm hard pressed to tell which is better than the other. The BC832 is nonetheless impressive, given how small its antenna is relative to the Ebyte antenna.

                                        1 Reply Last reply
                                        2
                                        • T Toyman

                                          @NeverDie it looks like we found an ideal gateway.
                                          What about the code they provide to activate PA+LNA?
                                          Can it be used in mysensors?

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

                                          @Toyman said in nRF5 Bluetooth action!:

                                          it looks like we found an ideal gateway.

                                          Agreed. :)

                                          @Toyman said in nRF5 Bluetooth action!:

                                          What about the code they provide to activate PA+LNA?

                                          I only extracted the needed info from their code to make it work. It works just fine with mysensors. For instance, here's mysensors code to activate the PA:

                                          #define PA_PIN 17
                                          #define CPS_PIN 6
                                          #define LNA_PIN 19 
                                          
                                            myNrf5_pinMode(CPS_PIN,OUTPUT_H0H1);
                                            digitalWrite(CPS_PIN,HIGH);  //disable.  Active LOW
                                            //while (!(digitalRead(CPS_PIN)==HIGH)) {} //wait until confirmed
                                             
                                            myNrf5_pinMode(LNA_PIN,OUTPUT_H0H1);
                                            digitalWrite(PA_PIN,LOW);  //disable.  active HIGH
                                            //while (!(digitalRead(LNA_PIN)==LOW)) {} //wait until confirmed
                                            
                                            myNrf5_pinMode(PA_PIN,OUTPUT_H0H1);  
                                            digitalWrite(PA_PIN,HIGH);  //enable.  active HIGH
                                            //while (!(digitalRead(PA_PIN)==HIGH)) {} //wait until confirmed
                                          
                                            //myNrf5_pinMode(CPS_PIN,OUTPUT_H0H1);  
                                            digitalWrite(CPS_PIN,LOW);  //enable.  active LOW
                                            //while (!(digitalRead(CPS_PIN)==LOW)) {} //wait until confirmed
                                          

                                          I've tested it, and it works. From my testing it appears that the pins are write-only (which is why the while loops are now commented out).

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


                                          8

                                          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