Commit Graph

216 Commits (6df2db3f4cbe046eac17d7893d66a6c077228402)

Author SHA1 Message Date
Daniel Thompson 6df2db3f4c k9: Add support for Senbono K9
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-09 19:58:40 +01:00
Daniel Thompson 773d3b6d40 nrf: ble_uart: Feed the 'dog when transmitting characters
On systems that cannot feed the watchdog from an ISR (e.g. anything
without a button) then tab completion is risky because the watchdog might
fire before all the options are listed. Fix this by feeding the dog from
the tx routine.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-09 19:58:25 +01:00
Daniel Thompson c7cf47a368 nrf: p8: Align with PineTime
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-27 22:11:16 +01:00
Daniel Thompson 89f48aca20 nrf: machine: Add mechanism to starve the watchdog
A soft reset doesn't reconfigure the watchdog which means if previous
software on the device has set a bad timeout then we are stuck without
until the battery runs flat or a watchdog reset takes place. Add a
mechanism to stop feeding the dog so that we can wait for it to trigger.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-26 20:57:58 +01:00
Daniel Thompson 9d5e23fc71 nrf: ubluepy: Provide visiblity of the BLE UART connect status
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-24 17:02:16 +01:00
Daniel Thompson 13f086deeb nrf: mpconfigport: Enable ujson
This is mostly use for BLE comms since it allows us to easily share
data structures with our peers.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-19 20:42:39 +01:00
Daniel Thompson df61f43d56 Merge branch 'wasp-os' of github.com:daniel-thompson/micropython into wasp-os 2020-06-30 23:00:34 +01:00
Daniel Thompson d8c3988cf1 nrf: ble_uart: Add scheduler and power management support
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-30 22:58:25 +01:00
Daniel Thompson 9840d3c596 nrf: Enable the scheduler by default
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-30 22:57:49 +01:00
Daniel Thompson 1dcf4bae0f
Merge pull request #1 from pebri86/p8-devel
Add support for p8-watch
2020-06-25 11:04:06 +01:00
Fuji Pebri 266822fd33 add support for p8-watch
Signed-off-by: Fuji Pebri <pebri86@gmail.com>
2020-06-18 16:02:26 +07:00
Daniel Thompson d11200432c nrf: Enable persistant code loading
This allows us to load .mpy files stored in the filesystem without having
to invoke the compiler (e.g. with a much lower memory overhead).

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-17 21:33:18 +01:00
Daniel Thompson 0abaa09f89 nrf: dsd6,pinetime,nitrogen: Disable micro:bit filesystem
Currently pinetime reserves 64k of FLASH for an unused file system. This
is pointless because we have a 4MB SPI flash that we can use as a
filesystem.

