<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[nRF5 action!]]></title><description><![CDATA[<p dir="auto"><strong>[Edit:  skip forward toward the end of this thread for the bluetooth action.  The thread started on a different topic.  ]</strong></p>
<p dir="auto"><strong>Objective</strong>: Start with the design of the Sparkfun SAMD21 mini board (<a href="https://www.sparkfun.com/products/13664" rel="nofollow ugc">https://www.sparkfun.com/products/13664</a>) , which is a TQFP48, and see if I can port it to the SAMD21 TQFP32.  Why?  Pitch on the TQFP48 is 0.5mm, whereas on the TQFP32 it's 0.8.  So, I'm theorizing that the TQFP32 will be easier to solder.</p>
<p dir="auto"><strong>Motivation:</strong>  If I can get this working, then I hope to use it as a basic building block for making wireless nodes.</p>
<p dir="auto"><strong>Approach for first attempt</strong>:  I started with the Sparkfun schematic (<a href="https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/sparkfun-samd21-mini-breakout-v10.pdf" rel="nofollow ugc">https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/sparkfun-samd21-mini-breakout-v10.pdf</a> and tried maintaining the same pin mapping using the TQFP32.  The result was:<a href="/assets/uploads/files/1496686680932-schematic_for_samd21_tqfp32_pro_mini-_v001.pdf">0_1496686682351_Schematic_for_SAMD21_TQFP32_Pro_Mini _v001.pdf</a></p>
<p dir="auto">From this it becomes evident that the TQPF32 version is lacking four pins that the TQFP48 version has, namely, pins: PA20, PA21, PB08, and PB09.  However, the TQFP32 version has seven pins that aren't presently being used, namely:  PA05, <s>PA22, PA23, PA24, PA25, PA27, and PA28.</s></p>
<p dir="auto">So, I'm thinking I will simply use four of the seven pins to cover for the 4 pins which the TQFP32 lacks that the TQFP48 has.</p>
<p dir="auto">Questions:</p>
<ol>
<li>Does it matter which of the six pins I use for this purpose?</li>
<li>What is the value for the inductor shown in the sparkfun schematic?  It shows "30 ohms,"  but shouldn't the unit of measure be in Henries?</li>
</ol>
]]></description><link>https://forum.mysensors.org/topic/6961/nrf5-action</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 07:48:43 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/6961.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jun 2017 18:27:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to nRF5 action! on Fri, 01 Jul 2022 20:07:38 GMT]]></title><description><![CDATA[<p dir="auto">Success!  Treating the nRF52805 like an nRF52810 and uploading to it from Segger Embedded Studio's IDE using Nordic's  nRF52 SDK's PCA10040e board definition, then pin P.18 blinks using the same sketch that blinked P.18 on the nRF52832.  I'm <strong>reporting back</strong> with this good news, because I haven't seen it tried or documented anywhere before.  At least for this modest first attempt, this <em>simple</em> spoof works!  At $2.50 each, these tiny nRF52805 modules with their trace antennas are a good value.</p>
<p dir="auto">By the way, the compiler that's built into Segger Embedded Systems is <strong>super fast</strong> compared to gcc.</p>
]]></description><link>https://forum.mysensors.org/post/112510</link><guid isPermaLink="true">https://forum.mysensors.org/post/112510</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Fri, 01 Jul 2022 20:07:38 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Fri, 01 Jul 2022 15:18:40 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Reporting back:</strong>  As a first step I programmed an external nRF52832 by blinking P.18 using this method for wiring it up:  <a href="https://devzone.nordicsemi.com/f/nordic-q-a/14058/external-programming-using-nrf52-dk" rel="nofollow ugc">https://devzone.nordicsemi.com/f/nordic-q-a/14058/external-programming-using-nrf52-dk</a>  This method of wiring is worthy of note all by itself, because prior to now the conventional wisdom was that the target mcu had to be separately, externally powered for the J-link on the DK to recognize it properly.  With the illustrated approach to wiring it up, though, you can power it from the DK itself.<br />
<img src="/assets/uploads/files/1656688604687-better_wiring.png" alt="better_wiring.png" class=" img-fluid img-markdown" /><br />
Nice.</p>
<p dir="auto">That worked just fine.  Then I tried uploading exactly the same code, using the same wiring scheme, to the nRF52805.  I even erased it beforehand just to be sure.<br />
According to J-Link, both the erasure and the subsequent upload were successful.  However, P.18 does not blink.  So, it would appear that a straightforward upload by treating it like an nRF52832 just isn't going to work, even just for blinking a particular pin.  Argh!  I feared as much. Disappointing!</p>
]]></description><link>https://forum.mysensors.org/post/112509</link><guid isPermaLink="true">https://forum.mysensors.org/post/112509</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Fri, 01 Jul 2022 15:18:40 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Fri, 01 Jul 2022 15:05:46 GMT]]></title><description><![CDATA[<p dir="auto">Anyone here programmed an nRF52805?  I made a breakout board for one and was planning to program it using the J-LINK on an nRF52-DK:<br />
<img src="/assets/uploads/files/1656631227861-nrf52805-resized.jpg" alt="nrf52805.JPG" class=" img-fluid img-markdown" /><br />
but because there is no official DK for the nRF52805, there is no "board" for it, and so I'm unclear as to how exactly it is supposed to be programmed.  Segger Embedded Studio makes no mention of the nRF52805 at all, as near as I can tell.  Fortunately, our old friend Sandeep Mistry does appear to have a core for it:  <a href="https://github.com/sandeepmistry/arduino-nRF5/tree/master/cores/nRF5/SDK/components/device" rel="nofollow ugc">https://github.com/sandeepmistry/arduino-nRF5/tree/master/cores/nRF5/SDK/components/device</a><br />
so that may help save the day.  Unfortunately, the nRF52805 upload instructions from Nordic are a hassle:  <a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/developing-for-the-nrf52805-with-nrf5-sdk" rel="nofollow ugc">https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/developing-for-the-nrf52805-with-nrf5-sdk</a>  Is there no easier way?</p>
]]></description><link>https://forum.mysensors.org/post/112508</link><guid isPermaLink="true">https://forum.mysensors.org/post/112508</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Fri, 01 Jul 2022 15:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 23 Jun 2022 21:15:19 GMT]]></title><description><![CDATA[<p dir="auto">I received the CLUE and it works very nicely--just like you'd expect a proper Arduino board to work: some basic hardware abstraction, a familiar easy-to-use Arduino IDE, easy familiar compiles, easy familiar uploads, and easy familiar access to serial input/output.</p>
<p dir="auto">Time flies!  This thread is already 5 years old, but I'm re-reading it now to refresh myself on all the little details that  I've forgotten.</p>
]]></description><link>https://forum.mysensors.org/post/112462</link><guid isPermaLink="true">https://forum.mysensors.org/post/112462</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Thu, 23 Jun 2022 21:15:19 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 22 Jun 2022 17:05:42 GMT]]></title><description><![CDATA[<p dir="auto">I've ordered an Adafruit Clue, which should be arriving today.  It utilizes the nRF52840.  Judging from the reviews, Adafruit has done a nice job of supporting both the Clue and the Clue's vast number of built-in sensors with 1. good adafruit library integration along with lots of example programs and 2. the adafruit bootloader, making it easy for beginners to program the Clue via the familiar Arduino IDE.  For those just getting started, I think it's likely to be a more satisfying experience and a gentler introduction to nRF5x than buying a nRF5x DK and then wondering what to do next.</p>
]]></description><link>https://forum.mysensors.org/post/112446</link><guid isPermaLink="true">https://forum.mysensors.org/post/112446</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Wed, 22 Jun 2022 17:05:42 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 07 Apr 2021 23:16:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jon-raymond" aria-label="Profile: Jon-Raymond">@<bdi>Jon-Raymond</bdi></a> Well, not seeing a lot of activity in the repo.</p>
<p dir="auto">I took a very long shot at adding support <a href="https://github.com/nikolac/arduino-nRF5/tree/nrf52805-s112-support" rel="nofollow ugc">https://github.com/nikolac/arduino-nRF5/tree/nrf52805-s112-support</a>.</p>
<p dir="auto">I was able to flash the softdevice, but I haven't tested or even uploaded a working sketch (sloppy). Feel free to mess around and test. If it works for you, I do the same for S113.</p>
<p dir="auto">Biggest question I have is around figuring out the proper values for the "linker scripts" <a href="https://github.com/nikolac/arduino-nRF5/blob/nrf52805-s112-support/cores/nRF5/SDK/components/softdevice/s112/toolchain/armgcc/armgcc_s112_nrf52805_xxaa.ld" rel="nofollow ugc">https://github.com/nikolac/arduino-nRF5/blob/nrf52805-s112-support/cores/nRF5/SDK/components/softdevice/s112/toolchain/armgcc/armgcc_s112_nrf52805_xxaa.ld</a></p>
]]></description><link>https://forum.mysensors.org/post/109818</link><guid isPermaLink="true">https://forum.mysensors.org/post/109818</guid><dc:creator><![CDATA[ncollins]]></dc:creator><pubDate>Wed, 07 Apr 2021 23:16:05 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Tue, 06 Apr 2021 14:02:12 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/ncollins" aria-label="Profile: ncollins">@<bdi>ncollins</bdi></a>.  I created the <a href="https://github.com/sandeepmistry/arduino-nRF5/issues/456" rel="nofollow ugc">issue</a> as requested.</p>
]]></description><link>https://forum.mysensors.org/post/109803</link><guid isPermaLink="true">https://forum.mysensors.org/post/109803</guid><dc:creator><![CDATA[Jon Raymond]]></dc:creator><pubDate>Tue, 06 Apr 2021 14:02:12 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 31 Mar 2021 20:08:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jon-raymond" aria-label="Profile: Jon-Raymond">@<bdi>Jon-Raymond</bdi></a> the nRF52805 should support the S112 and S113 soft device, but I removed it from the menu because I never tested it and didn't intend to immediately use it.</p>
<p dir="auto">Digging through sandeepmistry/arduino-nrf5, it looks like S112 and S113 aren't included in the SDK. It might be easy enough to just drop in two new folders, then update boards.txt.</p>
<p dir="auto"><img src="/assets/uploads/files/1617220667814-e0a17f79-2edd-4750-a4c5-21ff33c8a1a0-image.png" alt="e0a17f79-2edd-4750-a4c5-21ff33c8a1a0-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1617220994573-6fba7886-f4c1-4b5b-aaa9-9e699ab7ff4e-image.png" alt="6fba7886-f4c1-4b5b-aaa9-9e699ab7ff4e-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">(Just an example of how I would add a soft device option to the dropdown, these would have to match up with whatever is in the sdk)</p>
<p dir="auto">I would recommend opening an issue/question on <a href="https://github.com/sandeepmistry/arduino-nRF5" rel="nofollow ugc">https://github.com/sandeepmistry/arduino-nRF5</a>, specifically asking the best way to add a new softdevice to the library. If it's straightforward, I can work with you to get those changes incorporated and, hopefully, included in the merge request.</p>
]]></description><link>https://forum.mysensors.org/post/109737</link><guid isPermaLink="true">https://forum.mysensors.org/post/109737</guid><dc:creator><![CDATA[ncollins]]></dc:creator><pubDate>Wed, 31 Mar 2021 20:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 31 Mar 2021 15:12:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ncollins" aria-label="Profile: ncollins">@<bdi>ncollins</bdi></a> Here is my version of a breakout for the nRF52805.</p>
<p dir="auto"><img src="/assets/uploads/files/1617203072044-pxl_20210331_040531693-resized.jpg" alt="PXL_20210331_040531693.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Been playing around with your fork/pull request and I do have one question.</p>
<p dir="auto">Should there be a SoftDevice for this? <a href="https://www.nordicsemi.com/Software-and-tools/Software/S112" rel="nofollow ugc">According to Nordic</a> it needs either S112 or S113 for BLE to function? Right now your pull request only has the "None" option in the SoftDevice menu.</p>
<p dir="auto">Is this something you have run into? Do you have any example code that you are running on this module?  Thanks again for your work in getting this device supported.</p>
]]></description><link>https://forum.mysensors.org/post/109733</link><guid isPermaLink="true">https://forum.mysensors.org/post/109733</guid><dc:creator><![CDATA[Jon Raymond]]></dc:creator><pubDate>Wed, 31 Mar 2021 15:12:46 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 18 Mar 2021 17:43:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jon-raymond" aria-label="Profile: Jon-Raymond">@<bdi>Jon-Raymond</bdi></a> I pushed my latest changes, posted a question to the merge about next steps.</p>
]]></description><link>https://forum.mysensors.org/post/109665</link><guid isPermaLink="true">https://forum.mysensors.org/post/109665</guid><dc:creator><![CDATA[ncollins]]></dc:creator><pubDate>Thu, 18 Mar 2021 17:43:36 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 18 Mar 2021 17:42:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ncollins" aria-label="Profile: ncollins">@<bdi>ncollins</bdi></a> That's great, thanks!</p>
]]></description><link>https://forum.mysensors.org/post/109664</link><guid isPermaLink="true">https://forum.mysensors.org/post/109664</guid><dc:creator><![CDATA[Jon Raymond]]></dc:creator><pubDate>Thu, 18 Mar 2021 17:42:37 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 18 Mar 2021 17:20:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jon-raymond" aria-label="Profile: Jon-Raymond">@<bdi>Jon-Raymond</bdi></a> I kinda got hung up on the last conversation in the merge request and haven't looked at it since. Let me push the changes I have to address the other comments, then try to figure out how to best handle that last bit.</p>
]]></description><link>https://forum.mysensors.org/post/109663</link><guid isPermaLink="true">https://forum.mysensors.org/post/109663</guid><dc:creator><![CDATA[ncollins]]></dc:creator><pubDate>Thu, 18 Mar 2021 17:20:16 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 18 Mar 2021 17:00:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ncollins" aria-label="Profile: ncollins">@<bdi>ncollins</bdi></a> Hey any update on your NRF52805 Breakout work?  I've got a couple of the Ebyte modules that I have been playing around with. Found your pull request on GitHub for board support in sandeepmistry's  <a href="https://github.com/sandeepmistry/arduino-nRF5/pull/442" rel="nofollow ugc">nrf5 core</a>. Wondering if you got any further as the pull request hasn't been merged and it would be great to see Arduino support for these modules.</p>
]]></description><link>https://forum.mysensors.org/post/109662</link><guid isPermaLink="true">https://forum.mysensors.org/post/109662</guid><dc:creator><![CDATA[Jon Raymond]]></dc:creator><pubDate>Thu, 18 Mar 2021 17:00:09 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 11 Feb 2021 07:17:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/acb" aria-label="Profile: acb">@<bdi>acb</bdi></a> said in <a href="/post/109108">nRF5 action!</a>:</p>
<blockquote>
<p dir="auto">As far as a step-by-step with actual example code, demo files, etc. I’m more than happy to do it but it’ll take me some time.  And would be helped if you could specify a particular board you’d like me to target (especially if I have one lying around), e.g. Nordic’s nRF52840 Dongle, Ebyte module, etc?</p>
</blockquote>
<p dir="auto">Yes to nRF52840.  Dealer's choice as to which nRF52840 module--i.e. I'm neutral, so whatever is more convenient for you.  I suppose for others reading this the dongle might be a good choice though.</p>
<blockquote>
<p dir="auto">The other side of this is the FreeRTOS side.  Would you like examples for the lowest possible power?</p>
</blockquote>
<p dir="auto">Is FreeRTOS definitely required?  I suppose I could live with it, but as a simple demo even just some simple code that did nothing more than blink an LED and which resided where the bootloader out to be and which got loaded  automatically from protected memory on reset as though it were a real bootloader is sufficient.  If I knew how to do that one small thing, then I presume I could extend it to be a real wireless bootloader instead of just an LED blinker.  I'm just missing the info on how to put code into the privileged and normally protected bootloader location.  I'm hoping it's actually pretty simple and straightforward and not something lengthy and complex like the way the Nordic SDK advocates doing it.</p>
]]></description><link>https://forum.mysensors.org/post/109130</link><guid isPermaLink="true">https://forum.mysensors.org/post/109130</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Thu, 11 Feb 2021 07:17:31 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 10 Feb 2021 15:45:07 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/neverdie" aria-label="Profile: NeverDie">@<bdi>NeverDie</bdi></a>, I appreciate that.</p>
<p dir="auto">Okay, well, the short answer to your question is yes, it’s a “linker directive” or rather a series of them, usually a file with the .ld extension.  There’s normally a general stack/heap/etc. one called nrf_common.ld in Adafruit’s BSP, and then an architecture-specific one: nrf52.ld I think for the nRF52832 and nrf52840.ld for, well, I bet you can guess! ;)</p>
<p dir="auto">This architecture-specific linker directive contains the memory locations for things like the MBR, ram region for the bootloader, initialized and (shared) non-init RAM, bootloader settings/configuration, MBR parameters, etc.  The bootloader itself can of course read this memory allocation/settings/configuration data and then load any new application code or indeed new bootloader code wherever it needs to be.  That’s why it’s best to let the bootloader perform the FOTA, either via serial or BLE.</p>
<p dir="auto">Now I’m guessing here, but ideally, the arduino-NVM library that sort of emulates AVR EEPROM for MySensors could just read this information too and store it’s virtual EEPROM pages around these allocations.  Currently, I think it just tries to determine the top application page address from the UICR and then allocate the pages based on that.  It’s been a while since I looked at the code, so it might have changed.  Essentially, it’s trying to find where the bootloader starts (if there is one) and allocate some pages a bit back from there to be safe.</p>
<p dir="auto">In theory, a large enough application could overwrite this area - that’s why it’s not the best solution as I mentioned earlier - but if you reach that point, you’ve gotten so close to the bootloader with your application code, you might be in (other) trouble anyway!  ;)</p>
<p dir="auto">As far as a step-by-step with actual example code, demo files, etc. I’m more than happy to do it but it’ll take me some time.  And would be helped if you could specify a particular board you’d like me to target (especially if I have one lying around), e.g. Nordic’s nRF52840 Dongle, Ebyte module, etc?</p>
<p dir="auto">The other side of this is the FreeRTOS side.  Would you like examples for the lowest possible power?</p>
<p dir="auto">It seems like that’s how folk like these devices to operate.  Going down around 2µA in bare System ON sleep (nRF52832) and around 300nA in bare System OFF sleep requires more involved MySensors code modifications, due to (among other things!) how FreeRTOS takes care of the power management when idling, use of the RTC(s), how it handles ISR callbacks, attaches interrupts, etc.  By “bare” I mean no additional sensors, just, for example, a button or internal RTC (only in System ON) to wake it.</p>
<p dir="auto">Does all, or at least some, of that make sense?  :)</p>
]]></description><link>https://forum.mysensors.org/post/109108</link><guid isPermaLink="true">https://forum.mysensors.org/post/109108</guid><dc:creator><![CDATA[acb]]></dc:creator><pubDate>Wed, 10 Feb 2021 15:45:07 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 04 Feb 2021 04:24:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/acb" aria-label="Profile: acb">@<bdi>acb</bdi></a> Thanks for your post!</p>
<p dir="auto">My nRF52 skills have gotten a bit rusty, so in case you're no longer around when I circle back to this toopic in the future, I'm going to jump the gun and ask you now so that your answer can be memorialized here and then suitably curated by Hek for years to come: <strong>How <em>exactly</em> do you ensure that your bootloader  is loaded into the proper bootloader memory segments and not treated like a regular program and stored in ordinary,  non-privlidged program  memory?</strong>  I'm guessing it's accomplished through a linker directive of some kind? If you could share even a brief simple example here on how to implant the bootloader code where it needs to be, I'm sure it would be  immensely helpful to anyone who wants to create a custom bootloader of their own.   ;-)</p>
<p dir="auto">Actually, it seems you did offer a summary of how to do it when you wrote "Manually entering these upload states is similar to the nRF52832. Uploading via FTDI works as you would expect. Ground P1.06 (USR BTN) and reset (ground P0.21, MCU RST, briefly) and the nRF52840 will expect a DFU over USB either via it’s COM port or UF2 if mounted. On the Dongle, LED1 will fade up and down slowly and I think the RGB LED goes green if mounted.", but again a step-by-step actual example, with demo files, would really drive it home.  Now, some people might consider that much detail would constitute a "no thinking required" guide and therefore overkill,  but I'd prefer overkill to underkill any day.  I'm sure at least some others  who are reading this would rather have s complete demo example that's  too basic than have to puzzle over a missing or vague step.  It may not seem like it's missing or vague to you now, but believe me if you ever have to switch to a different project for a while, it might not look anywhere near as obvious or as familiar when you come back to pick up where you left off.</p>
<p dir="auto">So, if I can prevail upon you to put together even a very simple demo, I'd volunteer right away as a test subject to see if I could replicate it.  And if I can, then you can be confident that if you had to shelf your work then you could come back years later and resume without help just based upon re-reading your own notes.  :sunglasses:</p>
]]></description><link>https://forum.mysensors.org/post/109059</link><guid isPermaLink="true">https://forum.mysensors.org/post/109059</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Thu, 04 Feb 2021 04:24:29 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Mon, 01 Feb 2021 20:43:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/monte" aria-label="Profile: monte">@<bdi>monte</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/neverdie" aria-label="Profile: NeverDie">@<bdi>NeverDie</bdi></a>  - Took some time this weekend to take a look at this and used my previous post as something of a template; hope it helps...</p>
<p dir="auto">Re: Nordic’s default Dongle bootloader - I never managed to get it to play nicely with MySensors and so abandoned it completely in favor of a modified version of Adafruit’s again, since I was already familiar with it from my nRF52832 work.  It would have been nice if Nordic had revealed their private key to move/replace their bootloader, but I get it, I figure they’d rather you bought their DK.</p>
<p dir="auto"><a href="https://github.com/AndyBatchelor/MySensors/tree/main/nRF52840%20Dongle/Arduino/bootloader/pca10059" rel="nofollow ugc"><strong>This is the custom bootloader</strong></a> (.HEX file) my Nordic nRF52840 Dongle nodes currently use.  You’ll need to completely wipe any current Dongle (or EByte E73 module) using a JLink/BMP before flashing.  It has the following MySensors-compatible regions either “in-mind” or in-place:</p>
<p dir="auto">0x00000 to 0x00FFF -   4K MBR Region, currently up to 0xAFF.<br />
0x01000 to 0x25FFF - 148K SoftDevice Region, currently with S140 up to 0x25DE7.<br />
0x26000 to 0xEFFFF - 807K Application Region, bootloader will intelligently fill.<br />
0xF0000 to 0xF0FFF -   4K VirtualPage? managed by arduino-NVM.<br />
0xF4000 to 0xFD7FF -  38K Bootloader Region, currently custom up to 0xFC01F.<br />
0xFD800 to 0xFDFFF -   2K Bootloader Config, currently custom up to 0xFD857, 88B.<br />
0xFF000 to 0xFFFFF -   4K “EEPROM” Area? managed by arduino-NVM.</p>
<p dir="auto">The linked bootloader will of course expect the same pin connections as the Dongle.  The important ones are probably only:</p>
<pre><code>LED1_YLW_GREEN on P0.06

