The contents of this post includes my review of the two Nordic online guides on the Thingy:53. I cover the Nordic Thingy:53 Getting started Guide and the more advanced Developing with Thingy:53 Guide. Here are my notes that I took while following the steps in these guides.
This project is part of the Smarter Sustainable World Challenge with Nordic Semiconductors Thingy:53 and Edge Impulse. I created this project to organize my steps to learn some of the technical parts of the Thingy:53. My summited project for the challenge is Thingy:53 – Home Energy Monitoring StationNordic Thingy:53 Getting started Guide
I followed through each of the sections in this guide, making notes while getting a good understanding of the Thingy:53.The highlighted sections follow.Installing the required software
o I already had installed the “nRF Connect for Desktop” & “Programmer´ on my development PC, for a review of the Nordic nRF9160, so I did not reinstall it. A link is provided to help you along, if you need to install it.
- I did install the nRF Programmer on my android phone.
- This is app allows you to upload precompiled firmware example samples from nRF Connect SDK to your Thingy:53 overr Bluetooth without connecting to a PC! This allows you to test or update firmware without the need of having physical access to the device. Pretty cool! The current version allows you to choose from several samples in the nRF Connect SDK. The next section will take you thru using the nRFProgrammer Mobile app to upload the “LED button sample (LBS)” sample.
This section describes a little more about firmware, that comes preloaded with the Thingy:53
- o Edge Impulse Application Firmware
- o MCUboot bootloader
- o SoftDevice controller on the network core of the nRF5340 SoC.
In addition to Edge Impulse, the nRF Connect SDK contains Multiple precompiled samples
- Thingy:53: Matter weather station
- Thingy:53: Zigbee weather station
- nRF Machine Learning
- Bluetooth: Peripheral LBS
- Bluetooth: Peripheral UART
- Bluetooth: Mesh light
- Bluetooth: Mesh light fixture
- Bluetooth: Mesh light switch
- Bluetooth: Mesh sensor
To try different samples or to update the existing firmware on the Nordic Thingy:53, you have three options to upload the firmware to the thingy:53
1. Bluetooth® Low Energy (LE)
2. USB (MCUboot)
3. An External Debug Probe.
I tried option 1 and 2. I’ll leave option 3, for a later time.Updating through Bluetooth LE
This section describes how to update the Nordic Thingy:53 application and network core over Bluetooth LE using the nRF programmer mobile app. It will take you step by step to getting the sample from a list to the Nordic Thingy:53. I chose the Peripheral LBS sample
·Results. This worked the first time, without any problems. Pretty cool!!!Updating through USB
This section describes how to update the Nordic Thingy:53 application and network core over USB using MCUBoot. This is a secure bootloader that you can use to update applications without an external debugger. It will take you step by step to getting the sample from a list to the Nordic Thingy:53.
I had a Problem on step 15. When I click on the write button I get the MCUBootDFU window, but there is an warning on the bottom as follows. I asked DEVZone about this and here is there answer
1.The warning about this not being valid for thingy:91 is a bug, but it is just a warning and can be ignored (I have informed the team about this invalid warning).
Now, when I click the Write button on the MCUBoot DFU window I get the following error
§ But there is still a problem at step 15. When I do the following instruction to put the device in MCUBoot mode as described at step15
1. Move the power switch SW1 to the ON position.
2. Open nRF Connect for Desktop and launch the Programmer app.
3. Move the power switch SW1 to the OFF position.
4. Take off the top cover to access the SW2 button.
5. Press SW2 while switching SW1 to the ON position
While in Programmer, I do not get Bootloader Thingy:53 in the programmer select list? I get the following and an error
There are two things here.
1.The warning about this not being valid for thingy:91 is a bug, but it is just a warning and can be ignored (I have informed the team about this invalid warning).
2. The error you get after clicking "Write" seems to indicate that the Thingy:53 is not in DFU mode. You need to take of the cover, and power-cycle it while holding down SW2. Note that the SW2 button is a bit difficult to see, as it is a tiny button right next to the much larger SW3 button. When the device is in Bootloader mode you select it from the Programmer app, and you can easily see that it is in the correct mode, as the name "Bootloader Thingy:53" is displayed as follows
This is now working for me!!! I was pressing the wrong button SW3 instead of the tiny SW2 as indicated in the tutorial.
It is a very small button and I'm sure it is intentional, so that it doesn't get pressed by accident. It looks like this procedure needs to be done every time you use the USB programmer? Now that I have used the correct switch to get into Boot Loader Mode, it’s now time to move onto the third option available to upload the firmware to the thingy:53.
This section takes you step by step to update the Thingy:53 firmware by using an external debug probe. They recommend the nRF5340 DK connected as described with a 10-pin 2x5 socket-socket 1.27 mm IDC (Serial Wire Debug (SWD)) JTAG cable.
I have the nRF9160 DK, which also has a 10 pin debug connector. I will try to use it to update the firmware. I need to order a 10-pin 2x5 Socket-Socket 1.27mm IDC from amazon for $7.31 though. When I get it delivered, I will see if the instructions allow me to use the my nRF9160 DK to update the firmware on the Thingy:53.
This concludes getting started with the the three options available to upload the firmware to the Thingy:53. Now onto the next topic, Edge Impulse Machine Learning with the Thingy:53.Getting started with machine learning
This Section introduces the Edge Impulse Studio and the Edge Impulse firmware that comes preprogrammed on the Thingy:53. There are two ways to connect the Thingy:53 to the Edge Impulse Studio:
- 1. nRF Edge Impulse mobile application to connect over Bluetooth LE
- 2. Connect the Nordic Thingy:53 to a computer to connect over USB.
The Edge Impulse firmware, enables data collection from all the sensors on the Nordic Thingy:53.
- You can use the collected data to train and test machine learning models.
- Deploy the trained machine learning model to the Nordic Thingy:53 over Bluetooth LE or USB.
Edge Impulse Studio Is a web application that allows developers to manage ML projects? Developers can acquire new training data, design impulses and train models.
First thing is to Create or Login to Edge impulse studio
- o Create an account if you do not have one at https://studio.edgeimpulse.com/signup
- o Login to an existing account at https://studio.edgeimpulse.com/login
Then I followed the instructions on the Nordic Semi Thingy:53 page.
My Results and Conclusions of this page.
o I already had the nRF Connect for Desktop V3.11.1, so I did not reinstall this dependency. The EDGE Impulse CLL is listed as the second dependency. Do I NEED THIS? The link Edge Impulse CLI, is a very intensive install, involving Python and Node? I Skipped it for now
o I performed the “updating the Firmware section”. Here are my RESULTS
- · Using the programmer on My PC, at the time, I had the same problem as before “can’t load the HEX file in the zip” (I have since resolved this problem).
- · So I used the Updating thru Bluetooth programmer phone app. Selected “Edge Impulse” from the list. This worked great.
o There are 2 ways to connect to Edge Impulse as described in the “Connecting to Edge Impulse“ section
§ Through Serial connection I was unable to connect from a command prompt I think I need to have the Edge Impulse CLI install?
§ Through the nRF Edge Impulse mobile app. This is described in the Connecting to the nRF Edge Impulse mobile application section. I was able to consistently use the mobile apps, since I could not get the Bootloader to work on my PC version of Programmer?
o “Next steps: building a machine learning model” Section. This section contains a link Building a continuous motion recognition system. You will be building the model that is like the Preloaded firmware. You'll learn how to :
- · Collect high-frequency data from the thingy:53 accelerometer sensor,
- · Use signal processing to clean up data,
- · build a neural network classifier,
- · And deploy your model back to the thingy:53..
o I followed these steps in my Edge Impulse Studio project Thingy53. I connected to the thingy:53 with the nRF Edge Impulse app by getting into my project I called Thingy53.
- · I was able to train, deploy, inferencing on my phone app. All the things between train and deployment were done on the web app. Once the model was built I used my Phone app to deploy my model to the Thingy32. You can also deploy on the web app by selecting deployment and it will download load a ZIP archive that you can include in you Thingy:53 project.
o NEXT is the “Connecting to the nRF Edge Impulse mobile application” Section. Now that you have trained your fist Edge Impulse Machine learning model. This section explains: Using the Nordic nRF Edge Impulse app you can:
- o deploy your impulse to your Nordic Thingy:53
- o and acquire/upload new sensor data into your Edge Impulse projects.
· The interface seems different then the example screen in the tutorial. Must be the iPhone app, I have an Android.
o Another tutorial responding-to-your-voice, is worth checking out as an exercise.Conclusion
This is the end of the “Getting started with the Nordic Thingy:53 Guide. After completing all the tasks on this guide, I had acquired the following: knowledge in using the Nordic Thingy:53:
o I installed the required software tools needed to work with the Thingy:53
o Introduced to the precompiled firmware samples
o The two ways to upload the firmware to the thingy:53
1. Bluetooth® Low Energy (LE) This is controlled by your smartphone.
2. USB (MCUboot) I had a problem with this step at first
· SOLUTION: DO these steps using programmer from “nRF Connect For Desktop”
o Move the power switch SW1 to the ON position.
o Open nRF Connect for Desktop and launch the Programmer app.
o Move the power switch SW1 to the OFF position.
o Take off the top cover to access the SW2 button.
o Press SW2 while switching SW1 to the ON position
· Make sure your pressing the small button SW2. And not the big button like I was doing. Using this button will not load the “Bootloader Thingy:53”.
· If you do not see the following then you have pressed the wrong button
o I was able to understand more about Machine learning using an example of connecting the Thingy:53 to the Edge Impulse Studio.FIRMWARE Development with the Thingy:53
Now it’s time to start developing on the Thingy:53. This section contains a exercise lesson from a course I took on the Nordic DevAcadamy. It also includes my notes as I followed the Developing with Thingy:53 guide.DevAcadamy Lesson6 –Serial communication (i2C) Exercise 2
I used my previous nRF Connect SDK experience using another Nordic product (Nordic nRF9160 DK). The idea is, that I would try to get an exercise that specifically uses the Thingy:53 to work. I was thrilled to use Visual Studio Code with the nRF Connect for VS Code extension to build applications. See the nRF Connect for Visual Studio documentation page for more information about the extension. I was able to install the nRF SDK,, nRF Connect VS code extensions and work with many firmware examples by taking the nRF Connect SDK Fundamentals course. This course helps you to learn the essentials of firmware development using the nRF Connect SDK along with Microsoft VS Code IDE. I used it to get familiar with the nRF9160 development environment for a roadtest on element14.com
· If you’re interested in my notes on taking the course, you can refer to my blog A Nordic DevAcadamy Course on the nRFConnect SDK. This course is an excellent way to learn how to use the nRFConnect SDK. I used the Thingy53 example in the DevAcadamy course Lesson6 –Serialcommunication (i2C) Exercise 2
My RESULTS Two problems
- 1. Build problems
- 2. Thingy:53 Does not connect
o I will need to come back to this after getting a better understanding of using the nRF Connect SDK with VS Code.Developing with Thingy:53 -- Online Guide
Since my first attempt using the DevAcadamy lesson example, did not completely work. I decided to follow the steps in the online Guide, and see if I could get some samples developed using the Thingy:53.
Note The nRF Connect SDK samples and applications that are compatible with the Nordic Thingy:53 follow the Thingy:53 application guide. The application guide defines a consistent partition map and bootloader configuration to allow serial and OTA firmware updates.
- Since I already have VS CODE, nRF Connect For VS Code Extensions, and nRF Connect SDK installed from a previous board, I opened a new VS Code Workspace
- This step, Instructs you to complete the steps listed in the Building nRF Connect SDK application quick guide page.
The following 11 steps are taken from this guide.
- Open the nRF connect extension
- From Application View click “Add an existing application”
- · I navigated to my sdk 2.0.2 version, under my C:\ncs\v2.0.2 directory
- · C:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs
- · Click “Select folder” when you are on the sample folder you wish to build. A new application is automatically added in the Application View.
- · I did not get this message, but if you do click YES
- · I’m not really sure what this step ment?
- · “Verify the configuration of the sample or application you are planning to build based on the information in the Configuration section in the application or sample documentation in the nRF Connect SDK. This section might contain information about application-specific Kconfig fragments or CMake build fragments.”
- · Click the Add Build Configuration button in the Application View as described in the step instructions picture. This opens the Add Build Configuration screen.
- · On this screen select “thingy53_nrf5340_cpuapp_ns”
- · Make sure this checkbox is checked
- Step 10
· I didn’t need to enter any new Kconfig fragments or extra CMake arguments.
- · Click “Build Configuration” button. The config file is generated and triggers the build.
- · The build failed! Not sure why? The following error occurred?
-- Configuring incomplete, errors occurred! FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.0.2\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\ncs\toolchains\v2.0.2\opt\bin\python.exe' '-Bc:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build' '-Sc:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs' -GNinja -DBOARD=thingy53_nrf5340_cpuapp_ns -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=c:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs
- o I was able to build by doing the following with the “nRF Connect for VS Code Extensions”
- o What I did was reinstalled the extensions and then I was able to BUILD with no warnings. Not sure why but I’m on my way again.
I also had a problem that I POSTED TO THE NORDIC DEV ZONE 9/6 and was able to resolve it.
o Now return to Developing with Thingy:53 guide section Building and programming using Visual Studio Code Step3
- o I will have to try this when I get my 10 pin JTAG cable from amazon.
- o My RESULTS of using the JTAG.
I did not go over the next two sections
This is only half way through the guide at this point. The rest of the guide deals with application information useful for development. I will use these sections as I need to implement my firmware. The table of contents follows
These two pages are very comprehensive guides to development on the Thingy:53. At this moment I’m not quite sure how I will be flashing my developed code onto the device.
I’m going to try the Debug probe using my nRF9160. And then try to figure out how to generate a zip file to flash using nRF Programmer.
To develop applications for the Thingy:53, you will use the nRF Connect SDK, which contains a variety of compatible libraries and samples. For more information on the Thingy:53 hardware development platform, see the Thingy:53 Hardware Description. If you have further questions, get in contact with our technical support team on DevZone.