It is also pointless on dsd6 and nitrogen because we'd prefer to run
without a filesystem than to have something so stunted!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-17 21:32:22 +01:00
Daniel Thompson 8ea3211068 nrf: linker scripts: Reserve the first 32 bytes of RAM
These 32 bytes can be used as pseudo-NVRAM to allow communication between
the payload and the bootloader. The pseudo-NVRAM driver can be written in
pure python (using machine.mem32) so there no code changes beyond reserving
the memory are required.
2020-05-09 14:13:47 +01:00
Daniel Thompson 5424de70d7 nrf: modmachine: Enable direct memory access from python 2020-04-26 14:56:03 +01:00
Daniel Thompson 7f8eda310d nrf: config: Enable uio and sys.stdio files 2020-04-11 20:10:41 +01:00
Daniel Thompson 2e5cb3eb32 nrf: utime: Add localtime and mktime calls
Currently the nrf port doesn't implement a proper RTC (it exposes
raw RTCounters instead) but it is still useful to implement
localtime() and mktime() (although the argument to localtime becomes
mandatory).
2020-02-19 19:29:17 +00:00
Daniel Thompson a982035fdf nrf: uos: Add support for LFS1 and LFS1 2020-02-09 19:45:47 +00:00
Daniel Thompson 1bd0c08a76 nrf: pinetime: Enable VFS
LFS2 will be handled by the Makefile...
2020-02-09 19:45:20 +00:00
Daniel Thompson 99d8d1b8da nrf: Enable input() and array slice assignment 2020-02-09 19:44:51 +00:00
Daniel Thompson b2273b5d22 nrf: Feed the watchdog from the RTC interrupt
Feeding a watchdog from a periodic interrupt isn't the smartest thing
to do (unless you have setup multi-channels) so we also allow us to
express to the WDT driver whether we've arrived from an ISR or not.
2020-02-01 13:10:23 +00:00
Daniel Thompson 5f5b7bdb25 Revert "nrf: spi: Feed the watchdog from machine.SPI.write()"
This reverts commit 1d1cd68713.
2020-02-01 13:06:20 +00:00
Daniel Thompson 035ece788f nrf: Hide RTCounter(0) when Softdevice is enabled
On systems with a Softdevice then RTC0 is reserved and cannot
be used by the application.
2020-02-01 13:03:04 +00:00
Daniel Thompson 3886bb16d1 nrf: Fix build BLE NUS and LTO=0 2020-02-01 13:01:54 +00:00
Daniel Thompson e668ed3ed3 nrf: pinetime: Improve pin descriptions 2020-01-29 17:26:11 +00:00
Daniel Thompson b6f0dee43e nrf: dsd6/nitrogen/pinetime: Enable native code gen 2020-01-28 18:18:58 +00:00
Daniel Thompson cb4ea0b35e nrf: Fix (frozen) native code generation 2020-01-28 18:14:40 +00:00
Daniel Thompson 1f96fb052f nrf: Add support for FROZEN_MANIFEST 2020-01-28 18:13:33 +00:00
Daniel Thompson 1d1cd68713 nrf: spi: Feed the watchdog from machine.SPI.write()
This is a temporary hack to prevent the WDT triggering during display
update loops (e.g. no return to REPL... which is currently when the dog
is fed).
2020-01-23 22:03:26 +00:00
Daniel Thompson ee1899688b nrf: Enable time.sleep() 2020-01-21 21:30:44 +00:00
Daniel Thompson 5457f42e7e nrf: pinetime: Enable WDT for this board 2020-01-20 08:01:24 +00:00
Daniel Thompson 09bebddc74 nrf: dsd6: Enable WDT for this board 2020-01-20 08:01:24 +00:00
Daniel Thompson a1584bb653 nrf: nitrogen: Enable the WDT for this port
Nitrogen *does* have a reset button... but it is good to have a platform
to test with.
2020-01-20 08:01:24 +00:00
Daniel Thompson ec24f8b6e2 nrf: Initial WDT-in-C implementation
Currently it is difficult to deploy uPy on form factor devices without
a reset pin. Any mistake in the boot code risks the system getting
stuck (at least until the battery goes flat). A watchdog and user
button can be combined to give a long-press reset that gives the user
a better shot at recovering the device before the battery runs down!
2020-01-20 08:01:24 +00:00
Daniel Thompson 9f819ce2fb nrf: pinetime: Add support for Pine64 PineTime 2020-01-20 08:01:24 +00:00
fanoush 1925b4f9fe nrf: dsd6: Add support for DS-D6 fitness tracker
From c4579ff251/micropython/micropython/DS-D6-micropython.diff

[daniel@redfelineninja.org.uk: Split out feature patches, minor clean ups]
2020-01-18 11:51:40 +00:00
Daniel Thompson 8020af26ed nrf: nitrogen: Add support for 96Boards BLE Nitrogen 2020-01-18 11:51:40 +00:00
Daniel Thompson 43a67b9f57 nrf: ble_uart: Allow boards to choose the advertised name 2020-01-18 11:51:40 +00:00
Daniel Thompson 98eb8b19d7 nrf: Enable NUS by default 2020-01-18 11:51:40 +00:00
fanoush 5a607e23bd nrf: Add support for DFU bootloader
From https://github.com/fanoush/ds-d6/blob/c4579ff25166722566c1b9251a20f99027972
588/micropython/micropython/DS-D6-micropython.diff

