aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-03-08py/emitnative: Consolidate where HASCONSTS is set to load-const-obj fun.Damien George
Simplifies the code and fixes handling of the Ellipsis const in native code generation (which also needs the constant table so must set this flag).
2019-03-08py: Add independent config for debugging sentinel object values.Damien George
The new compile-time option is MICROPY_DEBUG_MP_OBJ_SENTINELS, disabled by default. This is to allow finer control of whether this debugging feature is enabled or not (because, for example, this setting must be the same for mpy-cross and the MicroPython main code when using native code generation).
2019-03-07stm32/mboot: Update to match latest oofatfs version.Jim Mussared
See corresponding commit b5f33ac2cb6076468a77f36d69df6db16b62134a
2019-03-07lib/oofatfs: Update oofatfs library to fix issue with logic not.Damien George
From https://github.com/micropython/oofatfs, branch work-R0.13c, commit 3b4ee5a646af2769b3dddfe17d5d866233c1e45b.
2019-03-05minimal/frozentest: Recompile now that mpy format changed.Damien George
2019-03-05py/persistentcode: Define static qstr set to reduce size of mpy files.Damien George
When encoded in the mpy file, if qstr <= QSTR_LAST_STATIC then store two bytes: 0, static_qstr_id. Otherwise encode the qstr as usual (either with string data or a reference into the qstr window). Reduces mpy file size by about 5%.
2019-03-05py/persistentcode: Pack qstrs directly in bytecode to reduce mpy size.Damien George
Instead of emitting two bytes in the bytecode for where the linked qstr should be written to, it is now replaced by the actual qstr data, or a reference into the qstr window. Reduces mpy file size by about 10%.
2019-03-05py/persistentcode: Add a qstr window to save mpy files more efficiently.Damien George
This is an implementation of a sliding qstr window used to reduce the number of qstrs stored in a .mpy file. The window size is configured to 32 entries which takes a fixed 64 bytes (16-bits each) on the C stack when loading/saving a .mpy file. It allows to remember the most recent 32 qstrs so they don't need to be stored again in the .mpy file. The qstr window uses a simple least-recently-used mechanism to discard the least recently used qstr when the window overflows (similar to dictionary compression). This scheme only needs a single pass to save/load the .mpy file. Reduces mpy file size by about 25% with a window size of 32.
2019-03-05py: Replace POP_BLOCK and POP_EXCEPT opcodes with POP_EXCEPT_JUMP.Damien George
POP_BLOCK and POP_EXCEPT are now the same, and are always followed by a JUMP. So this optimisation reduces code size, and RAM usage of bytecode by two bytes for each try-except handler.
2019-03-05py/vm: Remove currently_in_except_block variable.Damien George
After the previous commit it is no longer needed.
2019-03-05py: Fix VM crash with unwinding jump out of a finally block.Damien George
This patch fixes a bug in the VM when breaking within a try-finally. The bug has to do with executing a break within the finally block of a try-finally statement. For example: def f(): for x in (1,): print('a', x) try: raise Exception finally: print(1) break print('b', x) f() Currently in uPy the above code will print: a 1 1 1 segmentation fault (core dumped) micropython Not only is there a seg fault, but the "1" in the finally block is printed twice. This is because when the VM executes a finally block it doesn't really know if that block was executed due to a fall-through of the try (no exception raised), or because an exception is active. In particular, for nested finallys the VM has no idea which of the nested ones have active exceptions and which are just fall-throughs. So when a break (or continue) is executed it tries to unwind all of the finallys, when in fact only some may be active. It's questionable whether break (or return or continue) should be allowed within a finally block, because they implicitly swallow any active exception, but nevertheless it's allowed by CPython (although almost never used in the standard library). And uPy should at least not crash in such a case. The solution here relies on the fact that exception and finally handlers always appear in the bytecode after the try body. Note: there was a similar bug with a return in a finally block, but that was previously fixed in b735208403a54774f9fd3d966f7c1a194c41870f
2019-03-05ports: Update to work with new oofatfs version.Damien George
2019-03-05extmod/vfs_fat: Update for new oofatfs version.Damien George
2019-03-05lib/oofatfs: Update ffconf.h config for new oofatfs version.Damien George
2019-03-05lib/oofatfs: Update oofatfs library to R0.13c working branch.Damien George
From https://github.com/micropython/oofatfs, branch work-R0.13c, commit cb05c9486d3b48ffd6bd7542d8dbbab4b1caf790. Large code pages (932, 936, 949, 950) have been removed from ffunicode.c because they were not included in previous versions here.
2019-03-05stm32: Add compile-time option to use HSI as clock source.Francisco J. Manno
To use HSI instead of HSE define MICROPY_HW_CLK_USE_HSI as 1 in the board configuration file. The default is to use HSE. HSI has been made the default for the NUCLEO_F401RE board to serve as an example, and because early revisions of this board need a hardware modification to get HSE working.
2019-03-04stm32/boards: Update to use new build config for lwip component.Damien George
2019-03-04stm32: Use global lwip build config and support building without lwip.Damien George
2019-03-04py/py.mk: Update lwip build config to work with latest lwip version.Damien George
Also, to make it possible for ports to provide their own lwipopts.h, the default include directory of extmod/lwip-include is no longer added and instead a port should now make sure the correct include directory is included in the list (can still use extmod/lwip-include).
2019-03-04stm32/boards/STM32F769DISC: Use external QSPI flash to store some code.Damien George
This demonstrates how to use external QSPI flash in XIP (execute in place) mode. The default configuration has all extmod/ code placed into external QSPI flash, but other code can easily be put there by modifying the custom f769_qspi.ld script.
2019-03-04stm32/Makefile: Allow a board to specify its linker sections for FW.Damien George
A board can now use the make variables TEXT0_SECTIONS and TEXT1_SECTIONS to specify the linker sections that should go in its firmware. Defaults are provided which give the existing behaviour.
2019-03-04py/objexcept: Fix hash of exc str created in mp_obj_new_exception_msg.Tom Collins
2019-03-01stm32/qspi: Enable sample shift and disable timeout counter.Damien George
This makes the QSPI more robust, in particular the timeout counter should not be used with memory mapped mode (see F7 errata).
2019-03-01cc3200/mpconfigport.h: Disable compiler optimisation of OrderedDict.Damien George
This port would rather keep the code size as RAM.
2019-03-01py/compile: Add optimisation to compile OrderedDict inplace.Damien George
This optimisation eliminates the need to create a temporary normal dict. The optimisation is enabled via MICROPY_COMP_CONST_LITERAL which is enabled by default (although only has an effect if OrderdDict is enabled). Thanks to @pfalcon for the initial idea and implementation.
2019-02-28esp8266/modmachine: Call ets_event_poll after waiti in machine.idle.Damien George
Because "waiti 0" may have waited for a while (eg 500ms) and the internal WDT may need to be fed immediately. Fixes issue #4459.
2019-02-28extmod/modwebrepl: Fix logic to handle a put of file of size 0.Damien George
Fixes issue #4499.
2019-02-27extmod/modlwip: Don't require a port to define concurrency macros.Damien George
2019-02-26py/compile: Fix handling of unwinding BaseException in async with.Damien George
All exceptions that unwind through the async-with must be caught and BaseException is the top-level class, which includes Exception and others. Fixes issue #4552.
2019-02-26stm32/boards/NUCLEO_F429ZI: Enable lwIP and Ethernet peripheral.Damien George
2019-02-26stm32/boards/STM32F769DISC: Enable lwIP and Ethernet peripheral.Damien George
2019-02-26stm32/boards/STM32F7DISC: Enable lwIP and Ethernet peripheral.Damien George
2019-02-26stm32/boards/NUCLEO_F767ZI: Enable lwIP and Ethernet peripheral.Damien George
2019-02-26stm32/modnetwork: Don't call NIC callback if it's NULL.Damien George
2019-02-26stm32/mpconfigport.h: Enable lwIP concurrency protection mechanism.Damien George
2019-02-26stm32/network_lan: Add high-level network.LAN interface to ETH driver.Damien George
2019-02-26stm32/eth: Add low-level Ethernet MAC driver.Damien George
2019-02-26lib/netutils: Add function to print tracing info for Ethernet frames.Damien George
2019-02-26extmod/modlwip: Add concurrency protection macros.Damien George
Some users of this module may require the LwIP stack to run at an elevated priority, to protect against concurrency issues with processing done by the underlying network interface. Since LwIP doesn't provide such protection it must be done here (the other option is to run LwIP in a separate thread, and use thread protection mechanisms, but that is a more heavyweight solution).
2019-02-26stm32/mphalport: Add mp_hal_get_mac() helper function.Damien George
2019-02-26stm32/boards/NUCLEO_F767ZI: Fix up comments about HCLK computation.Damien George
2019-02-26docs/uos: Document extra requirements on stream objs passed to dupterm.Yonatan Goldschmidt
This is only correct for the extmod/uos_dupterm.c implementation however, as e.g cc3200 implementation does the mp_load_method() itself, and anyway requires `read` instead of `readinto`.
2019-02-26esp32/modnetwork: Fix wifi.isconnected to return False after disconnect.Petr Kracík
esp_wifi_connect will return ESP_OK for the normal path of execution which just means the reconnect is started, not that it is actually reconnected. In such a case wifi.isconnected() should return False until the reconnection is complete. After reconnect a GOT_IP event is called and it will change wifi_sta_connected back to True.
2019-02-25unix/modffi: Eliminate unused-argument warning when debugging disabled.Damien George
2019-02-25py: Eliminate warnings about unused arguments when debugging disabled.Damien George
2019-02-21esp32/network_lan: Make power arg to constructor optional.Petr Kracík
A value of None for this argument is already supported, so the argument can be made optional.
2019-02-21esp32/modnetwork: Catch and report Ethernet events.Petr Kracík
2019-02-21esp32/network_lan: Add arg to constructor to set clock mode for ETH PHY.Petr Kracík
This optional parameter for network.LAN clock_mode can be used for cases where the clock source is different from the default GPIO0. Fixes #4502.
2019-02-21tests/basics: Add tests for try-except-else and try-except-else-finally.Damien George
2019-02-20nrf/pwm: Remove superfluous NULL in machine_hard_pwm_instances.Stig Bjørlykke
Remove unneeded NULL entry in machine_hard_pwm_instances[] when not building for NRF52_SERIES.