Commit Graph

387 Commits

Author SHA1 Message Date
Lucian Copeland 436e33e7ec Fix CI formatting issues 2021-04-20 15:04:52 -04:00
Lucian Copeland a702409983 Merge remote-tracking branch 'upstream/main' into nrf52-sleep 2021-04-20 14:58:24 -04:00
Scott Shawcroft bd5a3a3ba4
Merge pull request #4583 from tyomitch/patch-2
[qstr] Separate hash and len from string data
2021-04-12 15:06:40 -07:00
Dan Halbert c333acdbad
Merge pull request #4589 from hugodahl/feature/Remove-MicroPython-mention-in-error-messages
Make error messages platform agnostic
2021-04-10 21:30:17 -04:00
Hugo Dahl 36f3897fe3 Make error messages platform agnostic
Remove mentions of 'MicroPython' in error messages as they could lead to confusion in lesser-experienced users
2021-04-10 18:36:53 -05:00
Scott Shawcroft eacb7dbe58
Don't block serial output in interrupt
The interrupt may have a higher priority than the serial output's
(USB) interrupt and may never make room. This makes prints from
interrupts (like the BLE event calls) best effort for what can be
queued up. The rest of the output will be dropped.
2021-04-09 12:56:03 -07:00
Lucian Copeland 15764b4c24 Merge remote-tracking branch 'upstream/main' into nrf52-sleep 2021-04-09 13:48:45 -04:00
Artyom Skrobov c3e40d50ab [qstr] Separate hash and len from string data
This allows the compiler to merge strings: e.g. "update",
"difference_update" and "symmetric_difference_update"
will all point to the same memory.

Shaves ~1KB off the image size, and potentially allows
bigger savings if qstr attrs are initialized in qstr_init(),
and not stored in the image.
2021-04-06 12:58:42 -04:00
Jeff Epler 234fa2a226 decompress: Fix decompression when length takes 7 bits
This manifested as incorrect error messages from mpy-cross, like
```
$ mpy-cross doesnotexist.py
OSError: [Errno 2] cno such file/director
```

The remaining bits in `b` must be shifted to the correct position before
entering the loop.

For most (all?) actual builds, compress_max_length_bits was 8 and the
problem went unnoticed.
2021-04-04 11:15:33 -05:00
Jonny Bergdahl 1afd204828 Changed error message to display the generic term 'system firmware' instead of the Nordic specific term 'soft device' 2021-04-02 20:34:37 +02:00
Scott Shawcroft 01c153cd7e
Fix devices include by splitting type from defines 2021-03-25 11:37:08 -07:00
Scott Shawcroft aec0ef3cbf
Switch devices.h to nvm.toml data 2021-03-25 09:57:18 -07:00
Dan Halbert c81007afb0
Merge pull request #4446 from tannewt/rp2040_flash
Switch RP2040 flash settings to nvm.toml
2021-03-23 15:18:29 -04:00
Artyom Skrobov 3b613ff97c [spi_flash] handle reentrance gracefully
Report failure instead of deadlocking the device
2021-03-23 02:11:54 -04:00
Scott Shawcroft 7867632a81
Merge remote-tracking branch 'adafruit/main' into rp2040_flash 2021-03-22 15:29:43 -07:00
Linar Yusupov 76c1ae7194 fix for MX25R1635F QSPI mode of operation 2021-03-22 09:12:26 +03:00
Scott Shawcroft 5d2b60cbf6
Redo RP2040 flash settings
This switches stage2 to C and uses Jinja to change the C code based
on flash settings from https://github.com/adafruit/nvm.toml. It
produces the fastest settings for the given set of external flashes.
Flash size is no longer hard coded so switching flashes with similar
capabilities but different sizes should *just work*.

This PR also places "ITCM" code in RAM to save the XIP cache for
code execution. Further optimization is possible. A blink code.py
still requires a number of flash fetches every blink.

Fixes #4041
2021-03-18 16:55:42 -07:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Jeff Epler 1e5ffe1a53 Revert "circuitpy_mpconfig: Disable flash multi-partition"
This reverts commit 156ee4833a.
2021-03-09 11:08:36 -06:00
Scott Shawcroft b5a955a168
Merge pull request #4354 from jepler/disable-fat-partition
circuitpy_mpconfig: Disable flash multi-partition
2021-03-08 15:25:58 -08:00
Jeff Epler 32475ce98c Automatically count EXTERNAL_FLASH_DEVICES (mk2)
Instead of counting words in make, which is slightly awful, notice that
possible_devices is local to external_flash.c, so we can declare the array
with an automatic bound, and then get the count as the element-count
(MP_ARRAY_SIZE) of the array.

