Comes pre-loaded with theUF2 bootloader(), which looks like a USB storage
•
key. Simply drag firmware on to program, no special tools or drivers needed! It
can be used to load up CircuitPython or Arduino IDE
Each order comes with one assembled and tested ItsyBitsy nRF52840, with headers
that can be soldered in for use with a breadboard.
So what are you waiting for? Pick up a ItsyBitsy nRF today and be amazed at how
easy and fast it is to get started with the teensiest Bluetooth dev board we have.
Update Bootloader
Your board's bootloader must be 0.6.1 or later to be able to load CircuitPython
8.2.0 or later.
Older versions of Adafruit's nRF52840 boards were shipped with a bootloader that
does not handle large UF2's, including CircuitPython 8.2.0 and later, and has other
issues. To check whether you need to update the bootloader, double-click the reset
button, and look in the ...BOOT drive for INFO_UF2.TXT. Inside that file, check the
version number. It should be 0.6.1 or newer. This one is older:
You will see a new BOOT disk drive appear e.g FTHR840BOOT. Drag the downloaded
. uf2 file to FTHR840BOOT.The LED will flash. Then, theFTHR840BOOT drive will
disappear. That's it, you have successfully update your board to the latest version.
Use Arduino IDE
Arduino IDE Burn Bootloader menu option will pick the correct bootloader binary for
your selected board and prevent any command typos or other common errors.
Close the Serial Monitor before you click "Burn Bootloader". Afterwards, you
shouldn't close the Arduino IDE, unplug the board, launch Serial Monitor etc ... to
abort the process. There is a high chance it will brick your device! Do this with
care and caution.
This is an advanced method: if your existing bootloader version is 0.4.0 or later,
you can use the UF2 method, which is faster and safer.
Make sure no other program is attached to the serial port on the board, such as Mu,
the Serial Monitor in Arduino, or a terminal program. Then, to start, select the correct
After receiving the new Bootloader over the serial connection, the old Bootloader will
erase itself! The new bootloader will then be flashed. The process typically takes
30-60 seconds to complete. Make sure you see the "Device programmed" in the
output log before launching Serial monitor or uploadinga new sketch.
Upgrading target on /dev/ttyACM0 with DFU package /Adafruit_nRF52_Arduino/
bootloader/feather_nrf52840_express/
feather_nrf52840_express_bootloader-0.6.2_s140_6.1.1.zip. Flow control is disabled,
Dual bank, Touch 1200
Touched serial port /dev/ttyACM0
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 3, SoftDevice size: 151016, bootloader size: 39000,
application size: 0
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
############
Activating new firmware
DFU upgrade took 20.50154972076416s
Device programmed.
Drawbacks of this method are that you will need to install the Arduino IDE, and the
bundled bootloader may not be the latest one. Check out the next page for a more
This is advanced method: if your existing bootloader version is 0.4.0 or later, you
can use the UF2 method, which is faster and safer.
Download Bootloader Package
To update the bootloader, you need a . zip file containing the latest version of the
bootloader. Use the link below to download it. Then unzip the .zip you downloaded.
Latest .zip of Feather nRF52840
bootloader and associated files
Download adafruit-nrfutil
You will also need the utility program "adafruit-nrfutil", which has slightly different
names on different platforms.
On Linux, you can download and install adafruit-nrfutil by doing:
$ pip3 install --user adafruit-nrfutil
On MacOS, if you have python3 and pip3 installed, you can install via pip3 , as
above for Linux. Otherwise download adafruit-nrfutil-macos from this link:
adafruit-nrfutil-macos for MacOS
Then make it executable by doing:
chmod +x adafruit-nrfutil-macos
On Windows, download adafruit-nrfutil.exe from this link:
To update the bootloader, first connect the board, and then double-click to get NRF52
BOOT . In the commands below,substitute the name of the .zip file you downloaded
for file given there.
On Linux, run this command:
adafruit-nrfutil --verbose dfu serial --package
feather_nrf52840_express_bootloader-0.2.9_s140_6.1.1.zip -p /dev/ttyACM0 -b 115200
--singlebank --touch 1200
On MacOS, find out the device name for the connected board, by doing:
ls /dev/cu.*
The device name will be something like /dev/cu.usbmodem411 . Use this command,
substituting the device name you've discovered. If you are running it other than where
you downloaded adafruit-nrfutil-macos , change the path to the command
accordingly. If you installed it via pip3, it's just called adafruit-nrfutil , and it
On Windows, use this command, in the folder where you downloaded the other two
files above. You'll need to specify the correct COM port, instead of COMxx . Look in De
vice Manager for the name of the COM port (it will be listed as a "USB Serial Device"
on Windows 10) after you have double-clicked the reset button.
Adafruit nRF52 BSP via git (for core development and PRs only)
Install BSP via Board Manager as above to install compiler & tools.
1.
Delete the core folder nrf52 installed by Board Manager in Adruino15,
2.
depending on your OS. It could be
macOS: ~/Library/Arduino15/packages/adafruit/hardware/nrf52
Linux: ~/.arduino15/packages/adafruit/hardware/nrf52
Windows: %APPDATA%
\Local\Arduino15\packages\adafruit\hardware\nrf52
Go tothe sketchbook folder on your command line, which should be one of the
3.
following:
macOS: ~/Documents/Arduino
Linux: ~/Arduino
Windows: ~/Documents/Arduino
Create a folder named hardware/Adafruit , if it does not exist, and change
4.
directories into it.
Clone the Adafruit_nRF52_Arduino() repo in the folder described in step 2:
// Convert the raw value to compensated mv, taking the resistor // divider into account (providing the actual LIPO voltage)
// ADC range is 0..3000mV and resolution is 12-bit (0..4095)
return raw * REAL_VBAT_MV_PER_LSB;
}
To get information on the current stack frame (normally the currently
•
executing function), try these:
info frame : Display info on the current stack frame
◦
info args : Display info on the argumentspassed into the stack frame
◦
info locals : Display local variables in the stack frame
◦
info registers : Dump the core ARM register values, which can be
◦
useful for debugging specific fault conditions
Are there any other cross platform or free debugging
options other than GDB?
If you have a Segger J-Link(), you can also use Segger's OZone debugger GUI() to
interact with the device, though check the license terms since there are usage
restrictions depending on the J-Link module you have.
You will need to connect your nRF52 to the J-Link via the SWD and SWCLK pins on
the bottom of the PCB, or if you are OK with fine pitch soldering via the SWD
header.
You can either solder on a standard 2x5 SWD header()on the pad available in the
board, or you can solder wires to the SWD and SWCLK pads on the bottom of the
PCB and use an SWD Cable Breakout Board(), or just connect cables directly to
your J-Link via some other means.
You will also need to connect the VTRef pin on the JLink to3.3V on the Feather to
let the J-Link know what voltage level the target has, and share a common GND by
connecting the GND pins on each device.
Before you can start to debug, you will need to get the .elf file that contains all the
debug info for your sketch. You can find this file by enablingShow Verbose Output
During: compilation in theArduino Preferencesdialogue box. When you build your
sketch, you need to look at the log output, and find the .elf file, which will resemble
something like this (it will vary depending on the OS used): /var/folders/86/
what should I do when Arduino failed to upload sketch to
my Feather ?
If you get this error:
Timed out waiting for acknowledgement from device.
Failed to upgrade target. Error is: No data received on serial
port. Not able to proceed.
Traceback (most recent call last):
File "nordicsemi\__main__.py", line 294, in serial
File "nordicsemi\dfu\dfu.py", line 235, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 203, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_serial.py", line 155, in
send_init_packet
File "nordicsemi\dfu\dfu_transport_serial.py", line 243, in
send_packet
File "nordicsemi\dfu\dfu_transport_serial.py", line 282, in
get_ack_nr
nordicsemi.exceptions.NordicSemiException: No data received on
serial port. Not able to proceed.
This is probably caused by the bootloader version mismatched on your feather and
installed BSP. Due to the difference in flash layout (more details()) and Softdevice
API (which is bundled with bootloader), sketch built with selected bootloader can
Now! Let's try editing the program you added to your board. Open your code.py file
into your editor. You'll make a simple change. Change the first 0.5 to 0.1 . The code
should look like this:
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.5)
Leave the rest of the code as-is. Save your file. See what happens to the LED on your
board? Something changed! Do you know why?
You don't have to stop there! Let's keep going. Change the second 0.5 to 0.1 so it
looks like this:
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.1)
Now it blinks really fast! You decreased the both time that the code leaves the LED on
and off!
Now try increasing both of the 0.1 to 1 . Your LED will blink much more slowly
because you've increased the amount of time that the LED is turned on and off.
Well done! You're doing great! You're ready to start into new examples and edit them
to see what happens! These were simple changes, but major changes are done using
the same process. Make your desired change, save it, and get the results. That's
really all there is to it!
Naming Your Program File
CircuitPython looks for a code file on the board to run. There are four options: code.tx
t, code.py, main.txt and main.py. CircuitPython looks for those files, in that order, and
then runs the first one it finds. While code.py is the recommended name for your code
Usually when you run into errors, it's not because you introduced them on purpose.
You may have 200 lines of code, and have no idea where your error could be hiding.
This is where the serial console can help. Let's take a look!
The Traceback (most recent call last): is telling you that the last thing it was
able to run was line 10 in your code. The next line is your error: NameError: name
'Tru' is not defined . This error might not mean a lot to you, but combined with
knowing the issue is on line 10, it gives you a great place to start!
Go back to your code, and take a look at line 10. Obviously, you know what the
problem is already. But if you didn't, you'd want to look at line 10 and see if you could
figure it out. If you're still unsure, try googling the error to get some help. In this case,
you know what to look for. You spelled True wrong. Fix the typo and save your file.
Nice job fixing the error! Your serial console is streaming and your red LED Is blinking
again.
The serial console will display any output generated by your code. Some sensors,
such as a humidity sensor or a thermistor, receive data and you can use print
statements to display that information. You can also use print statements for
troubleshooting, which is called "print debugging". Essentially, if your code isn't
working, and you want to know where it's failing, you can put print statements in
various places to see where it stops printing.
The serial console has many uses, and is an amazing tool overall for learning and
programming!
The REPL
The other feature of the serial connection is the Read-Evaluate-Print-Loop, or REPL.
The REPL allows you to enter individual lines of code and have them run immediately.
It's really handy if you're running into trouble with a particular program and can't
figure out why. It's interactive so it's great for testing new ideas.
Entering the REPL
To use the REPL, you first need to be connected to the serial console. Once that
connection has been established, you'll want to press CTRL+C.
If there is code running, in this case code measuring distance, it will stop and you'll
see Press any key to enter the REPL. Use CTRL-D to reload. Follow those
instructions, and press any key on your keyboard.
The Traceback (most recent call last): is telling you the last thing your board
was doing before you pressed Ctrl + C and interrupted it. The KeyboardInterrupt
is you pressing CTRL+C. This information can be handy when troubleshooting, but for
now, don't worry about it. Just note that it is expected behavior.
If your code.py file is empty or does not contain a loop, it will show an empty output
and Code done running. . There is no information about what your board was
doing before you interrupted it because there is no code running.
If you have no code.py on your CIRCUITPY drive, you will enter the REPL immediately
after pressing CTRL+C. Again, there is no information about what your board was
doing before you interrupted it because there is no code running.
Regardless, once you press a key you'll see a >>> prompt welcoming you to the
REPL!
If you have trouble getting to the >>> prompt, try pressing Ctrl + C a few more times.
The first thing you get from the REPL is information about your board.
This line tells you the version of CircuitPython you're using and when it was released.
Next, it gives you the type of board you're using and the type of microcontroller the
board uses. Each part of this may be different for your board depending on the
versions you're working with.
This is followed by the CircuitPython prompt.
Interacting with the REPL
From this prompt you can run all sorts of commands and code. The first thing you'll do
is run help() . This will tell you where to start exploring the REPL. To run code in the
First part of the message is another reference to the version of CircuitPython you're
using. Second, a URL for the CircuitPython related project guides. Then... wait. What's
this? To list built-in modules type `help("modules")`. Remember the
modules you learned about while going through creating code? That's exactly what
this is talking about! This is a perfect place to start. Let's take a look!
Type help("modules") into the REPL next to the prompt, and press enter.
This is a list of all the core modules built into CircuitPython, including board .
Remember, board contains all of the pins on the board that you can use in your
code. From the REPL, you are able to see that list!
Type import board into the REPL and press enter. It'll go to a new prompt. It might
look like nothing happened, but that's not the case! If you recall, the import
statement simply tells the code to expect to do something with that module. In this
case, it's telling the REPL that you plan to do something with that module.
Next, type dir(board) into the REPL and press enter.
However, import statements can also sometimes look like the following:
from library_or_module import name
•
from library_or_module.subpackage import name
•
from library_or_module import name as local_name
•
They can also have more complicated formats, such as including a try / except
block, etc.
The important thing to know is that an import statement will always include the
name of the module or library that you're importing.
Therefore, the best place to start is by reading through the import statements.
Here is an example import list for you to work with in this section. There is no setup or
other code shown here, as the purpose of this section involves only the import list.
import time
import board
import neopixel
import adafruit_lis3dh
import usb_hid
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
Keep in mind, not all imported items are libraries. Some of them are almost always
built-in CircuitPython modules. How do you know the difference? Time to visit the
REPL.
In the Interacting with the REPL section() on The REPL page() in this guide, the
help("modules") command is discussed. This command provides a list of all of the
built-in modules available in CircuitPython for your board. So, if you connect to the
serial console on your board, and enter the REPL, you can run help("modules") to
see what modules are available for your board. Then, as you read through the impor
t statements, you can, for the purposes of figuring out which libraries to load, ignore
the statement that import modules.
The following is the list of modules built into CircuitPython for the Feather RP2040.
Your list may look similar or be anything down to a significant subset of this list for
Now that you know what you're looking for, it's time to read through the import
statements. The first two, time and board , are on the modules list above, so they're
built-in.
The next one, neopixel , is not on the module list. That means it's your first library!
So, you would head over to the bundle zip you downloaded, and search for neopixel.
There is a neopixel.mpy file in the bundle zip. Copy it over to the lib folder on your CI
RCUITPY drive. The following one, adafruit_lis3dh , is also not on the module list.
Follow the same process for adafruit_lis3dh, where you'll find adafruit_lis3dh.mpy,
and copy that over.
The fifth one is usb_hid , and it is in the modules list, so it is built in. Often all of the
built-in modules come first in the import list, but sometimes they don't! Don't assume
that everything after the first library is also a library, and verify each import with the
modules list to be sure. Otherwise, you'll search the bundle and come up empty!
The final two imports are not as clear. Remember, when import statements are
formatted like this, the first thing after the from is the library name. In this case, the
library name is adafruit_hid . A search of the bundle will find an adafruit_hid folder.
When a library is a folder, you must copy the entire folder and its contentsas it is in
the bundle to the lib folder on your CIRCUITPY drive. In this case, you would copy the
entire adafruit_hid folder to your CIRCUITPY/lib folder.
Notice that there are two imports that begin with adafruit_hid . Sometimes you will
need to import more than one thing from the same library. Regardless of how many
times you import the same library, you only need to load the library by copying over
the adafruit_hid folder once.
That is how you can use your example code to figure out what libraries to load on
There are cases, however, where libraries require other libraries internally. The
internally required library is called a dependency. In the event of library
dependencies, the easiest way to figure out what other libraries are required is to
connect to the serial console and follow along with the ImportError printed there.
The following is a very simple example of an ImportError , but the concept is the
same for any missing library.
Example: ImportError Due to Missing
Library
If you choose to load libraries as you need them, or you're starting fresh with an
existing example, you may end up with code that tries to use a library you haven't yet
loaded. This section will demonstrate what happens when you try to utilise a library
that you don't have loaded on your board, and cover the steps required to resolve the
issue.
This demonstration will only return an error if you do not have the required library
loaded into the lib folder on your CIRCUITPY drive.
Let's use a modified version of the Blink example.
import board
import time
import simpleio
led = simpleio.DigitalOut(board.LED)
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
Save this file. Nothing happens to your board. Let's check the serial console to see
You have an ImportError . It says there is no module named 'simpleio' . That's
the one you just included in your code!
Click the link above to download the correct bundle. Extract the lib folder from the
downloaded bundle file. Scroll down to find simpleio.mpy. This is the library file you're
looking for! Follow the steps above to load an individual library file.
The LED starts blinking again! Let's check the serial console.
No errors! Excellent. You've successfully resolved an ImportError !
If you run into this error in the future, follow along with the steps above and choose
the library that matches the one you're missing.
Library Install on Non-Express Boards
If you have an M0 non-Express board such as Trinket M0, Gemma M0, QT Py M0, or
one of the M0 Trinkeys, you'll want to follow the same steps in the example above to
install libraries as you need them. Remember, you don't need to wait for an ImportEr
ror if you know what library you added to your code. Open the library bundle you
downloaded, find the library you need, and drag it to the lib folder on your CIRCUITPY
drive.
You can still end up running out of space on your M0 non-Express board even if you
only load libraries as you need them. There are a number of steps you can use to try
to resolve this issue. You'll find suggestions on the Troubleshooting page().
Updating CircuitPython Libraries and
Examples
Libraries and examples are updated from time to time, and it's important to update the
files you have on your CIRCUITPY drive.
To update a single library or example, follow the same steps above. When you drag
the library file to your lib folder, it will ask if you want to replace it. Say yes. That's it!
designed for CircuitPython, and have limited RAM and flash space; using the RFM
breakouts or FeatherWings with more capable boards will be easier.
Asyncio and Interrupts
Is there asyncio support in CircuitPython?
There is support for asyncio starting with CircuitPython 7.1.0, on all boards except
the smallest SAMD21 builds. Read about using it in the Cooperative Multitasking in
CircuitPython() Guide.
Does CircuitPython support interrupts?
No. CircuitPython does not currently support interrupts - please use asyncio for
multitasking / 'threaded' control of your code
Status RGB LED
My RGB NeoPixel/DotStar LED is blinking funny colors what does it mean?
The status LED can tell you what's going on with your CircuitPython board. Read
more here for what the colors mean!()
Memory Issues
What is a MemoryError?
Memory allocation errors happen when you're trying to store too much on the
board. The CircuitPython microcontroller boards have a limited amount of memory
available. You can have about 250 lines of code on the M0 Express boards. If you
try to import too many libraries, a combination of large libraries, or run a program
with too many lines of code, your code will fail to run and you will receive a
MemoryError in the serial console.
What do I do when I encounter a MemoryError?
Try resetting your board. Each time you reset the board, it reallocates the memory.
While this is unlikely to resolve your issue, it's a simple step and is worth trying.
Make sure you are using .mpy versions of libraries. All of the CircuitPython libraries
are available in the bundle in a .mpy format which takes up less memory than .py
format. Be sure that you're using the latest library bundle() for your version of
CircuitPython.
If that does not resolve your issue, try shortening your code. Shorten comments,
remove extraneous or unneeded code, or any other clean up you can do to
shorten your code. If you're using a lot of functions, you could try moving those
into a separate library, creating a .mpy of that library, and importing it into your
code.
You can turn your entire file into a .mpy and import that into code.py. This means
you will be unable to edit your code live on the board, but it can save you space.
Can the order of my import statements affect memory?
It can because the memory gets fragmented differently depending on allocation
order and the size of objects. Loading .mpy files uses less memory so its
recommended to do that for files you aren't editing.
How can I create my own .mpy files?
You can make your own .mpy versions of files with mpy-cross .
You can download mpy-cross for your operating system from here(). Builds are
available for Windows, macOS, x64 Linux, and Raspberry Pi Linux. Choose the
latest mpy-cross whose version matches the version of CircuitPython you are
using.
To make a .mpy file, run ./mpy-cross path/to/yourfile.py to create a
yourfile.mpy in the same directory as the original file.
How do I check how much memory I have free?
Run the following to see the number of bytes available for use:
Connecting to the serial console on Mac does not require installing any drivers or
extra software. You'll use a terminal program to find your board, and screen to
connect to it. Terminal and screen both come installed by default.
What's the Port?
First you'll want to find out which serial port your board is using. When you plug your
board in to USB on your computer, it connects to a serial port. The port is like a door
through which your board can communicate with your computer using USB.
The easiest way to determine which port the board is using is to first check without
the board plugged in. Open Terminal and type the following:
ls /dev/tty.*
Each serial connection shows up in the /dev/ directory. It has a name that starts with
tty. . The command ls shows you a list of items in a directory. You can use * as a
wildcard, to search for files that start with the same letters but end in something
different. In this case, you're asking to see all of the listings in /dev/ that start with t
ty. and end in anything. This will show us the current serial connections.
Now, plug your board. In Terminal, type:
ls /dev/tty.*
This will show you the current serial connections, which will now include your board.
A new listing has appeared called /dev/tty.usbmodem141441 . The tty.usbmodem1
41441 part of this listing is the name the example board is using. Yours will be called
something similar.
Using Linux, a new listing has appeared called /dev/ttyACM0 . The ttyACM0 part of
this listing is the name the example board is using. Yours will be called something
similar.
Connect with screen
Now that you know the name your board is using, you're ready connect to the serial
console. You're going to use a command called screen . The screen command is
included with MacOS. To connect to the serial console, use Terminal. Type the
following command, replacing board_name with the name you found your board is
using:
screen /dev/tty.board_name 115200
The first part of this establishes using the screen command. The second part tells
screen the name of the board you're trying to use. The third part tells screen what
baud rate to use for the serial connection. The baud rate is the speed in bits per
second that data is sent over the serial connection. In this case, the speed required
Your MakeCode is now running and CircuitPython has been removed. Going forward
you only have to single click the reset button to get to CPLAYBOOT. This is an
idiosyncrasy of MakeCode.
Moving to Arduino
If you want to use Arduino instead, you just use the Arduino IDE to load an Arduino
program. Here's an example of uploading a simple "Blink" Arduino program, but you
don't have to use this particular program.
Start by plugging in your board, and double-clicking reset until you get the green
onboard LED(s).
Within Arduino IDE, select the matching board, say Circuit Playground Express.
Select the correct matching Port:
Create a new simple Blink sketch example:
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Make sure the LED(s) are still green, then click Upload to upload Blink. Once it has
uploaded successfully, the serial Port will change so re-select the new Port!
Once Blink is uploaded you should no longer need to double-click to enter
bootloader mode. Arduino will automatically reset when you upload.
Troubleshooting
From time to time, you will run into issues when working with CircuitPython. Here are
a few things you may encounter and how to resolve them.
As CircuitPython development continues and there are new releases, Adafruit
will stop supporting older releases. Visit https://circuitpython.org/downloads to
download the latest version of CircuitPython for your board. You must download
the CircuitPython Library Bundle that matches your version of CircuitPython.
Please update CircuitPython and then visit https://circuitpython.org/libraries to
download the latest Library Bundle.
Always Run the Latest Version of
CircuitPython and Libraries
As CircuitPython development continues and there are new releases, Adafruit will
stop supporting older releases. You need to update to the latest CircuitPython.().
You need to download the CircuitPython Library Bundle that matches your version of
CircuitPython. Please update CircuitPython and then download the latest bundle().
As new versions of CircuitPython are released, Adafruit will stop providing the
previous bundles as automatically created downloads on the Adafruit CircuitPython
Library Bundle repo. If you must continue to use an earlier version, you can still
download the appropriate version of mpy-cross from the particular release of
CircuitPython on the CircuitPython repo and create your own compatible .mpy library
files. However, it is best to update to the latest for both CircuitPython and the library
Select all the devices you want to remove, and then press Delete. It is usually safe
just to select everything. Any device that is removed will get a fresh install when you
plug it in. Using the Device Cleanup Tool also discards all the COM port assignments
for the unplugged boards. If you have used many Arduino and CircuitPython boards,
you have probably seen higher and higher COM port numbers used, seemingly
without end. This will fix that problem.
Serial Console in Mu Not Displaying
Anything
There are times when the serial console will accurately not display anything, such as,
when no code is currently running, or when code with no serial output is already
running before you open the console. However, if you find yourself in a situation
where you feel it should be displaying something like an error, consider the following.
Depending on the size of your screen or Mu window, when you open the serial
console, the serial console panel may be very small. This can be a problem. A basic
CircuitPython error takes 10 lines to display!
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 7
SyntaxError: invalid syntax
Press any key to enter the REPL. Use CTRL-D to reload.
Therefore, if your serial console panel is five lines tall or less, you may only see blank
lines or blank lines followed by Press any key to enter the REPL. Use CTRL-D
to reload. . If this is the case, you need to either mouse over the top of the panel to
utilise the option to resize the serial panel, or use the scrollbar on the right side to
scroll up and find your message.
This applies to any kind of serial output whether it be error messages or print
statements. So before you start trying to debug your problem on the hardware side,
be sure to check that you haven't simply missed the serial messages due to serial
output panel height.
code.py Restarts Constantly
CircuitPython will restart code.py if you or your computer writes to something on the
CIRCUITPY drive. This feature is called auto-reload, and lets you test a change to your
program immediately.
Some utility programs, such as backup, anti-virus, or disk-checking apps, will write to
the CIRCUITPY as part of their operation. Sometimes they do this very frequently,
causing constant restarts.
Acronis True Image and related Acronis programs on Windows are known to cause
this problem. It is possible to prevent this by disabling the "()Acronis Managed
Machine Service Mini"().
If you cannot stop whatever is causing the writes, you can disable auto-reload by
putting this code in boot.py or code.py:
import supervisor
supervisor.runtime.autoreload = False
CircuitPython RGB Status Light
Nearly all CircuitPython-capable boards have a single NeoPixel or DotStar RGB LED
on the board that indicates the status of CircuitPython. A few boards designed before
CircuitPython existed, such as the Feather M0 Basic, do not.