Commit Graph

75 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 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 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 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 1bd0c08a76 nrf: pinetime: Enable VFS
LFS2 will be handled by the Makefile...
2020-02-09 19:45:20 +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 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 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
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
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
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
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 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 1fe1ff935b nrf: Clean up source by removing tabs, trailing spaces, non-ASCII chars. 2019-08-28 13:34:45 +10:00
Glenn Ruben Bakke d889def06b nrf/led: Adjust how board LEDs are defined.
Change static LED functions to lowercase names, and trim down source code
lines for variants of MICROPY_HW_LED_COUNT.  Also rename configuration for
MICROPY_HW_LEDx_LEVEL to MICROPY_HW_LEDx_PULLUP to align with global PULLUP
configuration.
2019-06-25 16:02:31 +10:00
Damien George 7e21cf723a nrf: Change types to size_t for all uses of mp_obj_str_get_data. 2019-05-13 12:39:56 +10:00
Nguyen Hoan Hoang 9a6f6fd68d nrf/boards: Add support for BLYST Nano module based boards.
- IBK-BLYST-NANO: Breakout board
- IDK-BLYST-NANO: DevKit board with builtin IDAP-M CMSIS-DAP Debug JTAG,
  RGB led
- BLUEIO-TAG-EVIM: Sensor tag board (environmental sensor
  (T, H, P, Air quality) + 9 axis motion sensor)

Also, the LED module has been updated to support individual base level
configuration of each LED. If set, this will be used instead of the
common configuration, MICROPY_HW_LED_PULLUP. The new configuration,
MICROPY_HW_LEDX_LEVEL, where X is the LED number can be used to set
the base level of the specific LED.
2019-05-02 22:33:44 +02:00
Glenn Ruben Bakke 696549d2e5 nrf/bluetooth: Deprecate use of SoftDevice s140 v6.0.0.
Removing linker script for nrf52840 s140 v6.0.0 as pca10056
target board now points to the new v6.1.1. Also, removing the
entry from the download_ble_stack.sh script.
2019-03-15 20:50:15 +01:00
Glenn Ruben Bakke a3a266a9c3 nrf/board: Migrate nrf52840 target to new BLE stack.
This patch moves pca10056/nrf52840 target board to use
the new SoftDevice s140 v6.1.1 instead of the legacy v6.0.0.
2019-03-15 20:50:15 +01:00
Glenn Ruben Bakke d3c1436e75 nrf/bluetooth: Add support for SoftDevice s140 version 6.1.1.
Updating download script to fetch the new SoftDevice, and
adding corresponding linker script for the BLE stack.
2019-03-15 20:50:15 +01:00
Glenn Ruben Bakke 1e5e3e3d48 nrf/bluetooth: Deprecate use of SoftDevice s132 v6.0.0.
Removing linker script for nrf52832 s132 v6.0.0 as all target
boards now points to the new v6.1.1. Also, removing the entry
from the download_ble_stack.sh script.
2019-03-15 20:50:15 +01:00
Glenn Ruben Bakke 5f26ef1112 nrf/board: Migrate all nrf52832 targets to new BLE stack.
This patch moves all the nrf52832 target boards to use the
new SoftDevice s132 v6.1.1 instead of the legacy v6.0.0.
2019-03-15 20:50:15 +01:00
Nguyen Hoan Hoang e8ed2dea71 nrf/bluetooth: Add support for SoftDevice s132 version 6.1.1.
Updating download script to fetch the new SoftDevice, and
adding corresponding linker script for the BLE stack.
2019-03-15 20:50:15 +01:00
Damien George 6e30f96b0b ports: Convert legacy uppercase macro names to lowercase. 2019-02-12 14:54:51 +11:00
Damien George 6ac4304284 nrf/boards/microbit: Use MICROPY_PY_BUILTINS_FLOAT to detect FP support.
This works for both single and double precision float.
2018-07-20 14:11:28 +10:00
Damien George 9addc38af4 nrf: Properly use (void) instead of () for function definitions. 2018-07-20 14:11:28 +10:00
Ayke van Laethem 2f0f4fdcd3
nrf: Use mp_raise_ValueError instead of nlr_raise(...)
Saves 60 bytes on the nRF52 with SD disabled. There will be a bigger
saving with SD enabled and/or on the micro:bit board.
2018-07-18 15:25:17 +02:00
Glenn Ruben Bakke cf58ef27af nrf: Quick-fix on const objects with open array dimension in objtuples.
Temporarly solving the issue of
"differ from the size of original declaration [-Werror=lto-type-mismatch]
until linker is fixed in upcomming release of gcc.

Bug is reported by others, and will be fixed in next version of arm-gcc.
However, this patch makes it possible to use modmusic and modimage
with current compilers.