Since EXTERNAL_FLASH_DEVICE_COUNT is no longer a global macro, switch
a few sites to using EXTERNAL_FLASH_DEVICES in `#if` checks instead.
2021-03-07 12:51:47 -06:00
Jeff Epler 156ee4833a circuitpy_mpconfig: Disable flash multi-partition
This adds some additional code in mkfs which doesn't seem necessary, and
Disabling it saves 172 bytes flash.

Testing performed: Using a Feather M0 Adalogger, checked that
 * an sdcard could still be mounted (using adafruit_sdcard)
 * os.listdir() of "/" and "/sd" worked
 * CIRCUITPY still mounted
2021-03-07 09:37:18 -06:00
jun2sak 51c7a49853 Merge branch 'main' into nrf52-sleep 2021-03-07 20:50:53 +09:00
Dan Halbert cd48c5ee83
Merge pull request #4315 from dhalbert/rp2040-i2c-short-writes
RP2040: Implement short I2C writes (2 bytes or less) using bitbangio
2021-03-03 12:42:47 -05:00
Dan Halbert 0a58d451ad
Merge pull request #4306 from Neradoc/fix-reset-to-safe
press reset to safe mode on ports where reset reason is not implemented
2021-03-02 15:44:52 -05:00
Dan Halbert f31b472309 Merge remote-tracking branch 'adafruit/main' into rp2040-i2c-short-writes 2021-03-02 15:17:12 -05:00
Dan Halbert 9939c59caa wip 2021-03-02 15:16:55 -05:00
Neradoc 7441625f37 allow the safe mode danse if RESET_REASON_UNKNOWN 2021-03-02 00:41:43 +01:00
Radomir Dopieralski 121c6bcc9b Replace displaio.Group.children with a python list
This is a first go at it, done by naive replacing of all array
operations with corresponding operations on the list. Note that
there is a lot of unnecessary type conversions, here. Also, list_pop
has been copied, because it's decalerd STATIC in py/objlist.h
2021-02-27 20:52:38 +01:00
Radomir Dopieralski 6e0ce23f3e displaio: don't store group children native object
Since we want to expose the list of group's children to the user,
we should only have the original objects in it, without any other
additional data, and compute the native object as needed.
2021-02-27 20:52:38 +01:00
Radomir Dopieralski 8c8d60fb80 Fix for CIRCUITPY_USB_MSC=0
Avoid undefined functions when MSC is disabled.
2021-02-27 15:05:00 +01:00
Kamil Tomaszewski ef3a61432b Add the missing argument to the HID functions 2021-02-24 19:09:17 +01:00
jun2sak 9661d67cd3 replace MY_DEBUG_UART -> NRF_DEBUG_PRINT. 2021-02-25 01:49:57 +09:00
jun2sak 105042e870 move dump_xxx functions to debug_uart.c. 2021-02-23 12:22:33 +09:00
Jeff Epler aa1de69645 fix length of generated serial number descriptor 2021-02-22 07:33:04 -06:00
Jeff Epler 144acfcb98 USB descriptors: Save flash storage for serial number
This saves about 60 bytes (Feather M4 went from 45040 -> 45100 bytes free)
66 bytes of data eliminated, but 6 bytes paid back to initialize the length
field.
2021-02-21 21:24:49 -06:00
jun2sak 1da8b9900a Merge branch 'main' into nrf52-sleep 2021-02-21 13:35:06 +09:00
jun2sak d659c2ce34 move port-specific debug functions from supervisor/shared/serial.c to ports/nrf/supervisor/port.c 2021-02-21 09:55:10 +09:00
jun2sak 26f8f532f1 safe mode fix. 2021-02-21 00:47:07 +09:00
Dan Halbert e344c6d684 fix some builds 2021-02-18 14:24:58 -05:00
jun2sak e6350ff834 Initial commit. 2021-02-17 20:53:18 +09:00
Dan Halbert 0b8f1b9a90 wip: usb_cdc.serials 2021-02-15 20:06:18 -05:00
Dan Halbert d54b5861a3 wip 2021-02-12 19:01:14 -05:00
Dan Halbert f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
Dan Halbert 1b7f3d11e7 wip 2021-02-08 10:57:41 -05:00
Dan Halbert 5bb722b927
Merge pull request #4122 from hathach/fix-3986
Fix 3986 background reset remove existing usb callback
2021-02-05 09:13:28 -05:00
Dan Halbert 0802b22ed6 usb descriptors all set; rework of enabling for USB devices 2021-02-04 19:23:40 -05:00
hathach 8d7b1f9e8c add usb_background_schedule()
unconditionally schedule usb background after
background_callback_reset()
2021-02-04 16:00:14 +07:00
Kevin Banks 215a56c920 Merge branch 'main' into webusb (trying to get CI back online) 2021-02-03 16:48:28 -06:00
hathach e699a59890 hack to fix 3986
just a proof to show that issue analysis is correct
2021-02-03 11:01:33 +07:00