Commit Graph

50 Commits

Author SHA1 Message Date
Scott Shawcroft
94bde17256 Update Ubuntu and GCC versions used in Travis build. Now uses GCC 5.4.1. Also, tweaks what builds are run. 2016-11-29 14:31:08 -08:00
Scott Shawcroft
bd36873362 Merge tag 'v1.8.6'
ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices

This release brings some code size reductions to the core as well as
more tests and improved coverage which is now at 94.3%.

The time.ticks_diff(a, b) function has changed: the order of the arguments
has been swapped so that it behaves like "a - b", and it can now return a
negative number if "a" came before "b" (modulo the period of the ticks
functions).

For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the
heap has been increased from 28k to 36k, and there is support for 512k
devices via "make 512k".  upip is included by default as frozen bytecode.
The network module now allows access-point reconnection without WiFi
credentials, and exposes configuration for the station DHCP hostname.  The
DS18B20 driver now handles negative temperatures, and NeoPixel and APA102
drivers handle 4 bytes-per-pixel LEDs.

For the CC3200 port there is now support for loading of precompiled .mpy
files and threading now works properly with interrupts.

A detailed list of changes follows.

py core:
- py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined
- be more specific with MP_DECLARE_CONST_FUN_OBJ macros
- specialise builtin funcs to use separate type for fixed arg count
- {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible
- modbuiltins: add builtin "slice", pointing to existing slice type
- add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT
- sequence: fix reverse slicing of lists
- fix null pointer dereference in mpz.c, fix missing va_end in warning.c
- remove asserts that are always true in emitbc.c
- fix wrong assumption that m_renew will not move if shrinking
- change config default so m_malloc0 uses memset if GC not enabled
- add MICROPY_FLOAT_CONST macro for defining float constants
- move frozen bytecode Makefile rules from ports to common mk files
- strip leading dirs from frozen mpy files, so any path can be used

extmod:
- vfs_fat_file: check fatfs f_sync() and f_close() returns for errors
- vfs_fat_file: make file.close() a no-op if file already closed
- utime_mphal: ticks_diff(): switch arg order, return signed value
- utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions
- utime_mphal: implement ticks_add(), add to all maintained ports
- utime_mphal: allow ticks functions period be configurable by a port

lib:
- utils/pyhelp.c: use mp_printf() instead of printf()
- utils/pyexec: add mp_hal_set_interrupt_char() prototype
- libm: move Thumb-specific sqrtf function to separate file

drivers:
- add "from micropython import const" when const is used

tools:
- upgrade upip to 1.1.4: fix error on unix when installing to non-existing
  absolute path
- pip-micropython: remove deprecated wrapper tool
- check_code_size.sh: code size validation script for CI
- replace upip tarball with just source file, to make its inclusion as
  frozen modules in multiple ports less magic

tests:
- extmod/vfs_fat: improve VFS test coverage
- basics/builtin_slice: add test for "slice" builtin name
- basics: add test for builtin "delattr"
- extmod/vfs_fat_fsusermount: improve fsusermount test coverage
- extmod/vfs_fat_oldproto: test old block device protocol
- basics/gc1: garbage collector threshold() coverage
- extmod/uhashlib_sha1: coverage for SHA1 algorithm
- extmod/uhashlib_sha256: rename sha256.py test
- btree1: fix out of memory error running on esp8266
- extmod/ticks_diff: test for new semantics of ticks_diff()
- extmod/framebuf1: test framebuffer pixel clear, and text function

minimal port:
- Makefile: split rule for firmware.bin generation

unix port:
- Makefile: remove references to deprecated pip-micropython
- modtime: use ticks_diff() implementation from extmod/utime_mphal.c
- mphalport.h: add warning of mp_hal_delay_ms() implementation
- modtime: switch ticks/sleep_ms/us() to utime_mphal
- fix symbol references for x86 Mac
- replace upip tarball with just source file

windows port:
- enable utime_mphal following unix, define mp_hal_ticks_*
- fix utime_mphal compilation for msvc
- implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter

qemu-arm port:
- exclude ticks_diff test for qemu-arm port
- exclude extmod/vfs_fat_fileio.py test
- exclude new vfs_fat tests
- enable software floating point support, and float tests

stmhal port:
- modutime: refactor to use extmod's version of ticks_cpu
- refactor pin usage to use mp_hal_pin API
- led: refactor LED to use mp_hal_pin_output() init function
- Makefile: use standard rules for frozen module generation
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- enable SD power save (disable CLK on idle)

cc3200 port:
- use mp_raise_XXX helper functions to reduce code size
- mods/pybspi: allow "write" arg of read/readinto to be positional
- enable loading of precompiled .mpy files
- fix thread mutex's so threading works with interrupts

teensy port:
- update to provide new mp_hal_pin_XXX functions following stmhal

esp8266 port:
- Makefile: use latest esptool.py flash size auto-detection
- esp_init_data: auto-initialize system params with vendor SDK 2.0.0
- esp8266.ld: move help.o to iROM
- esp8266.ld: move modmachine.o to iROM
- esp8266.ld: move main.o to iROM
- add MP_FASTCODE modifier to put a function to iRAM
- main: mark nlr_jump_fail() as MP_FASTCODE
- modules/webrepl: enforce only one concurrent WebREPL connection
- etshal.h: add few more ESP8266 vendor lib prototypes
- modesp: add flash_user_start() function
- add support for building firmware version for 512K modules
- scripts: make neopixel/apa102 handle 4bpp LEDs with common code
- modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
- modnetwork: config(): fix copy-paste error in setting "mac"
- scripts/port_diag: add descriptions for esf_buf types
- modnetwork.c: allows AP reconnection without WiFi credentials
- main: bump heap size to 36K
- etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector
- etshal.h: adjust size of MD5_CTX structure
- modules: fix negative temperature in ds18x20 driver
- rename "machine" module implementation to use contemporary naming
- rework webrepl_setup to run over wired REPL
- espneopixel.c: solve glitching LED issues with cpu at 80MHz
- include upip as a standard frozen bytecode module
- update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect)
- modnetwork.c: expose configuration for station DHCP hostname

