BoSL Board nano
The BoSL nano will be a more feature enabled version of the BoSL micro while still retaining the small form factor.
Key changes from the BoSL:
- Upgrade SIM7000 to smaller nRF9160
- Remove much of the connectivity to achieve smaller profile
- Add NFC
- Make board much smaller. No more than 15 mm in width.
- Removed MS5803
A number of new components will be used in this design.
The MCU will be the SAMD21G18. The modem used will be the nRF9160. It will also incorporate NFC. The connectivity will expose 7 analog pins and 10 digital pins as well as several power pins and an I2C interface. A diode O-ring similar to that on the microBoSL utilizing the MAX40203ANS will be incorperated so that the device may be powered either via USB or battery supply.
Its maximum dimensions are to be no wider than 15mm.
The architecture of this board will be similar to the main BoSL board. We will use the SAMD21G as the main processor and the nRF9160 as our LTE modem.
Contents
- 1 Programming
- 1.1 18th Decemeber 2020
- 1.2 20 May 2021
- 1.3 12 July 2021
- 1.4 13 July 2021
- 1.5 15 July 2021
- 1.6 16 July 2021
- 1.7 19 July 2021
- 1.8 22 July 2021
- 1.9 24 July 2021
- 1.10 5 August 2021
- 1.11 23 September 2021
- 1.12 7th October 2021
- 1.13 24th November 2021
- 1.14 2nd December 2021
- 1.15 6th December 2021
- 1.16 21st January 2022
- 1.17 15th February 2022
- 1.18 14 March 2022
Programming
18th Decemeber 2020
The first question on using the SAMD21G and the nRF9160 is a question of how these will be programmed. The boot-loader for the SAMD21G will be the Arduino MRK Zero board. This is because it has a built in SD card interface and generally is the most similar to the design. The nRF9160 will be connected via UART on the hardware serial interface. Also after the NFC chip this leaves 14 I/O pins free for end user application. The split is 7 analog and 7 digital pins, all are capable of interrupts.
The SAMD21G bootloader can be installed via a SWD interface and relevant programmer. These pins will be exposed. There are multiple programmers available on the market, a specific one has not been decided yet.
20 May 2021
We have made a mistake in the manufacturing the switch SW1 has 4 terminals and our footprint shorts it out.
12 July 2021
The boot-loader was able to be uploaded to the SAMD and after this programs could be uploaded via the arduino IDE and USB. The following steps were used to compile and upload the bootloader. The process was mostly straightforward however various packages and tools were needed to be installed to compile the bootloader.
Simple functions were then verified like RTC and analog reading. These were all working normally.
Some work was done to fixed up the boot loader and board definitions to match the circuit of the BoSL nano. These new definitions will be made available to download at a future time.
13 July 2021
These board definitions were finished and packaged up as a board in the arduino IDE board manager. Some of the custom pin functions were given specific names under the board. This includes, VNFC, for the nfc voltage. A full list will be documented soon. The used bootloader is also included in this package.
The current consumption was measured on a blank script. This was measured at 65 mA. Which is quite high, however the nRF9160 has not been flashed with any firmware yet so it is likely to be in some idle state. Placing the SAMD21 in sleep mode reduces the current consumption to 35 mA.
15 July 2021
It was found pull-up resistors were needed to be added to get the I2C bus to function. These should be included in the next revision. The nRESET resistor on nrf9160 should also be removed as it is not recommended in the datasheet.
16 July 2021
The process to get the nRF9160 to work has been a bit more complicated than desired. The Nordic SDK was needed to be installed. From this example applications could be built from the command line and then flashed with the J-link and Nordic flash utility. The SDK requires each a definition of the configuration of each board. I have copied the board definition for the nRF9160 development kit, and relabeled it for the BoSL nano. This definition can be used ot define where the USART interface goes and all that. I am still learning how these definitions work. So far I have been able to build the zephyr/blinky example to get the onboard LEDs to blink. Most of this learning has been following the nordic SDK documentation.
I was then able to get USART to work via editing the usart device definitions in the zephyr board configutation. After this the serial LTE modem firmware was attempted to be run. This once built on the non-secure built option. And with build configuration of uart2 (which had the correct pin-out and with hardware flow control disabled via commenting out in the bosl_nanons.overlay file in the source directory) it was able to be used with a serial pass through application developed on the SAMD. The module was now responding to AT commands. Following the AT command manual the GPS was tested and found to be working. The performance was quite good with a time for first fix (TFF) of 131s while indoors. The current BoSL board cannot get a gnss fix while indoors most of the time and often has a TFF of several minutes. The bosl nano has passed this large milestone, and looks to be largely functional. Will be on finialising a version of the AT client with extra features such as LED debug.
19 July 2021
A detailed description of how to setup an environment to build the nRF9160 firmware is described here
22 July 2021
The BoSL nano was able to upload to the testing server over LTE. Once registered to the network this was achieved with the following command chain.
AT#XHTTPCCON=1,"www.bosl.com.au",80
Which connects to the bosl server over http, and then in brief succession the command:
AT#XHTTPCREQ="GET","/IoT/testing/scripts/WriteMe.php?SiteName=BoSLnano.csv&T=1",""
which sends the get request for the given resource. Where the site name and variables are changed according to need.
24 July 2021
Attached a script which intermittently logs to the bosl server File:SimpleNanoLogger.ino. The data to be uploaded can be inserted by updating the uploadATsequence function. One caveat is that every time the board sleeps the USB serial port gets disconnected. Hence it needs to be reopened after every waking, otherwise no Serial data will appear. To get the BoSLnano board add:
https://monash-bosl.github.io/BoSL-IDE-Core/package_bosl.com.au_index.json
to the additional board url box in File->Preferences menu of the Arduino IDE. The BoSL SAMD boards can then be downloaded from the board manager and the BoSLnano can then be selected as the board target in the tools menu.
5 August 2021
It is necessary to find a power state where minimal power is used. To find this a number of scripts were run on the BoSL nano and then the total board power consumption was measured. In these tests the board was powered via the battery port at a voltage of 4.2V. The results are indicated below.
1. delay() | 60.0 mA
2. uart on, nRF_EN output high, AT#XSLEEP=2, delay() | 60.4 mA
3. uart on, nRF_EN output high, AT#XSLEEP=2, nRF_EN output low, delay() | 65.9 mA
4. uart on, nRF_EN output high, delay() | 62.3 mA
5. LowPower.deepSleep(); | 31.2 mA
6. LowPower.deepSleep(); PinMode(input); (on connected pins) | 31.2 mA
In reading the nrf9160 documentation VDD_GPIO should be driven low when ENABLE is drive low, this is not currently done.
I tried to setup another BoSLnano to see if it also had this current issue. However this BoSLnano had a constant short circuit when power was supplied by either USB or the battery port. Additionally one side of the nRF9160 got very hot when powered up. It is assumed that either the soldering is bad or the nRF9160 is bad. Given the tight tolerances of the PCB, an issue with the soldering is possible. This could be investigated by de-soldering components one at a time and seeing if the issue resolves itself. It is also possible that a similar soldering issue is the cause of the high current in the current draw tests.
23 September 2021
In order to figure out how why this current was so high, I have de-soldered the RF-circuitry and nRF9160 on the short circuit BoSL board. Once this was done the short circuit disappeared. Some notes
- With the nRF removed I was getting similar power figures to the working BoSL nano indicating that the nRF is not the source of the current draw. Either the ATmega or some other peripheral.
- Progressively to diagnose the issue more parts were removed but the current consumption still remained (much 30 mA vs 12 mA) higher than the arduino MKRzero based on the same ATSAMD21G.
- I swapped the chips between the MKRzero and the BoSL nano however the current consumption still remained at 30 mA.
- All the parts were removed apart from the crystal, 2 crystal capacitors, 1 SAMD21G decoupling capacitor, and the SAMD21G, yet the power consumption was still at 30 mA
Specifically the current consumption was 30mA in sleep mode and 50mA while running delay() code. This data leaves the following conclusions
1) The wrong firmware is loaded
2) The crystal is causing the current draw
3) There is a manufacturing fault (partial short etc...)
Of these hypothesis, 1) seems unlikely as the same SAMD21G was running at 12 mA in delay() and ~0 mA in sleep when connected to the MKRzero. 2) is possible however i've never seen a crystal change the current consumption that much. This leaves 3) which is I suspect the most likely reason of this behavior. Perhaps there is a via partially shorting two pins as the spacing in many places is very tight. If this is the issue it would have to be systemic to the design as both PCB's seemed to have this issue.
7th October 2021
To find out why this 30 mA current draw was occuring, I have laid out a quick version of the BoSL nano where all the components are spaced for easy diagnostic access. In addition to this the pins of the micro-controllers are all connected through solder-able jumpers. This allows PCB connections to be removed and remade quickly while diagnosing any errors. A render of the PCB is provided below:
24th November 2021
The development PCB's have arrived:
Time to build one up and start testing!
2nd December 2021
As with the last BoSL nano there were issues with power consumption in sleep mode, on the dev board we will slowly add components one by one to measure their power consumption.
Below is a table of the component added and the resultant power consumption.
Component | Current (mA) |
---|---|
SAMD | 32 mA |
After a few minutes the current jumped up to a few hundred milliamperes. After doing another double check of the schematic is was found what the issue was. pin 43 on the SAMD, VDDCORE was connected to 3.3V. This was incorrect as VDDCORE is actually a 1.2V output from the internal regulator. I suspect that applying 3.3V has been killing the internal regulator which powers the CPU and causing our general issues with the device. Having disconnected VDDCORE from 3.3V, the SAMD21G now only draws 4mA, closer to the expected.
I've been unable to get the Segger J-Link connected to the SAMD. I suspect that the issue is with my soldering, I don't have solder paste and wetting the pads with solder wire doesn't work very well. Nevermind, I hadn't yet soldered on the decoupling capacitors between 3.3V and GND on the board, just the SAMD. Once I did this I was able to connect to the SAMD and get it up and running.
An error was noted with the BoSL SAMD package. It does not install the gcc arm eabi none compiler. This is only installed once the Arduino SAMD boards are installed. I'll need to look into how I can make the package auto-grab this.
The USB port was soldered on and now the nano is working with the Arduino IDE. A simple low power script was uploaded to the nano in sleep mode it has a power consumption of 350μA.
The MAX40203 ideal diodes which control the power source were not able to be soldered due to their small size, the regulator however was and was found to be in working order.
After re-soldering the nRF9160, this too worked and was able to be connected to with the J-link.
In summary the key change needed to fix the BoSL nano, was that VDDCORE mustn't be connected to 3.3V.
6th December 2021
Changes were made to the BoSL nano design to fix the issues had these included:
- disconnecting VDDCORE from 3.3V
- increasing the spacing between the programming pads to 1.27 mm
- the reset switch footprint was fixed
- 10 kΩ pullup resistors were added to the I2C bus
- nRF9160 nRESET pin now does not have the pullup resistor populated by default as per the datasheet.
- misc bom changes for out of stock parts
The design files can be found here: and here:
21st January 2022
The rev 0.2.0 D1 footprint is too small for the selected part. This issue should only affect the usb detection, so isn't considered critical.
15th February 2022
The first batch of BoSL nanos arrived today:
We will be testing them out to verify that the changes made since the previous prototype were working. It seems they do not have any programs flashed to them yet, however do have their bootloader flashed. If they are plug into the computer via usb they can be programmed using the arduino IDE. It seems that the site package for arm g++ is not fetched by the current board definition in the Arduino IDE. I have updated the board definitions in the 1.0.6 release to newer versions of the toolchain and updated the paths which link to these tools to act correctly.
I am now going to document the process I used to get the nrf9160 firmware built. I am following the guide found at: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-1-ncs-v1-4-0#h769sk6kqovea15p99jn16lstat1dtpuuw in particular the build and flash using west section. I prefer to use command line tools for this as they tend to be more repeatable. The toolchain was installed through the nrf for desktop toolchain manager. After this the bosl nano board definition was added in the ncs\v1.8.0\zephyr\boards\arm directory. The serial LTE application with modifications for the BoSL nano can now be built using west. The merged.hex file in the build and zephyr subdirectories could then be flashed onto the nrf9160 via SWD, the SAMD on the BoSL nano is now able to talk to the nRF9160 through AT commands.
For reference and safekeeping here is a working firmware for the nrf9160: File:Nrf9160 nano firmware.zip
14 March 2022
The nrf9160 firmware was modified to enable the functioning of the status LEDs. The current behaviour of the status LEDs is as follows. When plugged in to USB power, the "M" LED will be on whenever the modem is not in sleep mode. The "S" LED will blink whenever the modem has it's cellular radio turned on. This firmware is suppled here File:Bosl nano nrf9160 firmware 1.0.0.hex.zip