[daniel@redfelineninja.org.uk: Seperated out from the rest of the DS-D6
support]
2020-01-17 19:20:48 +00:00
Daniel Mizyrycki 2df6a0436d nrf/boards/particle_xenon: Enable USB CDC on Particle Xenon board. 2019-12-09 14:10:24 +11:00
Andrej Krejcir 210d053286 nrf/main: Execute boot.py/main.py frozen modules without a file system.
When the file system is not enabled, the boot.py and main.py modules will
still be executed, if they are frozen.
2019-12-05 23:11:12 +11:00
Damien George 799b6d1e0c extmod: Consolidate FAT FS config to MICROPY_VFS_FAT across all ports.
This commit removes the Makefile-level MICROPY_FATFS config and moves the
MICROPY_VFS_FAT config to the Makefile level to replace it.  It also moves
the include of the oofatfs source files in the build from each port to a
central place in extmod/extmod.mk.

For a port to enabled VFS FAT support it should now set MICROPY_VFS_FAT=1
at the level of the Makefile.  This will include the relevant oofatfs files
in the build and set MICROPY_VFS_FAT=1 at the C (preprocessor) level.
2019-11-11 11:37:38 +11:00
Damien George c13f9f209d all: Convert nlr_raise(mp_obj_new_exception_msg(x)) to mp_raise_msg(x).
This helper function was added a while ago and these are the remaining
cases to convert, to save a bit of code size.
2019-11-05 11:35:45 +11:00
Damien George 9aabb6c01b extmod: Factor out block-device struct to make independent of fatfs. 2019-10-29 12:12:37 +11:00
Damien George d2384efa80 py: Automatically provide weak links from "foo" to "ufoo" module name.
This commit implements automatic module weak links for all built-in
modules, by searching for "ufoo" in the built-in module list if "foo"
cannot be found.  This means that all modules named "ufoo" are always
available as "foo".  Also, a port can no longer add any other weak links,
which makes strict the definition of a weak link.

It saves some code size (about 100-200 bytes) on ports that previously had
lots of weak links.

Some changes from the previous behaviour:
- It doesn't intern the non-u module names (eg "foo" is not interned),
  which saves code size, but will mean that "import foo" creates a new qstr
  (namely "foo") in RAM (unless the importing module is frozen).
- help('modules') no longer lists non-u module names, only the u-variants;
  this reduces duplication in the help listing.

Weak links are effectively the same as having a set of symbolic links on
the filesystem that is searched last.  So an "import foo" will search
built-in modules first, then all paths in sys.path, then weak links last,
importing "ufoo" if it exists.  Thus a file called "foo.py" somewhere in
sys.path will still have precedence over the weak link of "foo" to "ufoo".

See issues: #1740, #4449, #5229, #5241.
2019-10-22 15:30:52 +11:00
Damien George d7a9388fe0 ports: Add new make target "submodules" which inits required modules. 2019-10-15 17:14:41 +11:00
Glenn Ruben Bakke 98c2eabaff nrf/boards: Add nrf9160 pca10090 board. 2019-10-10 21:36:20 +02:00
Glenn Ruben Bakke 82fe6b0526 nrf: Add nrf9160 base support.
This patch add basic building blocks for nrf9P60.

It also includes a secure bootloader which forwards all
possible peripherals that are user selectable to become
non-secure. After configuring Flash, RAM and peripherals
the secure bootloader will jump to the non-secure domain
where MicroPython is placed.

The minimum size of a secure boot has to be a flash
block of 32Kb, hence why the linker scripts are
offsetting the main application this much.

The RAM offset is set to 128K, to allow for later
integration of Nordic Semiconductor's BSD socket
library which reserves the range 0x20010000 - 0x2001FFFF.
2019-10-10 21:35:27 +02:00
Glenn Ruben Bakke 01a3110e36 nrf/boards: Add support for pca10059.
Add support for pca10059 with REPL over tinyusb USB CDC.

The board also includes a board specific module that will
recover UICR->REGOUT0 in case this has been erased.

This initial support does not preserve any existing bootloader
on the pca10090 in case this was present, and expects to use all
available flash on the device.
2019-10-10 20:21:07 +02:00