40118bcf57
This changes lots of files to unify `board.h` across ports. It adds `board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to deinit the board before deep sleeping (even when pretending.) Deep sleep is now a two step process for the port. First, the port should prepare to deep sleep based on the given alarms. It should set alarms for both deep and pretend sleep. In particular, the pretend versions should be set immediately so that we don't miss an alarm as we shutdown. These alarms should also wake from `port_idle_until_interrupt` which is used when pretending to deep sleep. Second, when real deep sleeping, `alarm_enter_deep_sleep` is called. The port should set any alarms it didn't during prepare based on data it saved internally during prepare. ESP32-S2 sleep is a bit reorganized to locate more logic with TimeAlarm. This will help it scale to more alarm types. Fixes #3786 |
||
---|---|---|
.. | ||
README.md | ||
board.c | ||
mpconfigboard.h | ||
mpconfigboard.mk | ||
pins.c |
README.md
Setup
The Electronut Labs Papyr
board is based on the nRF52840
SoC from
Nordic Semiconductors. It has an e-ink display on it, along with a CR2477
battery holder.
Papyr can be programmed with the Adafruit nRF52 bootloader
to
Schematic, datasheet default pin mapping etc. can be found over here. The default pin mapping can be found in the board directory.
Installing CircuitPython submodules
Before you can build, you will need to run the following commands once, which
will install the submodules that are part of the CircuitPython ecosystem, and
build the mpy-cross
tool:
$ cd circuitpython
$ git submodule update --init
$ make -C mpy-cross
Installing the Bootloader
If the Adafruit nRF52 bootloader
is installed on the board, then the
bootloader allows you to update the core CircuitPython firmware and internal
file system contents using serial, or USB CDC, or USB mass storage.
On empty devices, the bootloader will need to be flashed once using a HW debugger such as a Segger J-Link, or Blackmagicprobe (or Electronut labs Bumpy).
Building and Flashing CircuitPython
No special notes for this, follow ports/nrf
generic README.md
.
Flashing CircuitPython with MSC UF2
uf2
file is generated last by all
target.
$ cd ports/nrf
$ make V=1 SD=s140 SERIAL=/dev/ttyACM0 BOARD=electronut_labs_papyr all
...
...
python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-electronut_labs_papyr-s140/firmware.uf2" build-electronut_labs_papyr-s140/firmware.hex
Converting to uf2, output size: 536576, start address: 0x26000
Wrote 536576 bytes to build-electronut_labs_papyr-s140/firmware.uf2
Simply drag and drop firmware.uf2 to the MSC, the nrf52840 will blink fast and reset after done.
Other tips
Once circuitpython is running on your board, it will come up as a mass storage
device named CIRCUITPY
, where you can drop in your python code. The file names
it looks for are main.py
, main.txt
, code.py
or code.txt
.