LED2_RGB_RED   on P0.08
LED2_RGB_GREEN on P1.09
LED2_RGB_BLUE  on P0.12

USR BTN on P1.06
BLE DFU on P1.10

MCU RST on P0.21
</code></pre>
<p dir="auto">The bootloader supports CDC, DFU and UF2 upload modes.  So the first time you flash the bootloader and reset, you can then mount it as a removable drive with UF2 support for drag-and-drop uploading of applications and/or new bootloader images, etc.</p>
<p dir="auto">It should also appear as a usual COM port via it’s CDC descriptors, enabling FTDI-like uploading through PlatformIO/Arduino IDEs.  And as before, you can perform DFUs over BLE through a manual combination button-press - more on that below...</p>
<p dir="auto">Also as before, the bootloader shows the upload state through the LEDs, but note that on the Dongle, the LEDs are all active LOW - i.e. drive a logic zero (‘0’) to illuminate the LED(s).  If you’d like a version of the bootloader where the LEDs are all active HIGH, let me know and I’ll try to dig out my old environment and compile something - you can do this yourself though…  ;)</p>
<p dir="auto">Manually entering these upload states is similar to the nRF52832.  Uploading via FTDI works as you would expect.  Ground P1.06 (USR BTN) and reset (ground P0.21, MCU RST, briefly) and the nRF52840 will expect a DFU over USB either via it’s COM port or UF2 if mounted.  On the Dongle, LED1 will fade up and down slowly and I think the RGB LED goes green if mounted.</p>
<p dir="auto">For DFUs over BLE, ground P1.06 (USR BTN) and P1.10 and reset.  I chose P1.10 because it’s right next to a ground pin on the Dongle and I just soldered another push switch to it.  LED1 fades up and down more quickly together with the RGB LED turning blue to confirm.  Uploading is via Nordic’s nRF Toolbox app and again, if you’re using Adafruit’s BSP you’ll get the built-in enterSerialDfu() and enterOTADfu() sketch functions to perform the same button operations as above.</p>
<p dir="auto">As far as prepping MySensors goes, the same applies as above with the nRF52832, only this time you’ll need to up the data rate to 1Mbps or higher, as I mentioned earlier.</p>
<p dir="auto">I could upload Arduino IDE and PlatformIO board variants for the Dongle if you’d like.  But it’s straightforward enough to create variants for your specific board.  If you’re using the Dongle, probably the most useful thing I have to hand is this code-snippet for enabling the regulator:</p>
<pre><code>// Set REGOUT0 to 3V mode
// https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial
if ((NRF_UICR-&gt;REGOUT0 &amp; UICR_REGOUT0_VOUT_Msk) ==
    (UICR_REGOUT0_VOUT_DEFAULT &lt;&lt; UICR_REGOUT0_VOUT_Pos))
{
    NRF_NVMC-&gt;CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC-&gt;READY == NVMC_READY_READY_Busy);

    NRF_UICR-&gt;REGOUT0 = (NRF_UICR-&gt;REGOUT0 &amp; ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
                        (UICR_REGOUT0_VOUT_3V0 &lt;&lt; UICR_REGOUT0_VOUT_Pos);

    NRF_NVMC-&gt;CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC-&gt;READY == NVMC_READY_READY_Busy);

    // System reset is needed to update UICR registers.
    NVIC_SystemReset();
}
</code></pre>
<p dir="auto">If you stick this in an initVariant function in your variants.cpp, the Adafruit nRF52 BSP will call it as part of main.</p>
<p dir="auto">I think that's everything - I hope it was helpful - any questions, I’ll do my best to respond a bit faster this time!</p>
<p dir="auto">Famous last words...  ;)</p>
]]></description><link>https://forum.mysensors.org/post/109039</link><guid isPermaLink="true">https://forum.mysensors.org/post/109039</guid><dc:creator><![CDATA[acb]]></dc:creator><pubDate>Mon, 01 Feb 2021 20:43:33 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Fri, 15 Jan 2021 17:24:21 GMT]]></title><description><![CDATA[<p dir="auto">I just gave this design to pcb fab and cant wait to test it out. I made and tested a similar board using nrf52840 but soldering aQFN package is a nightmare and i needed to cancel quite abit of pins to increase the success chance.<br />
So this design is based on nrf52832with a normal QFN package which is easy to solder and that allowed me to breakout every single pin (except P0.07). Can be powered  with a single cell lipo or USB port and managed to fit in a charger for it with a charging indicator led. It has a voltage divider to measure the battery but it can be desoldered if the pin is needed for another function.<br />
Comes with PA and LNA just like my nrf52840 test and had to follow quite abit of design recommendations from the datasheet.<br />
Some pins are compatible with adafruit 52832 circuit design just in case if i want to use their bootloader. Like reset, DFU, 2 different leds are connected to the same pins as in their board design. Also theres a  selector 0 ohm resistor between pcb and external antenna.<br />
I will report when i receive and test it!<br />
<img src="/assets/uploads/files/1610722567756-832.jpg" alt="832.JPG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mysensors.org/post/108792</link><guid isPermaLink="true">https://forum.mysensors.org/post/108792</guid><dc:creator><![CDATA[orhanyor]]></dc:creator><pubDate>Fri, 15 Jan 2021 17:24:21 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Thu, 14 Jan 2021 00:56:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/monte" aria-label="Profile: monte">@<bdi>monte</bdi></a> said in <a href="/post/108771">nRF5 action!</a>:</p>
<blockquote>
<p dir="auto">I hope others will appreciate it too.</p>
</blockquote>
<p dir="auto">Yes!  Any examples which shed light on how to write a custom bootloader for the nRF52 would be greatly appreciated.</p>
]]></description><link>https://forum.mysensors.org/post/108772</link><guid isPermaLink="true">https://forum.mysensors.org/post/108772</guid><dc:creator><![CDATA[NeverDie]]></dc:creator><pubDate>Thu, 14 Jan 2021 00:56:02 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 13 Jan 2021 23:15:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/acb" aria-label="Profile: acb">@<bdi>acb</bdi></a> I have a couple of Ebyte's E73 modules. I also have BMP, so it shouldn't be a problem.<br />
If you could share your bootloader for 52840 it would be a great start for my tinkering.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/acb" aria-label="Profile: acb">@<bdi>acb</bdi></a> said in <a href="/post/108766">nRF5 action!</a>:</p>
<blockquote>
<p dir="auto">I couldn't get Nordic's default Dongle bootloader to play nicely with MySensors (at the time).</p>
</blockquote>
<p dir="auto">So have you gotten any success eventually?<br />
Once again, thank you for such extensive information :) I hope others will appreciate it too.</p>
]]></description><link>https://forum.mysensors.org/post/108771</link><guid isPermaLink="true">https://forum.mysensors.org/post/108771</guid><dc:creator><![CDATA[monte]]></dc:creator><pubDate>Wed, 13 Jan 2021 23:15:37 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Wed, 13 Jan 2021 11:32:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/monte" aria-label="Profile: monte">@<bdi>monte</bdi></a> - Glad you found it helpful!</p>
<p dir="auto">The bootloader I linked to is a custom (modified) one to fit the board I'm using.  I remember tinkering with things like buffer sizes to make large BLE DFUs more reliable - I'd have to dig back into my notes to be sure...</p>
<p dir="auto">But I believe Adafruit's standard nRF52 Feather should keep approximately the same memory regions - which is the "main" hurdle.  I think the only other potential issue for the nRF52832 was their use of a BOOTLOADER_SETTINGS region at 0x7F000, so you'll have to check that it's not in the way of the arduino-NVM sections.  On the Adafruit Bootloader side, it's all linker-related, nrf52.ld is the file I think.</p>
<p dir="auto">Or you can, of course, modify arduino-NVM to pick it's sections somewhere else, say, underneath the bootloader, for example.  Just be sure to limit how much it erases from there.</p>
<p dir="auto">I remember nRF52840 being trickier because Adafruit had (and used) both the BOOTLOADER_SETTINGS region (this time at 0xFF000) and a BOOTLOADER_CONFIG region (at 0xFE000 - 2K, or something like that...) which they used for USB VID+PID, UF2 family, etc.</p>
<p dir="auto">I've got a similar (custom) Adafruit-based bootloader I made for Nordic's nRF52840 Dongle that works with MySensors, if you're interested?</p>
<p dir="auto">I couldn't get Nordic's default Dongle bootloader to play nicely with MySensors (at the time).  They sign their bootloader so you can't replace it through nRF Connect without a JLink/BMP/etc. - you have to wipe the chip completely - which creates another problem.  The bootloader also needs to set REGOUT0 in the UICR to 3v so you can see your LEDs and debug the thing without level-shifting (the default is 1.8v).  Anyway, it does all work (eventually!) - I've currently got a Dongle serial gateway and Dongle nodes running in various places.  Oh, you'll need to up the data rate too, since the 840 doesn't support the MySensors (deprecated) default of 250kbps.</p>
<p dir="auto">Does that help at all?</p>
<p dir="auto">What nRF52840 board(s) do you have?</p>
]]></description><link>https://forum.mysensors.org/post/108766</link><guid isPermaLink="true">https://forum.mysensors.org/post/108766</guid><dc:creator><![CDATA[acb]]></dc:creator><pubDate>Wed, 13 Jan 2021 11:32:57 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Sat, 09 Jan 2021 20:58:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/acb" aria-label="Profile: acb">@<bdi>acb</bdi></a> thank you for such complete answer!<br />
One more question for now, is this standard, or modified bootloader?<br />
And how many additional steps do I need to take to make this work on nrf52840?</p>
]]></description><link>https://forum.mysensors.org/post/108724</link><guid isPermaLink="true">https://forum.mysensors.org/post/108724</guid><dc:creator><![CDATA[monte]]></dc:creator><pubDate>Sat, 09 Jan 2021 20:58:40 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Fri, 08 Jan 2021 12:36:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/monte" aria-label="Profile: monte">@<bdi>monte</bdi></a>: Okay, sorry for the delay in getting back to you about this (- FWIW: UK went into another national lockdown, schools closed, so it’s been pretty crazy here the last few days...!)</p>
<p dir="auto">I’ve dug back into my original code, done some experimenting and have tried to get down to a minimal set of steps necessary to get MySensors code to play "nicely" with a SoftDevice.  Hopefully it’ll be helpful as a starting point.  But note that minimal is not optimal - or even the best - see more on that below.</p>
<p dir="auto">Caveats aside...</p>
<p dir="auto">As far as prepping the nRF52832 goes, <a href="https://github.com/ProMiniMicros/ProMininRF52/tree/master/Arduino%20Board%20Files/Adafruit/bootloader/pro_mini_nrf52" rel="nofollow ugc"><strong>this HEX file</strong></a> will load the chip with the following MySensors-compatible regions either “in-mind” or in-place:</p>
<pre><code>0x00000 to 0x00FFF -   4K MBR Region, currently up to 0xAFF.
0x01000 to 0x25FFF - 148K SoftDevice Region, currently with S132 up to 0x2514F.
0x26000 to 0x6FFFF - 272K Application Region, bootloader intelligently fills.
0x70000 to 0x70FFF -   4K VirtualPage? managed by arduino-NVM.
0x74000 to 0x7EFFF -  44K Bootloader Region, currently custom up to 0x78FCB.
0x7F000 to 0x7FFFF -   4K “EEPROM” Area? managed by arduino-NVM.
</code></pre>
<p dir="auto">It’s best to get the bootloader to load the application code (via an FTDI) since it knows where to put it, otherwise you’re doing it manually with a JLink, etc.</p>
<p dir="auto">The linked bootloader also expects:</p>
<pre><code>UART TX on P0.11
UART RX on P0.12
USR BTN on P0.15
BLE DFU on P0.16
MCU RST on P0.21
</code></pre>
<p dir="auto">Other optional, but useful pins are:</p>
<pre><code>LED1 on P0.13
LED2 on P0.08
</code></pre>
<p dir="auto">Once the above-linked HEX has been flashed (using JLink, BMP, etc.), you can boot the nRF52832 into a state where it is expecting a DFU over UART by grounding USR BTN (P0.15) and resetting (ground P0.21 briefly).  LED1 will fade up and down slowly to confirm the new state.</p>
<p dir="auto">Or you could do this over BLE by grounding both USR BTN and BLE DFU (P0.16) and resetting.  LED1 and LED2 will fade up and down more quickly to confirm.</p>
<p dir="auto">I’ve found the custom tools in Adafruit’s nRF52 BSP for Arduino to be pretty solid for FTDI uploading, but YMMV.  Otherwise, it’s Nordic’s nRF Toolbox app.</p>
<p dir="auto">(Note that if you do go with Adafruit’s BSP, you can call built-in functions in your Sketch code like enterSerialDfu() and enterOTADfu() to perform the same button operations as above.)</p>
<p dir="auto">As far as prepping MySensors goes, these are (I think) the minimum files and modifications needed to make things work.  In summary:</p>
<ol>
<li>
<p dir="auto">Either comment out the define check for NRF5 right at the bottom of MySensors/drivers/NVM/Flash.h (or define it somewhere) so that the flash driver gets compiled.  This is the only file that uses that define, AFAIK.</p>
</li>
<li>
<p dir="auto">If you’re using Adafruit’s nRF52 BSP (recommended), you have to make sure MySensors uses the correct pin assignment array.  Quick hack is to just replace line 37 of nrf5_wiring_digital.c (MySensors/hal/architecture/NRF5/drivers) with ulPin = g_ADigitalPinMap[ulPin];</p>
</li>
<li>
<p dir="auto">Finally, you will probably want to play around with the implementation of MySensors and FreeRTOS <a href="https://github.com/ProMiniMicros/ProMininRF52/blob/master/MySensors/MyMainNRF5.cpp" rel="nofollow ugc"><strong>in this MyMainNRF5.cpp file</strong></a> (replacing the one in MySensors/hal/architecture/NRF5).</p>
</li>
</ol>
<p dir="auto">This last file is where FreeRTOS is being used to create a sort of Arduino-like structure with a loop_task() being added to the scheduler that contains both the usual setup() and loop() functions you’ll probably be familiar with from Arduino IDE land - setup() is run by MySensors inside the _begin() function.</p>
<p dir="auto">Note that this is NOT the best or lowest power way to do this!  But it is (possibly) the fastest way to get your existing MySensors sketches up and running.</p>
<p dir="auto">Remember that this is now an RTOS running on the MCU.  So ideally, you probably want to completely dispense with system ticks and move to a setup that only uses interrupts, timers, callbacks, etc. to get the lowest possible power, depending on what you’re trying to do in your Sketch.  If you want a quick-and-dirty low power hack, just lower the configTICK_RATE_HZ define in FreeRTOSConfig.h (Adafruit nRF52 BSP) to something like 4 (Hz) or so - but that not the “right” way to do it...</p>
<p dir="auto">However, that’s outside the scope of this (now, not-so) little post.  If you want to dig deeper, I’d suggest familiarising yourself with FreeRTOS and reading through <a href="https://github.com/adafruit/Adafruit_nRF52_Arduino/issues/165" rel="nofollow ugc"><strong>this low power Github issue with Adafruit’s implementation</strong></a> and the associated links mentioned in it - <a href="https://www.freertos.org/low-power-tickless-rtos.html" rel="nofollow ugc"><strong>this page from FreeRTOS on Low Power Tickless Idle Support</strong></a> is good too.  <a href="https://github.com/MacGyverNL/bluepedal/blob/02213ee9dcc495ccdc47f572892f7388aac09a55/bluepedal/bluepedal.ino" rel="nofollow ugc"><strong>Here’s an example of an Arduino Sketch</strong></a> using tasks, timers and interrupts - but using Bluetooth - that illustrates a loop-less implementation.</p>
<p dir="auto">I’ve tinkered down to the 2 or 3 µA region with MySensors using the RTC, portsense interrupts, etc. and you can, of course, go sub-µA using a custom SYSTEM OFF sleep implementation and an external nA region RTC.</p>
<p dir="auto">I can try to put together a better MySensors integration, if folk are interested.  It’ll take time though, especially now that we’re locked down for the next month…</p>
<p dir="auto">Anyway, hope that was helpful.  Any questions, I’ll do my best to respond with what I know.</p>
<p dir="auto">(P.S.  Oh, and you'll need the latest MySensors development branch to get the most stable nRF52832 radio implementation.)</p>
<p dir="auto">Have fun!  :)</p>
]]></description><link>https://forum.mysensors.org/post/108712</link><guid isPermaLink="true">https://forum.mysensors.org/post/108712</guid><dc:creator><![CDATA[acb]]></dc:creator><pubDate>Fri, 08 Jan 2021 12:36:23 GMT</pubDate></item><item><title><![CDATA[Reply to nRF5 action! on Mon, 04 Jan 2021 14:50:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/acb" aria-label="Profile: acb">@<bdi>acb</bdi></a> said in <a href="/post/108677">nRF5 action!</a>:</p>
<blockquote>
<p dir="auto">I can do a diff later this evening if you're interested...?</p>
</blockquote>
<p dir="auto">Yes please, I think I'm not the only one who will appreciate your code :)<br />
I have a bunch of 51822's but wanted to get into 52840. I have paused my research of NRF5 for some time, while I am finishing my other work, but I would like to have more complete experience with NRF5 than what is now provided by mysensors.<br />
I guess FreeRTOS is a way to go, when you have far mo complex MCU then atmega, and far more capable.<br />
I hope that mysensors core team will consider moving forward to more complex, but more powerful architecture.</p>
]]></description><link>https://forum.mysensors.org/post/108679</link><guid isPermaLink="true">https://forum.mysensors.org/post/108679</guid><dc:creator><![CDATA[monte]]></dc:creator><pubDate>Mon, 04 Jan 2021 14:50:21 GMT</pubDate></item></channel></rss>