summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-30stm32/flash: Increase H7 flash size to full 2MiB.Damien George
2018-05-30stm32/boards: Ensure USB OTG power is off for NUCLEO_F767ZI.rolandvs
And update the GPIO init for NUCLEO_H743ZI to consistently use the mphal functions.
2018-05-29stm32/boards: Split combined alt-func labels and fix some other errors.rolandvs
Pins with multiple alt-funcs for the same peripheral (eg USART_CTS_NSS) need to be split into individual alt-funcs for make-pins.py to work correctly. This patch changes the following: - Split `..._CTS_NSS` into `..._CTS/..._NSS` - Split `..._RTS_DE` into `..._RTS/..._DE` - Split `JTDO_SWO` into `JTDO/TRACESWO` for consistency - Fixed `TRACECK` to `TRACECLK` for consistency
2018-05-28stm32/README: Update to include STM32F0 in list of supported MCUs.Damien George
2018-05-28stm32/boards: Add NUCLEO_F091RC board configuration files.Damien George
2018-05-28stm32/boards: Add alt-func CSV list and linker script for STM32F091.Damien George
2018-05-28stm32: Add support for STM32F0 MCUs.Damien George
2018-05-28stm32/boards: Add startup_stm32f0.s for STM32F0 MCUs.Damien George
Sourced from STM32Cube_FW_F0_V1.9.0.
2018-05-28lib/stm32lib: Update library to include support for STM32F0 MCUs.Damien George
Now points to branch: work-F0-1.9.0+F4-1.16.0+F7-1.7.0+H7-1.2.0+L4-1.8.1
2018-05-28stm32: Allow a board to disable MICROPY_VFS_FAT.Damien George
2018-05-28stm32/timer: Make timer_get_source_freq more efficient by using regs.Damien George
Use direct register access to get the APB clock divider. This reduces code size and makes the code more efficient.
2018-05-28stm32: Add support for Cortex-M0 CPUs.Damien George
2018-05-28stm32: Allow to have no storage support if there are no block devices.Damien George
If no block devices are defined by a board then storage support will be disabled. This means there is no filesystem provided by either the internal flash or external SPI flash. But the VFS system can still be enabled and filesystems provided on external devices like an SD card.
2018-05-28stm32/usb: Guard USB device code with #if for whether USB is enabled.Damien George
With this change, all the USB source code can now be passed through the compiler even if the MCU does not have a USB peripheral.
2018-05-28esp32: Silence ESP-IDF log messages when in raw REPL mode.Nick Moore
This prevents clients such as ampy, mpy-utils, etc getting confused by extraneous data.
2018-05-25py/objtype: Remove TODO comment about needing to check for property.Damien George
Instance members are always treated as values, even if they are properties. A test is added to show this is the case.
2018-05-24stm32: Add new component, the mboot bootloader.Damien George
Mboot is a custom bootloader for STM32 MCUs. It can provide a USB DFU interface on either the FS or HS peripherals, as well as a custom I2C bootloader interface.
2018-05-24stm32: Add low-level hardware I2C slave driver.Damien George
2018-05-24stm32: Remove unneeded HTML release notes from usbdev and usbhost dirs.Damien George
These files provide no additional information, all the version and license information is captured in the relevant files in these subdirectories. Thanks to @JoeSc for the original patch.
2018-05-23esp32/esp32.custom_common.ld: Put soc code in iram0.Damien George
This is what the IDF does, it must be done.
2018-05-23py/emit: Combine setup with/except/finally into one emit function.Damien George
This patch reduces code size by: bare-arm: -16 minimal x86: -156 unix x64: -288 unix nanbox: -184 stm32: -48 cc3200: -16 esp8266: -96 esp32: -16 The last 10 patches combined reduce code size by: bare-arm: -164 minimal x86: -1260 unix x64: -3416 unix nanbox: -1616 stm32: -676 cc3200: -232 esp8266: -1144 esp32: -268
2018-05-23py/emit: Merge build set/slice into existing build emit function.Damien George
Reduces code size by: bare-arm: +0 minimal x86: +0 unix x64: -368 unix nanbox: -248 stm32: -128 cc3200: -48 esp8266: -184 esp32: -40
2018-05-23py/emit: Combine import from/name/star into one emit function.Damien George
Change in code size is: bare-arm: +4 minimal x86: -88 unix x64: -456 unix nanbox: -88 stm32: -44 cc3200: +0 esp8266: -104 esp32: +8
2018-05-23py/emit: Combine break_loop and continue_loop into one emit function.Damien George
Reduces code size by: bare-arm: +0 minimal x86: +0 unix x64: -80 unix nanbox: +0 stm32: -12 cc3200: +0 esp8266: -28 esp32: +0
2018-05-23py/emit: Combine load/store/delete attr into one emit function.Damien George
Reduces code size by: bare-arm: -20 minimal x86: -140 unix x64: -408 unix nanbox: -140 stm32: -68 cc3200: -16 esp8266: -80 esp32: -32
2018-05-23py/emit: Combine load/store/delete subscr into one emit function.Damien George
Reduces code size by: bare-arm: -8 minimal x86: -104 unix x64: -312 unix nanbox: -120 stm32: -60 cc3200: -16 esp8266: -92 esp32: -24
2018-05-23py/emit: Combine name and global into one func for load/store/delete.Damien George
Reduces code size by: bare-arm: -56 minimal x86: -300 unix x64: -576 unix nanbox: -300 stm32: -164 cc3200: -56 esp8266: -236 esp32: -76
2018-05-23py/emit: Combine build tuple/list/map emit funcs into one.Damien George
Reduces code size by: bare-arm: -24 minimal x86: -192 unix x64: -288 unix nanbox: -184 stm32: -72 cc3200: -16 esp8266: -148 esp32: -32
2018-05-23py/emit: Combine yield value and yield-from emit funcs into one.Damien George
Reduces code size by: bare-arm: -24 minimal x86: -72 unix x64: -200 unix nanbox: -72 stm32: -52 cc3200: -32 esp8266: -84 esp32: -24
2018-05-23py/emit: Combine fast and deref into one function for load/store/delete.Damien George
Reduces code size by: bare-arm: -16 minimal x86: -208 unix x64: -408 unix nanbox: -248 stm32: -12 cc3200: -24 esp8266: -96 esp32: -44
2018-05-22py/objgenerator: Protect against reentering a generator.Damien George
Generators that are already executing cannot be reexecuted. This patch puts in a check for such a case. Thanks to @jepler for finding the bug.
2018-05-22py/objgenerator: Save state in old_globals instead of local variable.Damien George
The code_state.old_globals variable is there to save the globals state so should be used for this purpose, to avoid the need for additional local variables on the C stack.
2018-05-22ports: Enable MICROPY_PY_BUILTINS_ROUND_INT on selected ports.Damien George
2018-05-22py/modbuiltins: Add support for rounding integers.Jan Klusacek
As per CPython semantics. This feature is controlled by MICROPY_PY_BUILTINS_ROUND_INT which is disabled by default.
2018-05-22py/parsenum: Adjust braces so they are balanced.Damien George
2018-05-22stm32/main: Use consistent indenting of macro #if's.Damien George
2018-05-22stm32/rng: Use Yasmarang for rng_get() if MCU doesn't have HW RNG.Damien George
2018-05-21stm32: Integrate lwIP as implementation of usocket module.Damien George
This patch allows to use lwIP as the implementation of the usocket module, instead of the existing socket-multiplexer that delegates the entire TCP/IP layer to the NIC itself. This is disabled by default, and enabled by defining MICROPY_PY_LWIP to 1. When enabled, the lwIP TCP/IP stack will be included in the build with default settings for memory usage and performance (see lwip_inc/lwipopts.h). It is then up to a particular NIC to register itself with lwIP using the standard lwIP netif API.
2018-05-21extmod/modlwip: Allow to compile with MICROPY_PY_LWIP disabled.Damien George
2018-05-21stm32/rtc: Don't try to set SubSeconds value on RTC.Damien George
The hardware doesn't allow it, instead the value is reset to 255 upon setting the other calendar/time values.
2018-05-21py/gc: When GC threshold is hit don't unnecessarily collect twice.Damien George
Without this, if GC threshold is hit and there is not enough memory left to satisfy the request, gc_collect() will run a second time and the search for memory will happen again and will fail again. Thanks to @adritium for pointing out this issue, see #3786.
2018-05-21minimal/main: Allow to compile without GC enabled.Daniel Shaulov
2018-05-21tests: Add some tests for bigint hash, float hash and float parsing.Damien George
Following outcome of recent fuzz testing and sanitizing by @jepler.
2018-05-21py/objfloat: Fix undefined integer behavior hashing negative zero.Jeff Epler
Under ubsan, when evaluating hash(-0.) the following diagnostic occurs: ../../py/objfloat.c:102:15: runtime error: negation of -9223372036854775808 cannot be represented in type 'mp_int_t' (aka 'long'); cast to an unsigned type to negate this value to itself So do just that, to tell the compiler that we want to perform this operation using modulo arithmetic rules.
2018-05-21py/mpz: Avoid undefined behavior at integer overflow in mpz_hash.Jeff Epler
Before this, ubsan would detect a problem when executing hash(006699999999999999999999999999999999999999999999999999999999999999999999) ../../py/mpz.c:1539:20: runtime error: left shift of 1067371580458 by 32 places cannot be represented in type 'mp_int_t' (aka 'long') When the overflow does occur it now happens as defined by the rules of unsigned arithmetic.
2018-05-21py/objfloat: Fix undefined shifting behavior in high-quality float hash.Jeff Epler
When computing e.g. hash(0.4e3) with ubsan enabled, a diagnostic like the following would occur: ../../py/objfloat.c:91:30: runtime error: shift exponent 44 is too large for 32-bit type 'int' By casting constant "1" to the right type the intended value is preserved.
2018-05-21py/parsenum: Avoid undefined behavior parsing floats with large exponents.Jeff Epler
Fuzz testing combined with the undefined behavior sanitizer found that parsing unreasonable float literals like 1e+9999999999999 resulted in undefined behavior due to overflow in signed integer arithmetic, and a wrong result being returned.
2018-05-21py/parsenum: Use int instead of mp_int_t for parsing float exponent.Damien George
There is no need to use the mp_int_t type which may be 64-bits wide, there is enough bit-width in a normal int to parse reasonable exponents. Using int helps to reduce code size for 64-bit ports, especially nan-boxing builds. (Similarly for the "dig" variable which is now an unsigned int.)
2018-05-21py/emitbc: Avoid undefined behavior calling memset() with NULL 1st arg.Jeff Epler
Calling memset(NULL, value, 0) is not standards compliant so we must add an explicit check that emit->label_offsets is indeed not NULL before calling memset (this pointer will be NULL on the first pass of the parse tree and it's more logical / safer to check this pointer rather than check that the pass is not the first one). Code sanitizers will warn if NULL is passed as the first value to memset, and compilers may optimise the code based on the knowledge that any pointer passed to memset is guaranteed not to be NULL.
2018-05-21esp8266: Change UART(0) to attach to REPL via uos.dupterm interface.Damien George
This patch makes it so that UART(0) can by dynamically attached to and detached from the REPL by using the uos.dupterm function. Since WebREPL uses dupterm slot 0 the UART uses dupterm slot 1 (a slot which is newly introduced by this patch). UART(0) must now be attached manually in boot.py (or otherwise) and inisetup.py is changed to provide code to do this. For example, to attach use: import uos, machine uart = machine.UART(0, 115200) uos.dupterm(uart, 1) and to detach use: uos.dupterm(None, 1) When attached, all incoming chars on UART(0) go straight to stdin so uart.read() will always return None. Use sys.stdin.read() if it's needed to read characters from the UART(0) while it's also used for the REPL (or detach, read, then reattach). When detached the UART(0) can be used for other purposes. If there are no objects in any of the dupterm slots when the REPL is started (on hard or soft reset) then UART(0) is automatically attached. Without this, the only way to recover a board without a REPL would be to completely erase and reflash (which would install the default boot.py which attaches the REPL).