SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions about processor boards have here!
User avatar
By woodsb02
#224678
Does anyone know how to get CircuitPython 6.x series working on this board?

The version of CircuitPython downloadable in the SparkFun tutorial is the 4.x series, which is quite out of date now. Despite that, it seems to work - I can connect to the serial console, see the CircuitPython mass storage device, and uploaded code.py files run ok.
https://learn.sparkfun.com/tutorials/nr ... stallation

The version of CircuitPython 6.1.0 UF2 made for this board downloadable from the CircuitPython website doesn’t seem to work - I see the CircuitPython mass storage device in Windows 10, but I can’t connect to a serial console (making debugging hard) and any program I save to code.py doesn’t seem to run.
https://circuitpython.org/board/sparkfun_nrf52840_mini/

Anyone got a newer version working? If so, any tips on how?
User avatar
By woodsb02
#224689
Some further information below on my board below.

Version of CircuitPython included in the above SparkFun tutorial (as seen on the REPL):
Code: Select all
Adafruit CircuitPython 4.0.0-alpha.3-32-gab94344ba on 2018-11-29; SparkFun Pro nRF52840 Mini with nRF52840

Bootloader details (as seen in INFO_UF2.TXT on the NRF52BOOT mass storage device):
Code: Select all
UF2 Bootloader 1.00
Model: SparkFun nRF52840 Mini
Board-ID: SparkFun nRF52840 Mini
Bootloader: s140 6.1.1 r0
Date: Nov 26 2018
User avatar
By woodsb02
#224692
The following example code from the SparkFun tutorial doesn't seem to flash the red LED as it should on CircuitPython 6.1:

https://learn.sparkfun.com/tutorials/nr ... n-examples
Code: Select all
import time
import board
from digitalio import DigitalInOut, Direction, Pull

led = DigitalInOut(board.P0_07)
led.direction = Direction.OUTPUT

while True:
    led.value = False
    time.sleep(0.5)
    led.value = True
    time.sleep(0.5)
User avatar
By woodsb02
#224694
Trying to dissect in which release the problem started, I have found that on CircuitPython 6.0.0 and 6.0.1:
  • The serial console works fine, and I can now access the REPL to debug the program
  • The variable name for the LED has changed from P0_07 to LED1 - see the error below
Code: Select all
AttributeError: 'module' object has no attribute 'P0_07'
Once I change the variable name from P0_07 to LED1, the program AND the serial console now work again under 6.1.0. So its interesting to find that under 6.1.0 naming this variable incorrectly causes both the program to not work and the serial console to not allow connections, but if the variables is named correctly both the program and the serial console work fine.

Under 6.0.1, if the variable is named incorrectly, the program will not work, but the serial console does, so its easy enough to connect again debug the issue.
User avatar
By woodsb02
#224696
It seems like from CircuitPython 6.1.0 onwards, the serial console doesn't allow connections if there isn't a working program in code.py.

This program works, and allows serial console connections:
Code: Select all
import time

while True:
    print("hello")
    time.sleep(1)

This program does not work, and breaks the serial console connections:
Code: Select all
import time
User avatar
By woodsb02
#224697
A couple of the variables have changed (not just the LED):
  • P0_07 is now LED1
  • P0_13 is now BUTTON1
More below
Code: Select all
Adafruit CircuitPython 4.0.0-alpha.3-32-gab94344ba on 2018-11-29; SparkFun Pro nRF52840 Mini with nRF52840
>>> import board
>>> dir(board)
['A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'BUTTON1', 'BUTTON2', 'BUTTON3', 'BUTTON4', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'L', 'LED1', 'LED2', 'LED3', 'LED4', 'MISO', 'MOSI', 'P0_00', 'P0_01', 'P0_02', 'P0_03', 'P0_04', 'P0_05', 'P0_06', 'P0_07', 'P0_08', 'P0_09', 'P0_10', 'P0_11', 'P0_12', 'P0_13', 'P0_14', 'P0_15', 'P0_16', 'P0_17', 'P0_19', 'P0_20', 'P0_21', 'P0_22', 'P0_23', 'P0_24', 'P0_25', 'P0_26', 'P0_27', 'P0_28', 'P0_29', 'P0_30', 'P0_31', 'P1_00', 'P1_01', 'P1_02', 'P1_03', 'P1_04', 'P1_05', 'P1_06', 'P1_07', 'P1_08', 'P1_09', 'P1_10', 'P1_11', 'P1_12', 'P1_13', 'P1_14', 'P1_15', 'RX', 'SCK', 'SCL', 'SDA', 'TX', 'UART']

Code: Select all
Adafruit CircuitPython 6.1.0 on 2021-01-21; SparkFun Pro nRF52840 Mini with nRF52840
>>> import board
>>> dir(board)
['__class__', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'BUTTON1', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'I2C', 'LED1', 'MISO', 'MOSI', 'QWIIC', 'RX', 'SCK', 'SCL', 'SDA', 'SPI', 'TX', 'UART']
User avatar
By tannewt
#224728
woodsb02 wrote: Mon Apr 05, 2021 3:14 am It seems like from CircuitPython 6.1.0 onwards, the serial console doesn't allow connections if there isn't a working program in code.py.

This program works, and allows serial console connections:
Code: Select all
import time

while True:
    print("hello")
    time.sleep(1)

This program does not work, and breaks the serial console connections:
Code: Select all
import time
How are connecting to the REPL? Does it do this in 6.2.x? If it does, please file an issue: https://github.com/adafruit/circuitpyth ... new/choose
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]