Commit Graph

9128 Commits

Author SHA1 Message Date
Dan Halbert 8d82e4ba5f
Merge pull request #7008 from MicroDev1/patch
Cleanup `mpconfigboard.mk` of espressif boards
2022-10-06 11:20:11 -04:00
Dan Halbert e0517c7379
Merge pull request #6999 from jepler/picow-ssl
pico_w: implement ssl with caveats
2022-10-06 10:51:36 -04:00
microDev 4f753251db
cleanup `mpconfigboard.mk` of espressif boards
- move `INTERNAL_FLASH_FILESYSTEM` to `mpconfigport.mk`
- move `LONGINT_IMPL` to `mpconfigport.mk`
- move `CFG_TUD_TASK_QUEUE_SZ` to `Makefile`
2022-10-06 16:15:01 +05:30
Dan Halbert 296960dd89 shorten board.c 2022-10-05 20:23:19 -04:00
Neradoc d31acdef6c
we don't use AUTORESET_DELAY_MS 2022-10-06 02:19:48 +02:00
Jeff Epler 2dc283f578
close underlying socket object when closing ssl socket 2022-10-05 15:10:14 -05:00
Jeff Epler 4a9389d347
remove debug message 2022-10-05 14:57:04 -05:00
Jeff Epler 14f2309b6f
Enable more key exchange methods
This is intended (but not entirely verified) to match our esp32 builds.
It does fix accessing https://circuitpython.org, which failed before with
"MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE".

It still doesn't work on a personal website of mine with valid letsencrypt
certificate but I haven't verified whether it works on esp32s2 with CP.
That site only allows TLS 1.3, while this mbedtls only supports up to
1.2.
The version of mbedtls we adopted based on micropython's use has no
TLS 1.3 support, but the one in espressif esp-idf does.
2022-10-05 14:56:27 -05:00
Jeff Epler fabfdcf6fe
More ssl work 2022-10-05 14:56:26 -05:00
Jeff Epler 944d388158
copy esp_crt_bundle.c from esp-idf@d51f7d8821 2022-10-05 14:56:26 -05:00
Jeff Epler a64c1a11c5
move nina-fw certificates so it can be shared with other ports 2022-10-05 14:56:25 -05:00
Jeff Epler 09023abcd2
Update espressif function prototype to match 2022-10-05 14:56:25 -05:00
Kyle Mohr dd5f9411c8
Merge branch 'adafruit:main' into main 2022-10-05 13:44:12 -05:00
Jeff Epler dcb650c513 pico w: add ssl module
Note: at this time, the ssl module on pico_w never verifies the server
certificate. This means it does not actually provide a higher security
level than regular socket / http protocols.
2022-10-05 13:12:43 -04:00
Jeff Epler 2bd50673b6
Finish adapting flash storage size
Before this, CIRCUITPY would start at 1MB anyway. This appeared to work
only because I hadn't checked the actual size of the CIRCUITPY drive,
and because until now the flash hadn't actually crossed that 1MB
boundary into CIRCUITPY storage.

WARNING: on pico_w, upgrading/downgrading CircuitPython across this commit
boundary will erase the CIRCUITPY filesystem. After this commit,
switching between pico and pico_w firmware will erase the CIRCUITPY
filesystem
2022-10-05 10:02:38 -05:00
Jeff Epler 52bca95208
Refactor dotenv module so that it can be tested on host
.. it needs to operate on a FILE* rather than FIL depending on
the build.

Note that this is comparing output to expected, not to cpython dotenv
package. Because run-tests.py starts the CPython interpreter with the
'-S' (skip site initialization) flag, pip-installed packages are
not available for import inside a test file. Instead, the exp
file is generated manually:
```
circuitpython/tests$ python3 circuitpython/dotenv_test.py > circuitpython/dotenv_test.py.exp
```

