Commit Graph

198 Commits (1bd0c08a766839ffd2e945693475d3c8f5a64de1)

Author SHA1 Message Date
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
Glenn Ruben Bakke 60b0b69f20 nrf: Add tinyusb support for nrf52840.
Add nrf-port finyusb driver files. USB CDC can be activated
by board configuration files using the MICROPY_HW_USB_CDC.

Updating BLE driver, Makefile, nrfx-glue and main.c to plug
in the tinyusb stack.
2019-10-10 20:21:07 +02:00
Glenn Ruben Bakke 1571120dc2 nrf/device: Correct SPIM3 IRQ handler entry for nrf52840. 2019-10-10 20:21:07 +02:00
Damien George 2863dcdf4f nrf: Add support to activate MICROPY_PY_SYS_STDFILES.
Fixes issue #5162.
2019-10-08 16:38:04 +11:00
roland van straten a069340c1e nrf/main: Update the way the LED is used on startup.
In case of LED1 being present, do a short blink during startup
instead of turning it on and leave it on.
2019-10-02 22:17:54 +02:00
roland van straten 226399bcef nrf/led: Expose public API for LED manipulation.
Aligned implementation with the STM32 port.
Added empty functions to be used when no LED is available.
2019-10-02 22:09:43 +02:00
Glenn Ruben Bakke cf383412ef nrf/flash: Update flash driver to use nrfx_nvmc driver.
The the nrfx driver is aware of chip specific registers, while
the raw HAL abstraction is not. This driver enables use of NVMC
in non-secure domain for nrf9160.
2019-10-02 21:28:34 +02:00
Glenn Ruben Bakke c561ae61a1 nrf/uart: Add support for UARTE (EasyDMA). 2019-10-02 21:20:56 +02:00
Glenn Ruben Bakke 02a8c31eef nrf/temp: Move module configuration guard.
This patch moves the check for MICROPY_PY_MACHINE_TEMP to come
before the inclusion of nrf_temp.h. The nrf_temp.h depends on
the NRF_TEMP_Type which might not be defined for all nRF devices.
2019-10-02 21:15:48 +02:00
Glenn Ruben Bakke d2e730b727 nrf/i2c: Add support for TWIM (EasyDMA). 2019-10-02 20:42:06 +02:00
roland van straten ac112f88d0 nrf/boards: Add board definition for uBlox Nina B1 series BLE modules. 2019-09-17 11:33:48 +10:00
Jim Mussared 1f52a6f8e4 nrf/boards: Add Particle Xenon board configuration (an nRF52840). 2019-09-05 22:56:05 +10:00
Jim Mussared d36fc4682e nrf/Makefile: Add support for flashing with a Black Magic Probe.
Also rename "flash" target to "deploy" to match other ports (but provide
"flash" as an alias for backwards compatibility).
2019-09-05 22:56:05 +10:00
Jim Mussared 353ed7705f nrf/boards/make-pins.py: Fix gen of board pins to use correct index.
It was previously not taking into account that the list of pins was sparse,
so using the wrong index.  The boards/X/pins.csv was generating the wrong
data for machine.Pin.board.

As part of this fix rename the variables to make it more clear what the
list contains (only board pins).
2019-09-05 22:52:24 +10:00
Damien George 9e90e2528b nrf/machine/adc: Fix mapping of ADC channel to pin. 2019-09-05 22:13:04 +10:00
Damien George c7fb93b844 nrf/machine/adc: Allow to pass a Pin object in to ADC constructor. 2019-09-05 22:13:04 +10:00
Damien George b766a6971e nrf: Add ADC channel mapping to alt function table. 2019-09-05 22:13:04 +10:00
Damien George 9cad134a2f nrf/machine/adc: Add ADC.read_u16() method. 2019-09-05 22:13:04 +10:00
Damien George 1fe1ff935b nrf: Clean up source by removing tabs, trailing spaces, non-ASCII chars. 2019-08-28 13:34:45 +10:00