zephyr port:
- implement utime module
- use board/SoC values for startup banner based on Zephyr config
- initial implementation of machine.Pin
- zephyr_getchar: update for recent Zephyr refactor of console hooks
- support time -> utime module "weaklink"
- README: update for the current featureset, add more info
- mpconfigport.h: move less important params to the bottom
- Makefile: allow to adjust heap size from make command line
- Makefile: update comments to the current state of affairs
- Makefile: allow to override Zephyr config from make command line
- Makefile: add minimal port
- Makefile: add -fomit-frame-pointer to reduce code size
- mphalport.h: update for new "unified" kernal API (sleep functions)

docs:
- machine.SPI: bring up to date with Hardware API, make vendor-neutral
- machine.SPI: improve descriptions of xfer methods
- library/builtins: add docs for delattr and slice
- library/network: reword intro paragraph
- library/network: typo fixes, consistent acronym capitalization
- library/index: update TOCs so builtins sorted before modules
- utime: document ticks_cpu() in more detail
- utime: describe new semantics of ticks_diff() (signed ring arithmetics)
- utime: add docs for ticks_add(), improvements for other ticks_*()
- esp8266: update for new WebREPL setup procedure
- */quickref.rst: use new semantics of ticks_diff()
- library/machine.Pin: update Pin docs to align with new HW API

travis:
- integrate tools/check_code_size.sh
- minimal: Use CROSS=1, for binary size check