Unfortunately, the test fails on test e15:
```diff
FAILURE /home/jepler/src/circuitpython/tests/results/circuitpython_dotenv_test.py
--- /home/jepler/src/circuitpython/tests/results/circuitpython_dotenv_test.py.exp	2022-10-04 09:48:16.307703128 -0500
+++ /home/jepler/src/circuitpython/tests/results/circuitpython_dotenv_test.py.out	2022-10-04 09:48:16.307703128 -0500
@@ -14,7 +14,7 @@
 line
 e13 e13value
 e14 None
-e15 e15value
+e15 None
 e16 #
 e17 def
 e18 #has a hash
```
2022-10-04 09:51:27 -05:00
Kyle Mohr 02e115cbc2
Update mpconfigboard.mk 2022-10-04 00:03:59 -05:00
Kyle Mohr 330b96726a add newlines to end of files 2022-10-04 04:56:31 +00:00
Kyle Mohr 5268ef01c9
Utilize VID/PID from native USB port 2022-10-03 23:45:28 -05:00
Kyle Mohr cffc1bfcab
sdkconfig didn't get committed for some reason... 2022-10-03 22:54:31 -05:00
Kyle Mohr a948dc399b add esp32-s2-devkitc-1-n8r2 variant 2022-10-04 03:51:51 +00:00
Dan Halbert 90f6096955 fix ai-thinker creation ids; fix some typos elsewhere 2022-10-03 15:29:03 -04:00
Dan Halbert ad79f595a5
Merge pull request #6974 from MicroDev1/patch
Couple Minor Fixes
2022-10-01 13:12:01 -04:00
Dan Halbert 7bb90dbf45 remove redundant port/*/.gitignore; cleanup others 2022-10-01 11:52:36 -04:00
Jeff Epler 40c2de833d
doc improvements 2022-10-01 10:09:33 -05:00
Jeff Epler d3e85d165e
Set cyw43 power management as needed, default to disabled
.. the value actually needs to be enforced each time the STA or AP
is enabled, because internally there's a call to cyw43_wifi_pm with the
library's defaut power management value, not ours.

Add a getter, though it only returns our idea of what the power
management register is set to, it doesn't read out from the actual
hardware, sadly.
2022-10-01 08:20:34 -05:00
Jeff Epler 943b992bfc
Improve cyw43.set_power_management documentation
.. and provide 4 preset values
2022-10-01 07:52:08 -05:00
microDev 7eaeca4eb3
update espressif port's .gitignore 2022-10-01 09:14:48 +05:30
Dan Halbert f9e655da47
Merge pull request #6962 from dhalbert/espressif-deep-sleep-hold-pins
Espressif: do not hold pins during deep sleep if not necessary
2022-09-30 22:20:44 -04:00
Dan Halbert bced76887e
Merge pull request #6973 from jepler/rp2040-fix-warnings
Rp2040 fix warnings
2022-09-30 16:21:31 -04:00
Jeff Epler c02602ace1
Enable strict-overflow diagnostic 2022-09-30 11:19:23 -05:00
Jeff Epler afc1c0e3bb
Fix unused variable diagnostics, make it a fatal error 2022-09-30 11:19:22 -05:00
Jeff Epler 37620d4eb0
Fix several classes of compiler diagnostic & make fatal
* -Wno-nested-externs
 * -Wno-strict-prototypes
 * -Wno-double-promotion
 * -Wno-sign-compare
2022-09-30 11:19:22 -05:00
Jeff Epler c6eef3931f
Enable warning for unused static functions 2022-09-30 11:19:22 -05:00
Jeff Epler 2c9c6fc80e
Remove unused static functions 2022-09-30 11:19:21 -05:00
Jeff Epler 907c5d387f
Tweak black_bindings
Originally, black_bindings found each contiguous "//|" block and sent
it to black independently. This was slower than it needed to be.

Instead, swap the comment prefix: when running black, take off
"//|" prefixes and put "##|" prefixes on all un-prefixed lines.
Then, after black is run, do the opposite operation

This more than doubles the overall speed of "pre-commit run --all",
from 3m20s to 55s CPU time on my local machine (32.5s to under 10s
"elapsed" time)

It also causes a small amount of churn in the bindings, because
black now sees enough context to know whether one 'def' follows another
or ends the 'def's in a 'class'. In the latter case, it adds an extra
newline, which becomes a "//|" line.

I'm less sure why a trailing comma was omitted before down in
rp2pio/StateMachine.c but let's roll with it.
2022-09-30 11:18:13 -05:00
Jeff Epler fcf7cfe838
Merge pull request #6960 from jepler/picow-server
Pico W: implement more things
2022-09-30 11:15:37 -05:00
Jeff Epler 0912889106
raspberrypi: statically allocate storage for hostname 2022-09-30 10:05:11 -05:00
Jeff Epler 84c7ac4a81
Make cyw43.set_power_management() be a function as intended 2022-09-30 07:56:59 -05:00
Jeff Epler 3281e14be1
fix reference to board module 2022-09-29 21:37:34 -05:00
Jeff Epler 4de9487820
It turns out you CAN have too many GPIO 2022-09-29 20:10:33 -05:00
Dan Halbert 9d1b12066d Espressif: do not hold pins during deep sleep if not necessary 2022-09-29 20:11:48 -04:00
flom84 7af8a23ddf Use macro for computing size of array. 2022-09-29 22:10:21 +02:00
flom84 3609c29b27 Update STM DFU mode software implementation.
- fix for sizeof array calculation.

 - follow ARM recommendation to turn off interruptions with NVIC.
2022-09-29 21:15:51 +02:00
Jeff Epler 510bd11f58
Enable reading back value of cyw43 pin
Now, `led.value = not led.value` works as a way to toggle the LED state.

Closes: #6959
2022-09-29 11:06:11 -05:00
Jeff Epler a3bcfd6911
Add pin_CYW1 for SMPS_MODE 2022-09-29 10:54:06 -05:00
Jeff Epler 72b06021c0
fix doc formatting 2022-09-29 10:27:13 -05:00
Jeff Epler 74cdf42ece
pico w: implement bind, listen, accept
this works with some simple tcp & udp echo service code
2022-09-29 10:02:20 -05:00
Jeff Epler 12ea04ca70
Add cyw43.set_power_management 2022-09-29 10:02:20 -05:00
Jeff Epler 91f1266db5
Document CywPin 2022-09-29 10:02:19 -05:00