aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-20nrf/Makefile: Make sure dependencies for pins_gen.c are correct.Damien George
2018-07-20stm32/sdcard: Use mp_hal_pin_config_alt_static to configure SD card pinsDamien George
2018-07-20stm32: Add method for statically configuring pin alternate function.Andrew Leech
Works with pins declared normally in mpconfigboard.h, eg. (pin_XX), as well as (pyb_pin_XX). Provides new mp_hal_pin_config_alt_static(pin_obj, mode, pull, fn_type) function declared in pin_static_af.h to allow configuring pin alternate functions by name at compile time.
2018-07-20unix: Use MP_STREAM_GET_FILENO to allow uselect to poll general objects.Damien George
This mechanism will scale to to an arbitrary number of pollable objects, so long as they implement the MP_STREAM_GET_FILENO ioctl. Since ussl objects pass through ioctl requests transparently to the underlying socket object, it will allow ussl sockets to be polled. And a user object with uio.IOBase as a base could support polling.
2018-07-20py/stream: Introduce MP_STREAM_GET_FILENO ioctl request.Damien George
Can be used by POSIX-like systems that associate file numbers with a file.
2018-07-20extmod/modussl: Support polling in ussl objects by passing through ioctlDamien George
The underlying socket can handling polling, and any other transparent ioctl requests. Note that CPython handles the case of polling an ssl object by polling the file descriptor of the underlying socket file, and that behaviour is emulated here.
2018-07-20extmod/modlwip: Deregister all lwIP callbacks when closing a socket.Damien George
Otherwise they may be called on a socket that no longer exists. For example, if the GC calls the finaliser on the socket and then reuses its heap memory, the "callback" entry of the old socket may contain invalid data. If lwIP then calls the TCP callback the code may try to call the user callback object which is now invalid. The lwIP callbacks must be deregistered during the closing of the socket, before all the pcb pointers are set to NULL.
2018-07-20tests/run-tests: Improve crash reporting when running on remote targets.Ayke van Laethem
It is very useful to know the actual error when debugging why a test fails.
2018-07-20tests/run-tests: Add nrf target.Ayke van Laethem
2018-07-20tests: Improve feature detection for VFS.Ayke van Laethem
2018-07-19stm32/flashbdev: Fix bug with L4 block cache, dereferencing block size.Peter D. Gray
The code was dereferencing 0x800 and loading a value from there, trying to use a literal value (not address) defined in the linker script (_ram_fs_cache_block_size) which was 0x800.
2018-07-19travis: Use build stages and parallel jobs under Travis CI.Damien George
This change brings the following benefits: - all existing tests and test behaviour is be retained - can now use Travis parallel build mechanism - total time for tests is about 5 mins 30 secs, down from around 10 mins - two additional test suites are now run: standard (non coverage) unix build and nanbox unix build - much easier to see what is failing: if you click through to the Travis CI details each parallel build job is displayed with pass/fail - scales much better when adding new test targets
2018-07-19nrf: Include $(SRC_MOD) in the build.Ayke van Laethem
Also, remove the unused $(SRC_LIB).
2018-07-18nrf: Use mp_raise_ValueError instead of nlr_raise(...)Ayke van Laethem
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-18README: Update list of ports to include esp32 and nrf.Damien George
2018-07-18nrf/drivers: Add license text to ticker.h and softpwm.h.Glenn Ruben Bakke
As per the LICENSE and AUTHORS files from the original source of these header files.
2018-07-18nrf: Upgrade to nrfx 1.1.0Glenn Ruben Bakke
2018-07-18nrf: Compile nlr objects with -fno-lto flagGlenn Ruben Bakke
To prevent over-optimizations of nlr and nlrthumb when -flto is used the flag -fno-lto is set on these modules during compilation.
2018-07-18nrf: Add explicit make flag for oofatfsGlenn Ruben Bakke
Adding MICROPY_FATFS as makefile flag in order to explicitly include oofatfs files to be compiled into the build. The flag is set to 0 by default. Must be set in addition to MICROPY_VFS and MICROPY_VFS_FAT in mpconfigport.h.
2018-07-18nrf/bluetooth: Replace BLE REPL (WebBluetooth) URLGlenn Ruben Bakke
Updating URL of the WebBluetooth/PhysicalWeb from https://glennrub.github.io/webbluetooth/micropython/repl to https://aykevl.nl/apps/nus/.
2018-07-18nrf: Quick-fix on const objects with open array dimension in objtuples.Glenn Ruben Bakke
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-18nrf/boards: Check for stack/heap size using an assert.Ayke van Laethem
The main effect of this is that the .bss is now accurate and doesn't include the stack and minimum heap size.
2018-07-18nrf/bluetooth: Add support for s132/s140 v6, remove s132 v2/3/5Glenn Ruben Bakke
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-18nrf: Generalize feather52 targetGlenn Ruben Bakke
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-18nrf: Add support for reading output pin stateGlenn Ruben Bakke
Current adoption on top of nrfx only reads the GPIO->IN register. In order to read back an output state, nrf_gpio_pin_out_read has to be called. This patch concatinate the two read functions such that, if either IN or OUT register has a value 1 it will return this, else 0. Updating lib/nrfx submodule to latest version of master to get the new GPIO API to read pin direction. (nrfx: d37b16f2b894b0928395f6f56ca741287a31a244)
2018-07-18nrf: Move pyb module to boards moduleGlenn Ruben Bakke
Cleaning up use of "pyb" module. Moving the file to a new folder and updating the makefile accordingly. New module created called "board" to take over the functionality of the legacy "pyb" module. Updating outdated documentation referring to pyb.Pin, to now point to machine.Pin.
2018-07-18nrf/nrfx_config: Move back nrf52832 to use non-EasyDMA SPIGlenn Ruben Bakke
As EasyDMA variant of SPI(M) might clock out an additional byte in single byte transactions this patch moves the nrf52832 to use SPI and not SPIM to get more stable data transactions. Ref: nrf52832 rev2 errata v1.1, suggested workaround is: "Use the SPI module (deprecated but still available) or use the following workaround with SPIM ..." Current nrfx SPIM driver does not contain this workaround, and in the meanwhile moving back to SPI fixes the issue. Also, tabbing the nrfx_config.h a bit to make it more readable.
2018-07-18nrf/modules/machine/spi: Move enable-guard to prevent wrong includesGlenn Ruben Bakke
This patch moves the check of SPI configuration before including any SPI header files. As targets might disable SPI support, current code ends up in including SPIM if not SPI is configured. Hence, this is why the check whether the module is enabled should be done before including headers.
2018-07-18nrf/boards/feather52: Move phony targets to main MakefileGlenn Ruben Bakke
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-18nrf: Enable micro:bit FS by defaultGlenn Ruben Bakke
Update configuration define from MICROPY_HW_HAS_BUILTIN_FLASH to MICROPY_MBFS. MICROPY_MBFS will enable the builtin flash as part of enabling the micro:bit FS.
2018-07-18nrf/modules/uos/microbitfs: Remove unused uos_mbfs_mount.Ayke van Laethem
It throws an error in GCC 6.3.
2018-07-18nrf/modules/uos/microbitfs: Fix errno defines.Ayke van Laethem
Probably broken after the recent Clang fixes to errno.h.
2018-07-18nrf/mphalport: Remove divided assembly syntax.Ayke van Laethem
2018-07-18nrf: Remove useless #include <errno.h>.Ayke van Laethem
2018-07-18nrf/modules/machine/adc: Don't compare -1 to an unsigned number.Ayke van Laethem
Clang warns about this.
2018-07-18nrf/Makefile: Refine dead-code elimination parameters.Ayke van Laethem
Clang warns about useless -Wl,--gc-sections passed in CFLAGS.
2018-07-18nrf/Makefile: Use C11 instead of Gnu99.Ayke van Laethem
Some constructs require C11 which GCC silently allows.
2018-07-18nrf/Makefile: Remove -fstack-usage.Ayke van Laethem
-fstack-usage is not supported by Clang and old GCC versions.
2018-07-18nrf/Makefile: use "standard" GCC -fshort-enums instead of --short-enums.Ayke van Laethem
Clang understands only -fshort-enums, not --short-enums. As --short-enums isn't even mentioned in the gcc man page, I think this alias exists more for backwards compatibility.
2018-07-18nrf/bluetooth: Fixes for s132 v5 BLE stackGlenn Ruben Bakke
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-18nrf/modules/machine/adc: Fix to make adc.c compile for nrf51 targetsGlenn Ruben Bakke
2018-07-18nrf: Return immediatly from mp_hal_delay_us if 0us is givenGlenn Ruben Bakke
After nrfx 1.0.0 a new macro was introduced to do a common hardware timeout. The macro function triggers a counter of retries or a timeout in us. However, in many cases, like in nrfx_adc.c the timeout value is set to 0, leading to a infinite loop in mp_hal_delay_us. This patch prevents this from happening. Path of error: nrfx_adc.c -> NRFX_WAIT_FOR -> NRFX_DELAY_US -> mp_hal_delay_us.
2018-07-18nrf/spi: Allow for external use of new and transfer function.Glenn Ruben Bakke
This patch also opens up for all arguments to be set as positional arguments such that an external user of the make_new function can set provide all parameters as positional arguments.
2018-07-18nrf/adc: Allow for external use of new and value read function.Glenn Ruben Bakke
2018-07-18nrf/modules: Align method to resolve pin objectGlenn Ruben Bakke
machine/i2c already uses mp_hal_get_pin_obj which points to pin_find function in order to locate correct pin object to use. The pin_find function was recently updated to also being able to locate pins based on an integer value, such that pin number can be used as argument to object constructors. This patch modfies and uniforms pin object lookup for SPI, music and pwm.
2018-07-18nrf/modules/random: Rename port config for RNGGlenn Ruben Bakke
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-18nrf/boards/wt51822_s4at: Fixes after nrfx and Pin IRQ introductionGlenn Ruben Bakke
2018-07-18nrf/boards: Remove unused defines from board config headersGlenn Ruben Bakke
2018-07-18nrf/gccollect: Use the SP register instead of MSP.Ayke van Laethem
Using the current stack pointer directly saves 8 bytes of code. We need the *current* register anyway for GC (which is always MSP).
2018-07-18nrf/drivers/bluetooth/ble_drv: Increase max transfers in progress.Ayke van Laethem
Increase the maximum number of queued notifications from 1 to 6. This massively speeds up the NUS console - especially when printing large amounts of text. The reason is that multiple transfers can be done in a single connection event, in ideal cases 6 at a time.