Issues with nrf52 port
When enable Bluetooth LE REPL (MICROPY_PY_BLE_NUS (1)), get the following errors:
LINK build-pca10059-s140/firmware.elf
/home/deb/esp/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pca10059-s140/drivers/usb/usb_cdc.o (symbol from plugin): in function usb_cdc_init': (.text+0x0): multiple definition of mp_hal_stdin_rx_chr'; build-pca10059-s140/drivers/bluetooth/ble_uart.o (symbol from plugin):(.text+0x0): first defined here
/home/deb/esp/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pca10059-s140/drivers/usb/usb_cdc.o (symbol from plugin): in function usb_cdc_init': (.text+0x0): multiple definition of mp_hal_stdout_tx_strn'; build-pca10059-s140/drivers/bluetooth/ble_uart.o (symbol from plugin):(.text+0x0): first defined here
/home/deb/esp/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pca10059-s140/drivers/usb/usb_cdc.o (symbol from plugin): in function usb_cdc_init': (.text+0x0): multiple definition of mp_hal_stdout_tx_strn_cooked'; build-pca10059-s140/drivers/bluetooth/ble_uart.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:497: build-pca10059-s140/firmware.elf] Error 1
Possibility to have Bluetooth and USB CDC REPL working simultaneously ?
My board has no ext. 32 kHz crystal and needs the following: CFLAGS += -DBLUETOOTH_LFCLK_RC to work properly, should this be an option in mpconfigboard.h ?
Micropython support for the SPIM — Serial peripheral interface master with EasyDMA ? Also, looked at the micropython examples, but was not able to find examples for controlling the peripherals in C/C++ - Pins, PWM, Timers … Any available ?
In, micropython/ports/nrf/modules/machine/adc.c in nrfx_saadc_simple_mode_set instead of NRF_SAADC_INPUT_DISABLED isn't supposed to be SAADC_OVERSAMPLE_OVERSAMPLE_Bypass ?
Nordic port for nrf51822, nrf52832 and nrf52840
This is an initial port for the nRF series including nrf51822, nrf52832 and nrf52840 support.
Modules currently supported:
- UART
- LED
- Pin
- ADC
- PWM (nrf52)
- SPI
- I2C
Additional micropython modules:
- music - backport of micro:bit music module for both nrf51 and nrf52 (+ ticker and softpwm drivers)
- Temperature
- RTC (Real time counter - low-power counter)
- ubluepy - Bluetooth LE module using existing python library, bluepy, as API template. (Extended to also act as a peripheral role)
Additional features:
- Bluetooth LE REPL
Current target boards supported by nrf51822:
- BBC micro:bit
- pca10000 (dongle)
- pca10001 (dev-kit)
- pca10028 (dev-kit)
- pca10032 (dongle)
Current target boards supported by nrf52832:
- Bluefruit nRF52 Feather
- BL652 & DVK from Laird
- pca10040
Current target board supported by nrf52840: pca10056
The port introduces a new HAL written from scratch to make it license compatible with micropython for redistribution. Header files for individual chips (Nordic Semi MDK) are distributed, as it uses a compatible BSD license. Hence, no dependency on any other 3rd party for HAL or libraries.
All targets, except for the nrf52840, have Bluetooth LE support using Nordic Semiconductor Bluetooth Stacks (Softdevice) downloaded directly from Nordic's website using the provided script.
Some modules are not be 100% aligned with current micropython machine API. However, the port is functional and gives a good base to start writing micropython code on the nrf5x devices with or without Bluetooth LE.
Subsequent patches are expected to get the port up to date to the new machine module APIs, adding new HAL drivers and modules, adding new target boards and optimizing flash/ram footprint (specially on the nrf51 targets).