summaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAge
...
* examples/usercmodules: Simplify user C module enabling.Damien George2021-04-01
| | | | | | | | | | | | It's a bit of a pitfall with user C modules that including them in the build does not automatically enable them. This commit changes the docs and examples for user C modules to encourage writers of user C modules to enable them unconditionally. This makes things simpler and covers most use cases. See discussion in issue #6960, and also #7086. Signed-off-by: Damien George <damien@micropython.org>
* esp32: Fix multiple definition errors with mp_hal_stdout_tx functions.Michael O'Cleirigh2021-04-01
| | | | | | | | | | | | | It was noticed that the esp32 port didn't build ulab correctly. The problem was a multiple defintion of the 'mp_hal_stdout_tx_str' and 'mp_hal_stdout_tx_strn_cooked' functions. They were defined in stdout_helpers.c but also in the ports/esp32/mphalport.c. Fixed by removing stdout_helpers.c from the build. Signed-off-by: Michael O'Cleirigh <michael.ocleirigh@rivulet.ca>
* tools/ci.sh: Build user C modules for esp32.Michael O'Cleirigh2021-04-01
| | | | | | Builds the esp32 port against the example C and CXX modules. Signed-off-by: Michael O'Cleirigh <michael.ocleirigh@rivulet.ca>
* esp32: Restore USER_C_MODULE support with new CMake build system.Michael O'Cleirigh2021-04-01
| | | | | | | | | | Support for User C and C++ modules was lost due to upgrading the esp32 to the latest CMake based IDF from the GNUMakefile build process. Restore the support for the esp32 port by integrating with the approach recently added for the rp2 port. Signed-off-by: Michael O'Cleirigh <michael.ocleirigh@rivulet.ca>
* rp2: Don't advertise remote wakeup for USB serial.Liam Fraser2021-03-31
| | | | | | | | | This USB feature is currently not supported. With this flag enabled (and the feature not implemented) the USB serial will stop working if there is a delay of more than about 2 seconds between messages, which can occur with USB autosuspend enabled. Fixes issue #6866.
* tools/ci.sh: Add CI for CMake USER_C_MODULE support.Phil Howard2021-03-31
| | | | | | Builds the rp2 port against the example C and CXX modules. Signed-off-by: Phil Howard <phil@pimoroni.com>
* docs/develop/cmodules.rst: Document C-modules and micropython.cmake.Phil Howard2021-03-31
| | | | | | | Documents the micropython.cmake file required to make user C modules compatible with the CMake build system. Signed-off-by: Phil Howard <phil@pimoroni.com>
* examples/usercmodule: Add micropython.cmake to the C and CPP examples.Phil Howard2021-03-31
| | | | | | | | | | | | | examples/usercmodule/micropython.cmake: Root micropython.cmake file is responsible for including modules. examples/usercmodule/cexample/micropython.cmake: examples/usercmodule/cppexample/micropython.cmake: Module micropython.cmake files define the target and link it to usermod. Signed-off-by: Phil Howard <phil@pimoroni.com>
* rp2: Add support for USER_C_MODULES to CMake build system.Phil Howard2021-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parts that are generic are added to py/ so they can be used by other ports that use CMake. py/usermod.cmake: * Creates a usermod target to hang user C/CXX modules from. * Gathers sources from user C/CXX modules and libs for QSTR scan. ports/rp2/CMakeLists.txt: * Includes py/usermod.cmake. * Links the resulting usermod library to the MicroPython target. py/mkrules.cmake: Add cxxflags to qstr.i.last custom command for CXX modules: * MICROPY_CPP_FLAGS so CXX modules will find includes. * -DNO_QSTR to fix fatal error missing "genhdr/qstrdefs.generated.h". Usage: The rp2 port can be linked against user C modules by running: make USER_C_MODULES=/path/to/module/micropython.cmake CMake will print a list of included modules. Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.org> Co-authored-by: Michael O'Cleirigh <michael.ocleirigh@rivulet.ca> Signed-off-by: Phil Howard <phil@pimoroni.com>
* rp2/mpthreadport.h: Cast core_state to _mp_state_thread_t.Phil Howard2021-03-31
| | | | | | Required for user C++ code to build successfully against ports/rp2. Signed-off-by: Phil Howard <phil@pimoroni.com>
* py: Rename remaining object types to be of the form mp_type_xxx.Damien George2021-03-26
| | | | | | For consistency with all other object types in the core. Signed-off-by: Damien George <damien@micropython.org>
* bare-arm: Clean up the code, make it run on an F405, and add a README.Damien George2021-03-19
| | | | | | | | | | | | | | This commit simplifies and cleans up the bare-arm port, and adds just enough system and library code to make it execute on an STM32F405 MCU. The mpconfigport.h configuration is simplified to just specify those configuration values that are different from the defaults. And the addition of -fdata-sections and -ffunction-sections means the final firmware is smaller than it previously was, by about 4200 bytes. A README is also added. Signed-off-by: Damien George <damien@micropython.org>
* py/vm: For tracing use mp_printf, and print state when thread enabled.Damien George2021-03-17
| | | | | | | | | | | mp_printf should be used to print the prefix because it's also used in mp_bytecode_print2 (otherwise, depending on the system, different output streams may be used). Also print the current thread state when threading is enabled to easily see which thread executes what opcode. Signed-off-by: Damien George <damien@micropython.org>
* stm32/Makefile: Allow QSTR_DEFS,QSTR_GLOBAL_DEPENDENCIES to be extended.Damien George2021-03-17
| | | | | | So a board can provide custom qstr definitions if needed. Signed-off-by: Damien George <damien@micropython.org>
* tests/run-tests.py: Provide more info if script run via pyboard crashes.Damien George2021-03-16
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tests/extmod/vfs_fat_fileio2.py: Close test file at end of test.Damien George2021-03-16
| | | | | | Otherwise it can lead to inconsistent results running subsequent tests. Signed-off-by: Damien George <damien@micropython.org>
* extmod/modbluetooth: Free temp arrays in gatts register services.Damien George2021-03-16
| | | | | | | | | This helps to reduce memory fragmentation, by freeing the heap data as soon as it is not needed. It also helps the compiler keeps a reference to the beginning of both arrays, which need to be traceable by the GC (otherwise some compilers may optimise this reference to something else). Signed-off-by: Damien George <damien@micropython.org>
* stm32/Makefile: Fix C++ linker flags when toolchain has spaces in path.stijn2021-03-16
| | | | | | | The GNU Make dir command uses spaces as item separator so it does not work for e.g building the STM32 port on Cygwin with a default Arm installation in "c:/program files (x86)/GNU Arm Embedded Toolchain". Fix by using POSIX dirname on a quoted path instead.
* all: Add .git-blame-ignore-revs for fixing up git blame output.stijn2021-03-15
| | | | | | Add most formatting-only commits to this file so that when used with git blame, these commits are excluded and the output shows only the interesting bits.
* rp2: Use core-provided cmake fragments instead of custom ones.Damien George2021-03-14
| | | | Signed-off-by: Damien George <damien@micropython.org>
* extmod/extmod.cmake: Add modonewire.c to MICROPY_SOURCE_EXTMOD list.Damien George2021-03-14
| | | | Signed-off-by: Damien George <damien@micropython.org>
* rp2/modmachine: Enable machine.Signal class.Damien George2021-03-14
| | | | | | Fixes issue #6863. Signed-off-by: Damien George <damien@micropython.org>
* rp2: Enabled more core Python features.Damien George2021-03-14
| | | | | | This brings the port's configuration closer to the stm32 and esp32 ports. Signed-off-by: Damien George <damien@micropython.org>
* rp2: Enable uerrno module.Kevin Köck2021-03-13
| | | | Fixes #6991.
* tests/multi_bluetooth: Skip tests when BLE features are unsupported.Damien George2021-03-12
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tests/run-tests.py: Reformat with Black.Damien George2021-03-12
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tests: Rename run-tests to run-tests.py for consistency.Damien George2021-03-12
| | | | Signed-off-by: Damien George <damien@micropython.org>
* esp32/machine_hw_spi: Use default pins when making SPI if none given.Damien George2021-03-12
| | | | | | | | The default pins can be optionally configured by a board. Fixes issue #6974. Signed-off-by: Damien George <damien@micropython.org>
* lib/pico-sdk: Update to latest version 1.1.0.Damien George2021-03-12
| | | | Signed-off-by: Damien George <damien@micropython.org>
* rp2/rp2_flash: Prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative.Andrew Scheller2021-03-12
|
* rp2/modmachine: Re-init UART for REPL on frequency change.robert-hh2021-03-12
| | | | | | | | When UART is used for REPL and the MCU frequency is changed, the UART has to be re-initialised. Besides that the UART may have to be recreated after a frequency change, but with USB REPL this is not a problem. Thanks to @HermannSW for spotting and providing the change.
* rp2/modmachine: Allow changing CPU clock frequency.robert-hh2021-03-12
| | | | | | | | | Using the standard machine.freq(). The safe ranges tested were 10 and 12-270MHz, at which USB REPL still worked. Requested settings can be checked with the script: pico-sdk/src/rp2_common/hardware_clocks/scripts/vcocalc.py. At frequencies like 300MHz the script still signaled OK, but USB did not work any more.
* rp2/rp2_pio: Fix sm.get(buf) to not wait after getting last item.robert-hh2021-03-12
| | | | | | | | | | sm.get(buf) was waiting for one item more than the length of the supplied buffer. Even if this item was not stored, sm_get would block trying to get an item from the RX fifo. As part of the fix, the edge case for a zero length buffer was moved up to the section where the function arguments are handled. In case of a zero length buffer, sm.get() now returns immediately that buffer.
* rp2/rp2_pio: Allow more than 8 consecutive pins for PIO out/set/sideset.robert-hh2021-03-12
| | | | | | | | The bitmasks supplied for initialization of out/set/sideset were only 8 bit instead of 32. This resulted in an error, that not more than 8 consecutive pins would get initialized. Fixes issue #6933.
* rp2/machine_uart: Add support for inverted TX and RX lines.robert-hh2021-03-11
| | | | | | | | | Usage as in the other ports: keyword "invert" constants: INV_TX and INV_RX Sample: uart = UART(1, invert=UART.INV_TX | UART.INV_RX)
* rp2/machine_uart: Add timeout/timeout_char to read and write.robert-hh2021-03-11
|
* rp2: Enable VfsFat class for FAT filesystem support.StereoRocker2021-03-11
| | | | Allows interfacing with SD cards, for example.
* mimxrt/boards: Add MIMXRT1050_EVK board, based on MIMXRT1060_EVK.svetelna2021-03-11
|
* esp32/Makefile: Specify port and baud on erase_flash command.Mike Causer2021-03-11
|
* lib/utils/gchelper_generic: Implement AArch64 support.Yonatan Goldschmidt2021-03-11
|
* py/nlrx64: Fix typo in comment.Yonatan Goldschmidt2021-03-11
|
* py/nlr: Implement NLR for AArch64.Yonatan Goldschmidt2021-03-11
|
* lib/mbedtls: Switch to currently latest commit of LTS branch v2.16.Mirko Vogt2021-03-11
| | | | | | | | | From a version numbering point of view this is a downgrade (2.17.0 -> 2.16.x). However the latest commit for version 2.17.0 is from March 2019 and no further minor release happened after 2.17.0. This version is EOL. 2.16.x though is still actively maintained as a long term release, hence security and stability fixes are still being backported, including compatibility with upcoming compiler releases.
* stm32/boardctrl: Add MICROPY_BOARD_STARTUP hook.Damien George2021-03-11
| | | | Signed-off-by: Damien George <damien@micropython.org>
* stm32/spi: Fix baudrate calculation for H7 series.Reinhard Feger2021-03-11
| | | | Fixes issue #6342.
* stm32/powerctrl: Save and restore EWUP state when configuring standby.Peter Hinch2021-03-11
| | | | | | | | This allows the user to enable wake-up sources using the EWUP bits, on F7 MCUs. Disabling the wake-up sources while clearing the wake-up flags follows the reference manual and ST examples.
* stm32/main: Fix passing state.reset_mode to init_flash_fs.Braiden Kindt2021-03-10
| | | | | | | | | state.reset_mode is updated by `MICROPY_BOARD_BEFORE_SOFT_RESET_LOOP` but not passed to `init_flash_fs`, and so factory reset is not executed on boards that do not have a bootloader. This bug was introduced by 4c3976bbcaf58266fdcaab264fee5b7a94a682e5 Fixes #6903.
* stm32/make-stmconst.py: Allow "[]" chars when parsing source comments.Herwin Grobben2021-03-10
| | | | | For STM32WB MCUs, EXTI offset addresses were not parsed due to the appearance of "[31:0]" in a comment in the .h file.
* stm32/storage: Prevent attempts to read/write invalid block addresses.Andrew Leech2021-03-09
| | | | | | A corrupt filesystem may lead to a request for a block which is out of range of the block device limits. Return an error instead of passing the request down to the lower layer.
* stm32/rfcore: Allow BLE settings to be changed by a board.Damien George2021-03-02
| | | | | | | | | | | | Two of the defaults have also changed in this commit: - MICROPY_HW_RFCORE_BLE_LSE_SOURCE changed from 1 to 0, which configures the LsSource to be LSE (needed due to errata 2.2.1). - MICROPY_HW_RFCORE_BLE_VITERBI_MODE changed from 0 to 1, which enables Viterbi mode, following all the ST examples. Signed-off-by: Damien George <damien@micropython.org>