aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-01-28stm32/main: Make board-defined UART REPL use a static object and buffer.Damien George
This way the UART REPL does not need the MicroPython heap and exists outside the MicroPython runtime, allowing characters to still be received during a soft reset.
2019-01-28esp32/boards: Use auto xtal freq config instead of default 40MHz.Damien George
Auto-detection of the crystal frequency is convenient and allows for a single binary for many different boards. But it can be unreliable in certain situations so in production, for a given board, it's recommended to configure the correct fixed frequency.
2019-01-28esp32/Makefile: Make sure that directory exists for sdkconfig.h.Damien George
2019-01-28esp32/machine_timer: Deinit all active timers on soft reset.Damien George
Otherwise they will keep triggering the callback and access invalid data on the heap.
2019-01-28esp32: Update to latest ESP IDF using sdkconfig and new ldgen procedure.Damien George
Configuration for the build is now specified using sdkconfig rather than sdkconfig.h, which allows for much easier configuration with defaults from the ESP IDF automatically applied. sdkconfig.h is generated using the new ESP IDF kconfig_new tool written in Python. Custom configuration for a particular ESP32 board can be specified via the make variable SDKCONFIG. The esp32.common.ld file is also now generated using the standard ESP IDF ldgen.py tool.
2019-01-28esp32/Makefile: Put all IDF compenents in .a libs to use IDF ld script.Damien George
When the ESP IDF builds a project it puts all separate components into separate .a library archives. And then the esp32.common.ld linker script references these .a libraries by explicit name to put certain object files in iRAM. This patch does a similar thing for the custom build system used here, putting all IDF .o's into their respective .a. So a custom linker script is no longer needed.
2019-01-27esp32: Don't put py/scheduler.o in iRAM, it's no longer needed.Damien George
ISR's no longer need to be in iRAM, and the ESP IDF provides an option to specify that they are in iRAM if an application needs lower latency when handling them. But we don't use this feature for user interrupts: both timer and gpio ISR routines are registered without the ESP_INTR_FLAG_IRAM option, and so the scheduling code no longer needs to be in iRAM.
2019-01-27py/compile: Swap order of pop_block/pop_except in "except as" handler.Damien George
To make the try-finally block self contained.
2019-01-27stm32/usbdev: Add USB config option for max power drawn by the board.Damien George
The new compile-time option is MICROPY_HW_USB_MAX_POWER_MA. Set this in the board configuration file to the maximum current in mA that the board will draw over USB. The default is 500mA.
2019-01-27stm32/usbdev: Add USB config option for board being self powered.Damien George
The new compile-time option is MICROPY_HW_USB_SELF_POWERED. Set this option to 1 in the board configuration file to indicate that the USB device is self powered. This option is disabled by default (previous behaviour).
2019-01-27stm32/rtc: Check RTCEN=1 when testing if RTC is already running on boot.Damien George
It can be that LSEON and LSERDY are set yet the RTC is not enabled (this can happen for example when coming out of the ST DFU mode on an F405 with the RTC not previously initialised). In such a case the RTC is never started because the code thinks it's already running. This patch fixes this case by always checking if RTCEN is set when booting up (and also testing for a valid RTCSEL value in the case of using an LSE).
2019-01-27py: Add optional support for 2-argument version of built-in next().stijn
Configurable via MICROPY_PY_BUILTINS_NEXT2, disabled by default.
2019-01-27cc3200/mods/modussl: Fix ca_certs arg validation in mod_ssl_wrap_socket.Reagan Sanders
Commit a0d97fe40872b46872657bedc0e47cfd704c59aa changed the argument index of ca_certs but missed updating one of the references to the new index.
2019-01-27unix/mpthreadport: Remove busy wait loop in thread garbage collection.Mikhail Zakharov
One can't use pthread calls in a signal handler because they are not async-signal-safe (see man signal-safety). Instead, sem_post can be used to post from within a signal handler and this should be more efficient than using a busy wait loop, waiting on a volatile variable.
2019-01-27unix/mpthreadport: Cleanup used memory on thread exit.Mikhail Zakharov
2019-01-27unix/mpthreadport: Add thread deinit code to stop threads on exit.Mikhail Zakharov
Free unused memory for threads and cancel any outstanding threads on interpreter exit to avoid possible segmentaiton fault.
2019-01-27extmod/modussl_mbedtls: Remove deprecated mbedtls/net.h header include.Paul Sokolovsky
This header is deprecated as of mbedtls 2.8.0, as shipped with Ubuntu 18.04. Leads to #warning which is promoted to error with uPy compile options. Note that the current version of mbedtls is 2.14 at the time of writing.
2019-01-27stm32: Implement machine.lightsleep().Damien George
2019-01-27docs/machine: Change sleep to lightsleep and add timeout arguments.Damien George
The machine.sleep() function can be misleading because it clashes with time.sleep() which has quite different semantics. So change it to machine.lightsleep() which shows that it is closer in behaviour to machine.deepsleep(). Also, add an optional argument to these two sleep functions to specify a maximum time to sleep for. This is a common operation and underlying hardware usually has a special way of performing this operation. The existing machine.sleep() function will remain for backwards compatibility purposes, and it can simply be an alias for machine.lightsleep() without arguments. The behaviour will be the same.
2019-01-27py: Remove calls to file reader functions when these are disabled.Sean Burton
If MICROPY_PERSISTENT_CODE_LOAD or MICROPY_ENABLE_COMPILER are enabled then code gets enabled that calls file reading functions which may be disabled if no readers have been implemented. To fix this, introduce a MICROPY_HAS_FILE_READER variable, which is automatically set if MICROPY_READER_POSIX or MICROPY_READER_VFS is set but can also be manually set if a custom reader is being implemented. Then disable the file reading calls if this is not set.
2019-01-27extmod/moduzlib: Update for uzlib 2.9.2.Paul Sokolovsky
2019-01-27extmod/uzlib: Update uzlib to v2.9.2.Paul Sokolovsky
Major changes include robust parsing of erroneous compressed streams and updated API.
2019-01-26all: Bump version to 1.10.Damien George
2019-01-26py/mpconfig.h: Remove parentheses from MICROPY_VERSION_xxx macros.Damien George
Otherwise MICROPY_VERSION_STRING includes these parentheses in the string.
2019-01-25pic16bit: Update to compile with latest xc16 v1.35 compiler.Damien George
This port has been verified to work with these latest changes.
2019-01-25py/obj.h: Explicitly cast args to uint32_t in MP_OBJ_FUN_MAKE_SIG.Damien George
For architectures where size_t is less than 32 bits (eg 16 bits) the args must be casted to uint32_t so the left shift will work. For architectures where size_t is greater than 32 bits (eg 64 bits) this new casting will not lose any bits because the end result must anyway fit in a uint32_t.
2019-01-25docs/library: Add documentation for esp32 module.Damien George
2019-01-25docs: Add initial docs for esp32 port, including quick-ref and general.Matt Trentini
With contributions from Oliver Robson (@HowManyOliversAreThere), Sean Lanigan (@seanlano) and @rprr.
2019-01-24lib/stm32lib: Update library to get F413 BOR defs and fix gcc 8 warning.Damien George
2019-01-23esp32/machine_hw_spi: Make HW SPI objects statically allocated.Damien George
This aligns more closely with the hardware, that there are two, fixed HW SPI peripherals. And it allows to recreate the HW SPI objects without error, as well as create them again after a soft reset. Fixes issue #4103.
2019-01-23esp32/machine_hw_spi: Use separate DMA channels for HSPI and VSPI.Damien George
Otherwise only one of HSPI or VSPI can be used at a time. Fixes issue #4068.
2019-01-23esp32/modules/neopixel.py: Change NeoPixel to different default timings.Matt Trentini
In order to suit the more common 800KHz by default (instead of 400KHz), and also have the same behaviour as the esp8266 port. Resolves #4396. Note! This is a breaking change. Anyone that has previously used the NeoPixel class on an ESP32 board may be affected.
2019-01-22esp8266/esp_mphal: Provide mp_hal_pin_od_high_dht so DHT works reliably.Damien George
The original behaviour of open-drain-high was to use the open-drain mode of the GPIO pin, and this seems to make driving a DHT more reliable. See issue #4233.
2019-01-22drivers/dht: Allow open-drain-high call to be DHT specific if needed.Damien George
Some ports (eg esp8266) need to have specific behaviour for driving a DHT reliably.
2019-01-17esp32/Makefile: Use system provided math library rather than uPy one.Damien George
The ESP IDF system already provides a math library, and that one is likely to be better tuned to the Xtensa architecture. The IDF components are also tested against its own math library, so best not to override it. Using the system provided library also allows to easily switch to double-precision floating point by changing MICROPY_FLOAT_IMPL to MICROPY_FLOAT_IMPL_DOUBLE.
2019-01-16esp32/machine_pin: Add Pin.off() and Pin.on() methods.Damien George
2019-01-16esp8266/main: Activate UART(0) on dupterm for REPL before boot.py runs.Damien George
So that the user can explicitly deactivate UART(0) if needed. See issue #4314. This introduces some risk to "brick" the device, if the user disables the REPL without providing an alternative REPL (eg WebREPL), or any way to reenable it. In such a case the device needs to be erased and reprogrammed. This seems unavoidable, given the desire to have the option to use the UART for something other than the REPL.
2019-01-11docs/differences: Clarify the differences are against Python 3.4.stijn
2019-01-11stm32/main: Make thread and FS state static and exclude when not needed.Damien George
Without the static qualifier these objects will be kept by the linker even if they are unused. So this patch saves some RAM when these features are unused by a board.
2019-01-11stm32/wdt: Make singleton WDT object const so it goes in ROM.Damien George
2019-01-10py/modio: Make iobase_singleton object const so it goes in ROM.Damien George
2019-01-10esp32/modsocket: For socket read only release GIL if socket would block.Damien George
If there are many short reads to a socket in a row (eg by readline) then releasing and acquiring the GIL each time will give very poor throughput. So first poll the socket to see if it has data, and if it does then don't release the GIL.
2019-01-10esp32/mphalport: When tx'ing to REPL only release GIL if many chars sentDamien George
Otherwise, if multiple threads are active, printing data to the REPL may be very slow because in some cases only one character is output per call to mp_hal_stdout_tx_strn.
2019-01-04py: Fix location of VM returned exception in invalid opcode and commentsDamien George
The location for a returned exception was changed to state[0] in d95947b48a30f818638c3619b92110ce6d07f5e3
2019-01-04py: Get optional VM stack overflow check compiling and working again.Damien George
Changes to the layout of the bytecode header meant that this debug code was no longer compiling. This is now fixed and a new compile-time option is introduced, MICROPY_DEBUG_VM_STACK_OVERFLOW, to turn on this feature (which is disabled by default). This option is needed because more than one file needs to cooperate to make this check work.
2018-12-30stm32/sdcard: Properly reset SD periph when SDMMC2 is used on H7 MCUs.Damien George
2018-12-30tools/pydfu.py: Fix regression so tool runs under Python 2 again.Dave Hylands
Under python3 (tested with 3.6.7) bytes with a list of integers as an argument returns a different result than under python 2.7 (tested with 2.7.15rc1) which causes pydfu.py to fail when run under 2.7. Changing bytes to bytearray makes pydfu work properly under both Python 2.7 and Python 3.6.
2018-12-30stm32/modmachine: Fix reset_cause to correctly give DEEPSLEEP on L4 MCU.roland
Before this fix it returned SOFT_RESET after waking from a deepsleep (standby).
2018-12-30stm32/uart: Make sure user IRQs are handled even with a keyboard intr.Damien George
2018-12-30stm32/uart: Clear overrun error flag after reading RX data register.Damien George
On MCUs other than F4 the ORE (overrun error) flag needs to be cleared independently of clearing RXNE, even though both are wired to trigger the same RXNE IRQ. In the case that an overrun occurred it's necessary to explicitly clear the ORE flag or else the RXNE interrupt will keep firing.