Commit Graph

17166 Commits

Author SHA1 Message Date
Jeff Epler e01ade3848 rgbmatrix: Don't inline the allocator functions 2020-09-01 11:00:07 -05:00
Jeff Epler 2f120c70ee rgbmatrix: recover gracefully from allocation errors
e.g., allocating a 192x32x6bpp matrix would be enough to trigger this
reliably on a Metro M4 Express using the "memory hogging" layout.
Allocating 64x32x6bpp could trigger it, but somewhat unreliably.

There are several things going on here:
 * we make the failing call with interrupts off
 * we were throwing an exception with interrupts off
 * protomatter failed badly in _PM_free when it was partially-initialized

Incorporate the fix from protomatter, switch to a non-throwing malloc
variant, and ensure that interrupts get turned back on.

This decreases the quality of the MemoryError (it cannot report the size
of the failed allocation) but allows CircuitPython to survive, rather
than faulting.
2020-09-01 10:55:45 -05:00
Jeff Epler 9bd2a61d8b supervisor: Always allocate at least a 1x1 terminal
Otherwise, out of range writes would occur in tilegrid_set_tile, causing a safe mode reset.
```
Hardware watchpoint 6: -location *stack_alloc->ptr

Old value = 24652061
New value = 24641565
0x000444f2 in common_hal_displayio_tilegrid_set_tile (self=0x200002c8 <supervisor_terminal_text_grid>, x=1, y=1, tile_index=0 '\000')
    at ../../shared-module/displayio/TileGrid.c:236
236	    if (!self->partial_change) {
(gdb)
```
2020-09-01 10:55:45 -05:00
Jeff Epler 952d9bbb4a samd: Ignore a maybe-uninitialized diagnostic in asf4
I encountered this when changing optimization flags for debugging
purposes.  The diagnostic appears spurious and unrelated to what
I'm debugging.
2020-09-01 10:55:45 -05:00
Jeff Epler ad4bf75367 samd: only set NDEBUG for non-debug builds 2020-09-01 10:55:45 -05:00
Dan Halbert ee1b142f5d
Merge pull request #3363 from dhalbert/matrix-portal
matrix portal board
2020-09-01 10:25:00 -04:00
Jeff Epler e8a29ece23
Merge pull request #3358 from jepler/esp-idf-submodules
actions: Clone the esp-idf submodules ourselves
2020-09-01 07:07:05 -05:00
Dan Halbert 4ac7650f22 matrix portal board 2020-08-31 23:56:38 -04:00
Scott Shawcroft 877a4f47cc
Merge pull request #3355 from jepler/import-builtin-submodule-crash-unix
builtinimport: Fix a crash with 'import ulab.linalg' on unix port only
2020-08-31 14:44:18 -07:00
Jeff Epler 8b2ae355ef
Merge pull request #3359 from adafruit/endpoint-counting-debug-remove
Remove debugging print-out for endpoint checking.
2020-08-31 06:44:26 -05:00
Dan Halbert 07e2fc721a
Remove debugging print-out for endpoint checking. 2020-08-30 23:14:50 -04:00
Jeff Epler ef8cde94a4 actions: Clone the esp-idf submodules ourselves
Builds of the esp32s2 targets frequently fail:
```
-- Found Git: /usr/bin/git (found version "2.28.0")
-- Initialising new submodule components/asio/asio...
warning: could not look up configuration 'remote.origin.url'. Assuming this repository is its own authoritative upstream.
Submodule 'components/asio/asio' (/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git) registered for path 'components/asio/asio'
fatal: repository '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' does not exist
fatal: clone of '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' into submodule path '/home/runner/work/circuitpython/circuitpython/ports/esp32s2/esp-idf/components/asio/asio' failed
Failed to clone 'components/asio/asio'. Retry scheduled
fatal: repository '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' does not exist
fatal: clone of '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' into submodule path '/home/runner/work/circuitpython/circuitpython/ports/esp32s2/esp-idf/components/asio/asio' failed
Failed to clone 'components/asio/asio' a second time, aborting
CMake Error at esp-idf/tools/cmake/git_submodules.cmake:48 (message):
  Git submodule init failed for components/asio/asio
Call Stack (most recent call first):
  esp-idf/tools/cmake/build.cmake:78 (git_submodule_check)
  esp-idf/tools/cmake/build.cmake:160 (__build_get_idf_git_revision)
  esp-idf/tools/cmake/idf.cmake:49 (__build_init)
  esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:8 (include)
```