examples:
- http_server_simplistic: add "not suitable for real use" note
- hwapi: example showing best practices for HW API usage in apps
- hwapi: add hwconfig for DragonBoard 410c
2016-11-14 11:10:07 -08:00
Paul Sokolovsky
d5cf8c5753 .travis.yml: minimal: Use CROSS=1, for binary size check.
x86 has bloated alignements, etc. Use ARM binary to catch any code size
increases promptly.
2016-10-25 11:43:56 +03:00
Paul Sokolovsky
ca008bfd2d .travis.yml: Integrate tools/check_code_size.sh. 2016-10-25 11:43:55 +03:00
Scott Shawcroft
58f37fc013 Build mpy-cross first because other builds depend on it. 2016-10-24 12:12:22 -07:00
Scott Shawcroft
710bf34fbd Add atmel-samd boards to travis build. 2016-10-24 11:59:50 -07:00
Damien George
cc7c311b5e travis: Run feature and coverage test for precompiled mpy files. 2016-09-20 12:21:53 +10:00
stijn
dd0e6ddfeb travis: Abandon mingw32 in favour of mingw-w64
This is actually long overdue: the README in the windows directory has been
updated once to indicate mingw32 is abandoned and not ok to use with uPy,
but we forgot travis builds were still using it.
As a bonus the travis build will succeed again since moduerrno.c now compiles.
(see https://github.com/micropython/micropython/pull/2399)
2016-09-10 10:15:30 +10:00
Damien George
e4d6a10dc9 travis: Build mpy-cross as part of the Travis process.
It's built first in case any ports need to use it.
2016-09-05 17:33:56 +10:00
Damien George
56bb6f3979 travis: Run unix thread tests. 2016-07-09 16:53:40 +01:00
Paul Sokolovsky
20aa9c8511 .travis.yml: Install gcc-arm-none-eabi with --force-yes for now.
There appears to be issue signature problem with the PPA package we use,
so workaround it this way for now. Warning: with broken signature, there's
always a possibility that PPA was hacked and ships trojaned binaries.
2016-05-26 13:06:22 +03:00
Paul Sokolovsky
701c4152c1 tarvis: Unbreak build by ignoring lack of i386 arch in some repos.
For some reason, Travis now has Google Chrome PPA included in the builder
image, that lacks i386 arch, that leads to apt-get update error. So, ignore
it (this is not ideal as may lead to actual repo update failures to be missed,
leading to installation of old package, leading to weird errors; let's keep
that in mind).
2016-03-03 11:06:36 +02:00
Paul Sokolovsky
ac16cc9a35 .travis.yml: Switch to Ubuntu 14.04 Trusty.
This allows to cut number of packages installed from 3rd-party package repos,
and otherwise cut number of overrides and hacks.
2016-01-17 20:07:41 +02:00
Damien George
aeadda4eac travis: Add unix NaN-boxing build to Travis builds.
This will help make sure new commits work with OBJ_REPR_D.
2016-01-15 11:13:42 +00:00
Paul Sokolovsky
9058a7031f travis: Build "deplibs" in unix port. 2015-10-20 01:50:27 +03:00
Damien George
65dc960e3b unix-cpy: Remove unix-cpy. It's no longer needed.
unix-cpy was originally written to get semantic equivalent with CPython
without writing functional tests.  When writing the initial
implementation of uPy it was a long way between lexer and functional
tests, so the half-way test was to make sure that the bytecode was
correct.  The idea was that if the uPy bytecode matched CPython 1-1 then
uPy would be proper Python if the bytecodes acted correctly.  And having
matching bytecode meant that it was less likely to miss some deep
subtlety in the Python semantics that would require an architectural
change later on.

But that is all history and it no longer makes sense to retain the
ability to output CPython bytecode, because:

1. It outputs CPython 3.3 compatible bytecode.  CPython's bytecode
changes from version to version, and seems to have changed quite a bit
in 3.5.  There's no point in changing the bytecode output to match
CPython anymore.

2. uPy and CPy do different optimisations to the bytecode which makes it
harder to match.

3. The bytecode tests are not run.  They were never part of Travis and
are not run locally anymore.

4. The EMIT_CPYTHON option needs a lot of extra source code which adds
heaps of noise, especially in compile.c.

5. Now that there is an extensive test suite (which tests functionality)
there is no need to match the bytecode.  Some very subtle behaviour is
tested with the test suite and passing these tests is a much better
way to stay Python-language compliant, rather than trying to match
CPy bytecode.
2015-08-17 12:51:26 +01:00
Damien George
d792d9e49e unix: Make extra-coverage function callable from Python scripts.
This allows the output of the extra-coverage tests to be checked using
the normal run-tests script.
2015-05-08 09:18:38 +01:00
Damien George
d3b32caea4 unix: Add special function to improve coverage.
The function and corresponding command-line option are only enabled for
the coverage build.  They are used to exercise uPy features that can't
be properly tested by Python scripts.
2015-05-08 00:19:56 +01:00
Damien George
81e661f28b travis: Add automated coverage testing using coveralls. 2015-03-01 14:50:09 +00:00
Damien George
eb0a7129a5 travis: Use CPython3.4 instead of 3.3. 2015-02-27 01:07:04 +00:00
danicampora
8785645a95 cc3200: Add cc3200 port of MicroPython.
The port currently implements support for GPIO, RTC, ExtInt and the WiFi
subsystem. A small file system is available in the serial flash. A
bootloader which makes OTA updates possible, is also part of this initial
implementation.
2015-02-06 22:10:11 +00:00
Damien George
bc47c287df travis, minimal: Install gcc-multilib for -m32; use /bin/echo for test. 2015-01-14 00:26:39 +00:00
Damien George
d710cef661 minimal: Add simple test; build and run minimal test on Travis CI. 2015-01-13 12:39:29 +00:00
Damien George
7630d9ca0e travis: grep for failure in qemu-arm output if tests fail. 2015-01-12 15:50:08 +00:00
Damien George
85e8e2ed5b qemu-arm: Add 'test' target to Makefile to run and verify test suite.
Replaces RUN_TEST=1 definition; now "make test" in qemu-arm directory
will run tests/basics/ and check that they all succeed.

This patch also enables the test on Travis CI.
2015-01-09 00:03:21 +00:00
Damien George
11aa91615e stmhal: Fix ptr arith in CC3000 code; enable network build in travis. 2014-10-30 15:28:15 +00:00
Paul Sokolovsky
67f25dfe6f travis: Install realpath, required for teensy build. 2014-10-06 23:49:17 +03:00
Damien George
15d2fe8da4 tests: Add option to run-tests to enable native emitter. 2014-08-29 19:47:10 +01:00
Damien George
dd07023cb7 travis: Build stmhal/ST32F4DISC and teensy in Travis tests. 2014-08-05 14:04:11 +00:00
Paul Sokolovsky
8e01291c18 travis: Use unified diffs for failed tests. 2014-06-26 00:05:53 +03:00
stijn
5f9ebd36cd travis: Add cross-compilation of mingw port 2014-05-11 19:33:13 +02:00
Ilya Dmitrichenko
6820937892 travis: should test building qemu-arm as well. 2014-04-21 21:10:15 +01:00
Damien George
203bc98804 travis: Move diffing back to after_failure command.
Need to click on icon at right to see the output.
2014-04-15 12:52:59 +01:00
Damien George
48aaa27c6a travis: Diff output, hopefully this works. 2014-04-15 12:20:22 +01:00
Damien George
fd1c7b9d48 travis: Continue to debug tests output.
Seems that any commands in after_failure do not have stdout...
2014-04-15 12:05:26 +01:00
Damien George
e8ecca21ff travis: More tests output debugging. 2014-04-15 11:56:57 +01:00
Damien George
45b4cc77dd travis: Debugging failing tests. 2014-04-15 11:25:36 +01:00
Damien George
9e2890bb00 travis: On fail, cd to tests directory before diffing. 2014-04-15 11:14:42 +01:00
Andrew Scheller
11559cff38 travis: only build unix with gcc-4.7 2014-04-15 04:36:25 +01:00
Andrew Scheller
f0777d1c2c travis: build unix targets first
because @pfalcon says so
2014-04-15 04:15:36 +01:00
Andrew Scheller
499d50be98 Merge remote-tracking branch 'upstream/master' into patch-1
Conflicts:
	.travis.yml
2014-04-15 03:48:58 +01:00
Paul Sokolovsky
8c1bec4ae7 .travis.yml: Use gcc-4.7 to avoid broken codegeneration and failed tests. 2014-04-15 05:13:48 +03:00
Andrew Scheller
16fecc0a84 Update .travis.yml
Check that the bare-arm, stmhal and unix-cpy ports at least remain compilable, even if we can only actually run tests against the unix port.
2014-04-15 03:02:17 +01:00
Andrew Scheller
c29a0ac56a Update .travis.yml
Seems like I'd inadvertently created invalid YAML!
2014-04-15 02:42:23 +01:00
Andrew Scheller
9b5a9d41dc Update .travis.yml
Add diffing of failure logs
2014-04-15 02:29:59 +01:00
Andrew Scheller
e31a8222f2 Update .travis.yml
Doh, the shebang line for run-tests itself relies on `python3`
2014-04-15 02:14:53 +01:00
Andrew Scheller
0388b2ea78 Update .travis.yml
This *might* fix it enough for all tests to run (maybe?)
2014-04-15 00:52:15 +01:00
Damien George
8341725b65 travis: Only run some tests, to work around CPython version issues.
Needs a proper fix, to install/configure CPython 3.3.x (or 3.4.0) on
Travis CI.
2014-04-14 23:43:35 +01:00
Damien George
5224705248 travis: Change to tests directory before running. 2014-04-14 22:04:15 +01:00
AZ Huang
60993c166d Add Travis CI support. 2014-04-15 02:25:43 +08:00