Alternativly, the code can be compiled with LTO=0, but uses valuable 9K
more on this already squeezed target (microbit).
2018-07-18 17:12:26 +10:00
Ayke van Laethem 0e5f8425ea nrf/boards: Check for stack/heap size using an assert.
The main effect of this is that the .bss is now accurate and doesn't
include the stack and minimum heap size.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 7144e87ced nrf/bluetooth: Add support for s132/s140 v6, remove s132 v2/3/5
Support added for s132/s140 v6 in linker scripts and boards.
Support removed for s132 v2/3/5.

Download script updated to fetch new stacks and removed the
non-supported ones.

ble_drv.c updated to only handle s110 v8, and s132/s140 v6.

ubluepy updated to continue scanning after each individual scan
report reported to the module to keep old behaviour of the
Scanner class.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke db67a5000f nrf: Generalize feather52 target
This patch generalize the feather52 target to be a board without
an in-built Bluetooth stack or bootloader giving all flash memory to
micropython code.

This way the feather52 target can run any supported Bluetooth LE
stack the port supports for other nrf52832 targets. Hence, this
make Makefiles/linker scripts and BLE driver support easier
to maintain in the future.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 774638e2a9 nrf/boards/feather52: Move phony targets to main Makefile
dfu-gen .PHONY target is run unconditionally as first build
target when included, and might fail if the hex file is not
yet generated.

To prevent this, the dfu-gen and dfu-flash targets are moved
to the main Makefile and only exposed if feather52 is the
defined BOARD.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 03da4e33fb nrf/bluetooth: Fixes for s132 v5 BLE stack
Removing unused nrf52832_512k_64k_s132_5.0.0.ld.

Adding new linker script s132_5.0.0 following new
linker script scheme.

Updating ble_drv.c to handle de-increment of
outstanding tx packets on hvx for s132 v5.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 0f7da42c75 nrf/modules/random: Rename port config for RNG
Renaming config for enabling random module with hw
random number generator from MICROPY_PY_HW_RNG to
MICROPY_PY_RANDOM_HW_RNG to indicate which module it
is configuring.

Also, disabling the config by default in mpconfigport.h.

Adding the enable of RNG in all board configs.

Moving ifdef in modrandom, which test for the config being
set, earlier in the code. This is to prevent un-necessary
includes if not needed.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke f4382a2885 nrf/boards/wt51822_s4at: Fixes after nrfx and Pin IRQ introduction 2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 72aacef02e nrf/boards: Remove unused defines from board config headers 2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 6e8a605500 nrf/modules/machine/pin: Add support for IRQ on Pin's
This patch ads irq method to the pin object. Handlers
registered in the irq method will be kept as part of the
ROOT_POINTERS.

In order to resolve which pin object is the root of the
IRQ, the pin_find has been extended to also be able to
search up Pin objects based on mp_int_t pin number.
This also implies that the Pin.new API is now also supporting
creation of Pin objects based on the integer value of the
pin instead of old style mandating string name of the Pin.

All boards have been updated to use real pin number from
0-48 instead of pin_Pxx for UART/SPI and music module pins.

UART/SPI/modmusic has also been updated to use pin number
provided directly or look up the Pin object based on the
integer value of the pin (modmusic).

Pin generation has been updated to create a list of pins, where
the board/cpu dicts are now refering to an index in this list
instead of having one const declaration for each pin. This new
const table makes it possible to iterate through all pins generated
in order to locate the correct Pin object.
2018-07-18 17:12:26 +10:00
Glenn Ruben Bakke 864f671744 nrf: Remove port member from Pin object
In order to be able to support GPIO1 port on nrf52840
the port has been removed from the Pin object.

All pins on port1 will now be incrementally on top of
the pin numbers for gpio0. Hence, Pin 1.00 will become
P32, and Pin 1.15 will become P47.

The modification is done to address the new gpio HAL
interface in nrfx, which resolves the port to be
configured base on a multiple of 32.

The patch also affects the existing devices which does
not have a second GPIO port in the way that the
port indication A and B is removed from Pin generation.
This means that the port which was earlier addressed
as PA0 is now P0, and PA31 is P31.

Also, this patch removes the gpio member which earlier
pointed to the perihperal GPIO base address. This is not
needed anymore, hence removed.
2018-07-18 17:12:26 +10:00
Ayke van Laethem 2de65dda22 nrf: Make linker scripts more modular.
With all the variation in chips and boards it's tedious to copy and
redefine linker scripts for every option. Making linker scripts more
modular also opens up more possibilities, like enabling/disabling the
flash file system from the Makefile - or even defining it's size from a
Makefile argument (FS_SIZE=12 for a 12kB filesystem if tight on space).
2018-07-18 17:12:26 +10:00