nRF5 action!
-
@scalz
Are you sure? I just tried compiling the SerialGateway example inside the Arduino IDE with the board set to "Adafruit Bluefruit NRF52 Feather, " and it won't even compile. Looking at mysensors.h file, I think I can see why:// Enable radio "feature" if one of the radio types was enabled #if defined(MY_RADIO_NRF24) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) #define MY_SENSOR_NETWORK #endif // HARDWARE #if defined(ARDUINO_ARCH_ESP8266) #include "core/MyHwESP8266.cpp" #elif defined(ARDUINO_ARCH_AVR) #include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h" #include "core/MyHwAVR.cpp" #elif defined(ARDUINO_ARCH_SAMD) #include "core/MyHwSAMD.cpp" #elif defined(__linux__) #include "core/MyHwLinuxGeneric.cpp" #endifThe library seems to have no recognition capability for either the NRF52 nor for any board based on it.
What do I need to modify to get it to work? Anyone know?
-
@scalz
Are you sure? I just tried compiling the SerialGateway example inside the Arduino IDE with the board set to "Adafruit Bluefruit NRF52 Feather, " and it won't even compile. Looking at mysensors.h file, I think I can see why:// Enable radio "feature" if one of the radio types was enabled #if defined(MY_RADIO_NRF24) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) #define MY_SENSOR_NETWORK #endif // HARDWARE #if defined(ARDUINO_ARCH_ESP8266) #include "core/MyHwESP8266.cpp" #elif defined(ARDUINO_ARCH_AVR) #include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h" #include "core/MyHwAVR.cpp" #elif defined(ARDUINO_ARCH_SAMD) #include "core/MyHwSAMD.cpp" #elif defined(__linux__) #include "core/MyHwLinuxGeneric.cpp" #endifThe library seems to have no recognition capability for either the NRF52 nor for any board based on it.
What do I need to modify to get it to work? Anyone know?
-
Yveaux is right, you need to use development branch of Mysensors, and just need to enable this define:
#define MY_RADIO_NRF5_ESBYou can also get more details here:
https://www.openhardware.io/view/376/MySensors-NRF5-Platform -
I had been using the publicly released Mysensors library, but after your suggestions I switched over to the developers release.
So, now a new obstacle: if I compile using the board set as an Adafruit Bluefruit nRF52 Feather, I get the following fatal compile error:
Build options changed, rebuilding all In file included from C:\Users\CoolerMaster\Documents\Arduino\mysensors sketches\GatewaySerial_v002\GatewaySerial_v002.ino:85:0: C:\Users\CoolerMaster\Documents\Arduino\libraries\MySensors/MySensors.h:352:2: error: #error No support for nRF5 radio on this platform #error No support for nRF5 radio on this platform ^ exit status 1 Error compiling for board Adafruit Bluefruit nRF52 Feather.However, if I switch over to the "Generic nRF52" board from Nordic Semiconductor, it compiles just fine, but it hangs while uploading. :(
-
@NeverDie
yep that's what i was talking, regarding adafruit&core in board manager.
That would be easier to just use sandeep core only (as adafruit core is an extension using bootloader), and then use one of the boards available for nrf52.You could try that :
- select NRF52 generic or DK in board manager (so this uses sandeep core)
- Select Softdevice : no
- Programmer : J-link
- Connect SWD programmer
- upload sketch
this should work, you'll just loose the adafruit bootloader feature i think.
-
I tried using the ST-LINK V2 programmer that I got from Amazon, but I think maybe (?) it's junk: almost nothing seems to recognize it after I've plugged it in. I've installed the USB driver for it from the ST website, and I've tried connecting to it using the ST-LINK utility program. It did recognize it long enough to identify its firmware and to actually (or so it said) upgrade its firmware to the current version. However, even that program can't seem to "connect" with it for anything else other than upgrading the firmware. Arduino doesn't see it at all.
So, maybe I need a better programmer? Is the DK for the 52832 from Nordic the one to get, or should I get something else (preferably something which might also work with the 52840 when that becomes available)?
An actual J-Link from Segger is priced at >$400. Are the cheap Aliexpress knock-offs just as good?
https://www.aliexpress.com/item/V9-the-LINK-J-LINK-ARM-emulator-support-A9A8-V9-4-high-speed-download-speed/32806221560.html?spm=2114.01010208.3.1.JlcJUT&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10082_10081_10110_10178_10136_10137_519_10111_10060_10112_10113_10155_10114_437_10154_10056_10055_10054_10182_10059_303_100031_10099_10078_10079_10103_10073_10102_10120_10052_10053_10142_10107_142_10050_10051,searchweb201603_49,ppcSwitch_4&btsid=55ccaf9e-4381-4041-87de-32344016ca8e&algo_expid=281f8f71-cf63-4236-b1e7-4fbf7703f3dc-0&algo_pvid=281f8f71-cf63-4236-b1e7-4fbf7703f3dc -
So, I went ahead and ordered this:
https://www.aliexpress.com/store/product/1PC-JLI-V9-J-LINK-ARM-emulator-support-A9A8-V9-3-high-speed-download/1710342_32790881245.html?spm=2114.12010615.0.0.5qtBo0since it has e-packet delivery. Hopefully it's not a complete waste of money. Unfortunately, I guess there's not much more I can do until it arrives....
Anything else I should get to go with it? Like maybe:
https://www.amazon.com/ARM-JTAG-20-10-ARM-Micro-JTAG-adapter/dp/B009UEO9ZY/ref=pd_sim_21_1?_encoding=UTF8&pd_rd_i=B009UEO9ZY&pd_rd_r=C8G4T1QSJT3YVC6CQADF&pd_rd_w=CsX9i&pd_rd_wg=OIb04&psc=1&refRID=C8G4T1QSJT3YVC6CQADF
and/or
https://www.amazon.com/Gikfun-J-link-Emulator-Adapter-Converter/dp/B00RBHOSTY/ref=pd_sim_21_3?_encoding=UTF8&pd_rd_i=B00RBHOSTY&pd_rd_r=C8G4T1QSJT3YVC6CQADF&pd_rd_w=CsX9i&pd_rd_wg=OIb04&psc=1&refRID=C8G4T1QSJT3YVC6CQADF
and/or something else?Is there by any chance some kind of bit-bang equivalent that someone has already developed? With arduino's being so cheap, I'd think there'd be a way to use one as a programmer, or at least as some kind of uploader, to an ARM mcu. I mean, how hard can it be?
-
Since it seems I'll be forced to use a programmer, the adafruit advantages completely go out the window. Therefore, I ordered a couple of these, which will probably (?) be just as good in the end, but a whole lot cheaper:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=2114.01010208.3.17.YON8eD&ws_ab_test=searchweb0_0&aff_platform=aaf&cpt=1499046377472&sk=e2Vzr3v&aff_trace_key=0cb03246d5ed4112b865663460b55419-1499046377472-08913-e2Vzr3vI like that they have through-holes and not just castellated connectors. That will make them much easier to wire up.
-
I also ordered this as my final insurance in case the J-Link Segger knock-off turns out not to work:
https://www.aliexpress.com/item/2PCS-LOT-Link-OB-ARM-emulator-debugger-j-link-programmierer-downloader-link-statt-V8-SWD-Best/32813752595.html?spm=2114.13010608.0.0.RyKjDrIf none of that extra hardware works, then I'll probably switch to Linux to see if I have more luck using that instead of Windows.
-
Thanks! I'll give that a try.
BTW, I noticed this nRF52830 module, which is interesting because it includes a trace antenna and is allegedly just 15.4mmx15.4mm in size: https://www.aliexpress.com/item/PTR5618-Nordic-nRF52832-Module-BLE-4-0-Module-Free-shipping/32758284869.html?spm=2114.10010108.100009.2.98oryP&traffic_analysisId=recommend_2037_null_null_null&scm=1007.13482.37805.0&pvid=c8de9a80-7258-4a83-a683-1ef7c7104607&tpp=1
Granted, it doesn't expose as many pins though. -
@NeverDie
oki cool.
Raytac has also modules with pcb antenna, and interestingly, from their datasheet, perform worse than their chip antenna version.
I prefer to clarify it a bit! We can't say pcb antenna are always better than chip antenna. :)
But it's sure that you can't get the best performance with an antenna which is not adapted to the usecase.
Also, when doing very tiny pcb, the gnd plane can be too small regarding the wavelength etc, decreasing even more the antenna efficiency.
The more tiny, the less range..that's not a problem for a wearable, that you wear, close to your phone. -
@NeverDie
I think this is because you need to install Zadig, open it, choose your swd programmer in list and change the driver. Then it should work.@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
@NeverDie
I think this is because you need to install Zadig, open it, choose your swd programmer in list and change the driver. Then it should work.Ok, I tried this just now. The good news is that Zadig recognizes the ST-LINK V2 usb dongle when I plug it in (it shows up at "STM32 STLink"). The bad news is that I'm not sure which of those drivers I should install. Following the SandeepMistry directions on github, there is nothing called "Interface 2" that I can see. So, I tried all four USB drivers, each in turn, that Zadig offers up, but with none of them does the Arduino IDE subsequently recognize the St-LINK V2 dongle.
So, it does seem like I'm getting closer, thanks to your suggestions, but I'm still not there yet. Any more suggestions?
-
Also, Sandeep's preceding directions call for:
Download mbed Windows Serial driverMaybe this is where it all falls apart. I'm able to download the driver, but I can't install it. When I try to, the installation quickly terminations and I get the following error message: "the driver could not be installed. No mbed microcontrollers were found."
-
@NeverDie
oki cool.
Raytac has also modules with pcb antenna, and interestingly, from their datasheet, perform worse than their chip antenna version.
I prefer to clarify it a bit! We can't say pcb antenna are always better than chip antenna. :)
But it's sure that you can't get the best performance with an antenna which is not adapted to the usecase.
Also, when doing very tiny pcb, the gnd plane can be too small regarding the wavelength etc, decreasing even more the antenna efficiency.
The more tiny, the less range..that's not a problem for a wearable, that you wear, close to your phone.@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
Also, when doing very tiny pcb, the gnd plane can be too small regarding the wavelength etc, decreasing even more the antenna efficiency.
The more tiny, the less range..that's not a problem for a wearable, that you wear, close to your phone.As long as it's within range of a gateway, then it's good enough. Fortunately, it's really cheap to make gateways using ESP8266's, so you can have lots of gateways sprinkled around if needed. Of course, that's yet another trade-off, as it's not free, and it's arguably not even desirable either. Still, for tiny antenna's (like maybe for a soil moisture sensor in an indoor flower pot), being inconspicuous may make it worth the price.
-
Anyone here ever gotten the st-link v2 to work with the arduino and nRF52832? Seems like most published instructions pertain to the J-Link instead.
-
I'm cutting my losses. The googling I've done on this issue is not giving me much reason for optimism about the use of an ST-LINK V2 for this configuration. In fact, just the opposite.
I may get the DK to tide me over until the Segger J-Link and the other hardware arrives.
-
Just noticed that the ESP32S integrates both Wi-Fi and Bluetooth BLE. I guess it's not exactly on-point with what we're discussing here, as I doubt (?) it includes Nordic's proprietary radio modes that mysensors will be using (instead of Bluetooth BLE per se) in the nRF52832, but, golly gee, for just $5, that sounds like quite a package!
http://www.ebay.com/itm/ESP-32S-ESP32-WLAN-BLE-IoT-Modul-Dual-Core-CPU-Ethernet-Port-MCU-ESP8266-/182490173587?hash=item2a7d431093:g:7YIAAOSw4YdYyQW8If Mysensors ever did use BLE, I'd imagine it might make an excellent gateway (and cheap enough that you could easily afford quite a number of them to, say, guarantee solid radio communications throughout your house).
Why is it that mysensors is opting for the Nordic proprietary mode instead of the BLE standard? Is it just too cumbersome or something?
-
@NeverDie
Mysensors isn't opting especially for "nordic mode".
You're mixing a bit things.. So far Mysensors was using nrf24, and the nrf52 is compatible. That's all! Pretty cool to have the feature available i think.
Then, regarding, BLE etc, i can only say, there might be some nice feature in future, but that will need some patience ;) BLE is another protocol like Mysensors is.Yep, esp32 is very nice, and i like my "Halo" esp32 gw. But I wouldn't use it without a strong battery, the radio modes are too much power hungry..
-
Anyone here ever gotten the st-link v2 to work with the arduino and nRF52832? Seems like most published instructions pertain to the J-Link instead.
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Anyone here ever gotten the st-link v2 to work with the arduino and nRF52832? Seems like most published instructions pertain to the J-Link instead.
Yes, but I use Linux. I have all three supported programmers working. After adding an udev rule to fix permissions for any type of adapter they working very well. If you haven't luck, the CMSIS-DAP is an alternative to ST-Link or J-Link.
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Why is it that mysensors is opting for the Nordic proprietary mode instead of the BLE standard? Is it just too cumbersome or something?
There are some reasons I haven't implemented Nordics proprietary standard and I have no intension to use BLE as MySensors transport.
Like @scalz I think MySensors is a protocol and BLE is another protocol. MySensors is optimized to build a network of up to 255 nodes can communicate with low latency and BLE is a complex protocol for a limited number of nodes. There are a lot of use cases for both.
In my opinion, Nordic's BLE code and SDK is not Open Source friendly. I think you can't create LGPL code based on Nordics BLE SDK examples. To Compile code, you have to agree Nordics License or you have to choose.
For MySensors, I think the Apache implementation NimBLE should a good BLE implementation to start with. This Implementations looks more efficient than Nordics implementation and I like the OTA update/bootloader concept. At https://www.kickstarter.com/projects/redbearinc/bluetooth-5-ready-ble-module-nano-2-and-blend-2 is a demo video of a 32 node BLE network. It looks like there is a high latency in communication.
To support Nordics SoftDevice or another BLE implementation, the MySensors nRF5 code must be extended to use the hardware abstraction for e.g. random number generation, accessing flash memory or interrupt handling. When it's done a MY_RADIO_NRF5_BLE can be implemented.
Another option could be to use BLE packages without the BLE protocol, then its possible to communicate with any BLE MCU which allows direct access to the radio. Actually you can use the ESB protocol with BLE modulation, but I think this is incompatible to other BLE MCU.
BTW: The nRF52840 cannot communicate with 250kbit nRF24. This rate is depreciated since nRF52822 release.