It's not clear how/why this happens--is it something to do with our
multithreaded build?.  Attempt to clear it up by manually checking out these
submodules ourselves.
2020-08-30 20:51:04 -05:00
Jeff Epler 5084d2b56b
Merge pull request #3356 from weblate/weblate-circuitpython-main
Translations update from Weblate
2020-08-30 19:37:17 -05:00
Jeff Epler aba27c12e5
Translated using Weblate (Swedish)
Currently translated at 99.4% (776 of 780 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/
2020-08-30 22:02:59 +02:00
Hosted Weblate 6b506ab0ad
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/
2020-08-30 20:28:56 +02:00
Jonny Bergdahl aeeec58178
Translated using Weblate (Swedish)
Currently translated at 99.8% (776 of 777 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/
2020-08-30 20:28:55 +02:00
Jeff Epler 455226ffde builtinimport: Fix a crash with 'import ulab.linalg' on unix port only
A crash like the following occurs in the unix port:
```
Program received signal SIGSEGV, Segmentation fault.
0x00005555555a2d7a in mp_obj_module_set_globals (self_in=0x55555562c860 <ulab_user_cmodule>, globals=0x55555562c840 <mp_module_ulab_globals>) at ../../py/objmodule.c:145
145	    self->globals = globals;
(gdb) up
#1  0x00005555555b2781 in mp_builtin___import__ (n_args=5, args=0x7fffffffdbb0) at ../../py/builtinimport.c:496
496	                mp_obj_module_set_globals(outer_module_obj,
(gdb)
#2  0x00005555555940c9 in mp_import_name (name=824, fromlist=0x555555621f10 <mp_const_none_obj>, level=0x1) at ../../py/runtime.c:1392
1392	    return mp_builtin___import__(5, args);
```

I don't understand how it doesn't happen on the embedded ports, because
the module object should reside in ROM and the assignment of self->globals
should trigger a Hard Fault.

By checking VERIFY_PTR, we know that the pointed-to data is on the heap
so we can do things like mutate it.
2020-08-30 11:09:49 -05:00
Limor "Ladyada" Fried 0adccc50dc
Merge pull request #3346 from tannewt/add_kaluga
Add Kaluga board definition
2020-08-29 21:05:20 -04:00
Scott Shawcroft 7b59ede25e
Add remaining pins 2020-08-28 18:22:22 -07:00
Limor "Ladyada" Fried d858d048c1
Merge pull request #3348 from ladyada/main
add default I2C
2020-08-28 20:24:28 -04:00
Scott Shawcroft 0bb5c6c07f
Add unique USB PID 2020-08-28 16:37:25 -07:00
lady ada 81870413af add default I2C 2020-08-28 19:08:36 -04:00
Scott Shawcroft a09243472c
Add Kaluga board definition 2020-08-28 16:08:24 -07:00
Dan Halbert 893a125dd0
Merge pull request #3338 from jepler/endpoint-count-checking-stm32f405
add endpoint count checking on stm32f405
2020-08-28 11:12:31 -04:00
Dan Halbert ac06202c21
Merge pull request #3238 from ElectronicCats/bastwifi
Add Bastwifi by Electronic Cats
2020-08-28 11:03:52 -04:00
Jeff Epler 563e038c0d stm: Specify max endpoints for stm32f405xx
.. which is why we can't have HID or MIDI on the stm32f405 feather
2020-08-27 15:11:17 -05:00
Jeff Epler a03b6a99e6 gen_usb_descriptor: Fix off-by-1 error in endpoint counting 2020-08-27 15:10:52 -05:00
Jeff Epler 49a22b0c55
Merge pull request #3320 from hierophect/stm32-meowbit-fix
STM32: Fix Meowbit startup and associated bugs
2020-08-27 13:05:56 -05:00
Dan Halbert 24fb08dbd9
Merge pull request #3337 from hierophect/pulseout-errorstyle
Fix problematic whitespace on pulseout parameter errors
2020-08-27 13:22:26 -04:00
Dan Halbert 350e88d4b9
Merge pull request #3324 from hierophect/esp32-random
Add random to ESP32-S2, fix it on STM32
2020-08-27 13:22:05 -04:00
Dan Halbert 6100027243
Merge pull request #3315 from tannewt/add_psram
Add PSRAM support to ESP32S2
2020-08-27 11:58:59 -04:00
Lucian Copeland e2559efb93 translations 2020-08-27 11:21:39 -04:00
Lucian Copeland 8021da08d3 Fix problematic whitespace on pulseout parameter errors 2020-08-27 11:07:47 -04:00
hierophect 772052598d
Merge branch 'main' into stm32-meowbit-fix 2020-08-27 11:00:29 -04:00
hierophect a15f948a40
Merge branch 'main' into esp32-random 2020-08-27 10:49:14 -04:00
Dan Halbert fe73cfb922
Merge pull request #3333 from hierophect/esp32-enable-ulab
Fix all assignments affected by inline makefile comments
2020-08-27 10:36:59 -04:00
sommersoft 58d5f99394
Merge pull request #3335 from jepler/fix-doc-build
conf.py (docs): Reorder the steps of the doc build
2020-08-26 21:45:47 -05:00
Jeff Epler 200a296b5c conf.py (docs): Reorder the steps of the doc build
Since e121e267ad, the shared bindings matrix uses the stubs.
Therefore, we must build them!  This should fix the failure to build
the docs on readthedocs.org.

Neither @sommersoft nor I saw this locally since we had previously built
the stubs.  github CI didn't see it, because it manually builds the stubs
in an earlier step of the build process, and does not clean the tree
in between.
2020-08-26 20:41:25 -05:00
Lucian Copeland 8d2299e61e Merge remote-tracking branch 'upstream/main' into stm32-meowbit-fix 2020-08-26 18:50:26 -04:00
Lucian Copeland c229345741 improve efficiency of stm32 random gen 2020-08-26 18:47:19 -04:00
Lucian Copeland 553ac576eb Disable ulab 2020-08-26 17:48:29 -04:00
Lucian Copeland ad733e6c4a rename reader tool 2020-08-26 17:37:05 -04:00
sommersoft 58a7419b4f
Merge pull request #3332 from jepler/shared-bindings-matrix-ulab
Shared bindings matrix ulab
2020-08-26 15:45:56 -05:00
Lucian Copeland c77523503b Fix trailing whitespace errors across ports and docs 2020-08-26 14:48:46 -04:00
Dan Halbert 4a682cd720
Merge pull request #3330 from jepler/fix-line-endings
microdev_micro_s2: Fix DOS line endings, they give my git fits
2020-08-26 12:43:38 -04:00
Jeff Epler e121e267ad shared_bindings_matrix: Use stubs, not shared-bindings
This fixes a problem where things that were in extmod/ could not
be listed.
2020-08-26 11:29:59 -05:00
Jeff Epler 5422dd682c shared_bindings_matrix: Run in parallel
.. this makes it take a fraction of the time, at least on systems
with a lot of CPU threads.  Even on my old laptop with a 2-core CPU
it reduces the time from 55s to 27s.
2020-08-26 11:29:55 -05:00
Jeff Epler 44342732a4 Fix DOS line endings, they give my git fits 2020-08-26 10:56:00 -05:00
Dan Halbert 5755160720
Merge pull request #3322 from microDev1/microS2
Added board - microS2
2020-08-26 11:03:46 -04:00
microDev f26d15c5c9
Added PSRAM support 2020-08-26 18:39:30 +05:30