From 02069eb0b529cc2660715f5ae1da618cb6ddb541 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 23 Jun 2022 15:59:06 -0400 Subject: [PATCH 001/108] wip --- data/nvm.toml | 2 +- frozen/Adafruit_CircuitPython_APDS9960 | 2 +- frozen/Adafruit_CircuitPython_BLE | 2 +- ...ircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- .../Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DRV2605 | 2 +- frozen/Adafruit_CircuitPython_DS3231 | 2 +- frozen/Adafruit_CircuitPython_Display_Shapes | 2 +- frozen/Adafruit_CircuitPython_Display_Text | 2 +- frozen/Adafruit_CircuitPython_DotStar | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_FakeRequests | 2 +- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LC709203F | 2 +- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_MIDI | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_PortalBase | 2 +- frozen/Adafruit_CircuitPython_ProgressBar | 2 +- frozen/Adafruit_CircuitPython_RFM69 | 2 +- frozen/Adafruit_CircuitPython_RFM9x | 2 +- frozen/Adafruit_CircuitPython_Register | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_SD | 2 +- frozen/Adafruit_CircuitPython_ST7789 | 2 +- frozen/Adafruit_CircuitPython_SimpleIO | 2 +- frozen/Adafruit_CircuitPython_SimpleMath | 2 +- frozen/Adafruit_CircuitPython_Thermistor | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- ports/atmel-samd/peripherals | 2 +- .../adafruit_esp32s2_camera/mpconfigboard.mk | 8 +- .../adafruit_feather_esp32s2/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 8 +- .../boards/adafruit_funhouse/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../adafruit_metro_esp32s2/mpconfigboard.mk | 8 +- .../adafruit_qtpy_esp32c3/mpconfigboard.mk | 8 +- .../adafruit_qtpy_esp32s2/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 6 +- .../ai_thinker_esp32-c3s-2m/mpconfigboard.mk | 6 +- .../ai_thinker_esp32-c3s/mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 8 +- .../boards/artisense_rd00/mpconfigboard.mk | 8 +- .../atmegazero_esp32s2/mpconfigboard.mk | 6 +- .../crumpspace_crumps2/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 6 +- .../electroniccats_bastwifi/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../espressif_esp32s3_box/mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../espressif_hmi_devkit_1/mpconfigboard.mk | 8 +- .../espressif_kaluga_1.3/mpconfigboard.mk | 8 +- .../espressif_kaluga_1/mpconfigboard.mk | 8 +- .../espressif_saola_1_wroom/mpconfigboard.mk | 8 +- .../espressif_saola_1_wrover/mpconfigboard.mk | 8 +- .../franzininho_wifi_wroom/mpconfigboard.mk | 8 +- .../franzininho_wifi_wrover/mpconfigboard.mk | 8 +- .../gravitech_cucumber_m/mpconfigboard.mk | 8 +- .../gravitech_cucumber_ms/mpconfigboard.mk | 8 +- .../gravitech_cucumber_r/mpconfigboard.mk | 8 +- .../gravitech_cucumber_rs/mpconfigboard.mk | 8 +- .../boards/hexky_s2/mpconfigboard.mk | 6 +- .../boards/hiibot_iots2/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../boards/lilygo_ttgo_t8_s2/mpconfigboard.mk | 2 +- .../lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk | 2 +- .../boards/lolin_s2_mini/mpconfigboard.mk | 6 +- .../boards/lolin_s2_pico/mpconfigboard.mk | 6 +- .../boards/microdev_micro_c3/mpconfigboard.mk | 6 +- .../boards/microdev_micro_s2/mpconfigboard.mk | 6 +- .../boards/mixgo_ce_serial/mpconfigboard.mk | 8 +- .../boards/mixgo_ce_udisk/mpconfigboard.mk | 8 +- .../morpheans_morphesp-240/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../odt_pixelwing_esp32_s2/mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 8 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../mpconfigboard.mk | 6 +- .../unexpectedmaker_pros3/mpconfigboard.mk | 6 +- .../unexpectedmaker_tinys2/mpconfigboard.mk | 6 +- .../unexpectedmaker_tinys3/mpconfigboard.mk | 6 +- .../esp-idf-config/sdkconfig-8MB.defaults | 7 +- .../esp-idf-config/sdkconfig-ble.defaults | 156 +----------------- .../esp-idf-config/sdkconfig-opt.defaults | 50 +++--- .../esp-idf-config/sdkconfig.defaults | 129 +++++++++------ ports/espressif/modules/wroom.c | 37 ----- ports/espressif/modules/wrover.c | 38 ----- ports/espressif/mpconfigport.mk | 9 +- 108 files changed, 379 insertions(+), 567 deletions(-) delete mode 100644 ports/espressif/modules/wroom.c delete mode 100644 ports/espressif/modules/wrover.c diff --git a/data/nvm.toml b/data/nvm.toml index 2d292ad4e6..266ea20ed8 160000 --- a/data/nvm.toml +++ b/data/nvm.toml @@ -1 +1 @@ -Subproject commit 2d292ad4e67890d4b85b027431ba9fef7bf561fd +Subproject commit 266ea20ed80104c315dcb124b482fa5f9f48cdec diff --git a/frozen/Adafruit_CircuitPython_APDS9960 b/frozen/Adafruit_CircuitPython_APDS9960 index 13856be616..9bd4882092 160000 --- a/frozen/Adafruit_CircuitPython_APDS9960 +++ b/frozen/Adafruit_CircuitPython_APDS9960 @@ -1 +1 @@ -Subproject commit 13856be616eee2eb84280b7c4914951c1ddbfd36 +Subproject commit 9bd48820928afad549832fe9b4ae497b224007f0 diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 7d9635ba1d..13c529288e 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 7d9635ba1dda31ce45b84519c4da76ff86d0debe +Subproject commit 13c529288e9431541fe58cf7992d4f53f7ca3b76 diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index e5cf8206c0..258bb62c58 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit e5cf8206c0173228252ae74367cab85b0531488e +Subproject commit 258bb62c58e545c38749b8a66f5872035b2384cb diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index 9addf6a26f..b96f0d2794 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit 9addf6a26fef3a32c78d574c66452b6210eca5c5 +Subproject commit b96f0d279481446017ca1cc1ff4abf1f5a10346f diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index 843def7dae..54b2fa03d8 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit 843def7daee741c8fb04fe21c3c7b98f22862471 +Subproject commit 54b2fa03d8af80562b77460841e63d47f12eee43 diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 0a045871d3..938f6bb335 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 0a045871d3da681d1c9c9578f09174bfc6d84f1d +Subproject commit 938f6bb335ba5e4c56a8062c591ff9f3c18c4297 diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 index 6a429bcd0e..8e7e111a9f 160000 --- a/frozen/Adafruit_CircuitPython_DRV2605 +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -1 +1 @@ -Subproject commit 6a429bcd0e6b22ee181197ce0477ae70f5adb80d +Subproject commit 8e7e111a9ff39d3f4311caa7babeb451422c759f diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 index 22931594bc..df24498154 160000 --- a/frozen/Adafruit_CircuitPython_DS3231 +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -1 +1 @@ -Subproject commit 22931594bc52ab259eaf313d26219a507703c315 +Subproject commit df2449815433e05ea0f89c19518ccde7a10a2faa diff --git a/frozen/Adafruit_CircuitPython_Display_Shapes b/frozen/Adafruit_CircuitPython_Display_Shapes index d90f9e7b12..2fad6f2f98 160000 --- a/frozen/Adafruit_CircuitPython_Display_Shapes +++ b/frozen/Adafruit_CircuitPython_Display_Shapes @@ -1 +1 @@ -Subproject commit d90f9e7b122aad072d59a01df524036995cf4a78 +Subproject commit 2fad6f2f98c0df135e2306d32af18bb2796b852c diff --git a/frozen/Adafruit_CircuitPython_Display_Text b/frozen/Adafruit_CircuitPython_Display_Text index bb9cb75e15..de3276cc08 160000 --- a/frozen/Adafruit_CircuitPython_Display_Text +++ b/frozen/Adafruit_CircuitPython_Display_Text @@ -1 +1 @@ -Subproject commit bb9cb75e15b4bfce3063a94b40dfad2375d5605e +Subproject commit de3276cc08ba13901d1f69060ff7501c1699bc4d diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index f9469d26ed..a90579e1e1 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit f9469d26ed9eb95d43982de88c035ac3862dd258 +Subproject commit a90579e1e1e1c973e6ba8f6cf8e914d77fc8f0f2 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index f3d504be1d..ddd26eb4ab 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit f3d504be1dc82cc4a8e4ea9b38bd5c2ce74d59ba +Subproject commit ddd26eb4abcd3c10ae5dd33b1345d10d58707995 diff --git a/frozen/Adafruit_CircuitPython_FakeRequests b/frozen/Adafruit_CircuitPython_FakeRequests index 2ea025b1b6..f6cdec74b6 160000 --- a/frozen/Adafruit_CircuitPython_FakeRequests +++ b/frozen/Adafruit_CircuitPython_FakeRequests @@ -1 +1 @@ -Subproject commit 2ea025b1b68b0be95a0514732d4bc623f313fd75 +Subproject commit f6cdec74b64112016c459abe4a5d31a3b34caeb3 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index b637c47423..a77f0f9c2e 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit b637c47423eb85233ba614424aadadace37fcfb1 +Subproject commit a77f0f9c2e8f64568bbb68254d0134fbc7b5a8af diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 47cc914748..2fddabcaf0 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 47cc91474823677218239b5b37901590755cac4c +Subproject commit 2fddabcaf0df1763111ed9dbf9e2d4cdb5b0434e diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index a2491a806b..1e478b1530 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit a2491a806b636f66caf670527c49b864923f125c +Subproject commit 1e478b1530b3be81bd84f13620d0a23502d377f1 diff --git a/frozen/Adafruit_CircuitPython_LC709203F b/frozen/Adafruit_CircuitPython_LC709203F index 72367f37cd..a9cf0cde77 160000 --- a/frozen/Adafruit_CircuitPython_LC709203F +++ b/frozen/Adafruit_CircuitPython_LC709203F @@ -1 +1 @@ -Subproject commit 72367f37cd221c7af7822ba3a9cd21cd3cd70292 +Subproject commit a9cf0cde77c185c6bbc79a3b6d77dd024a9683d2 diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index a06c8a116e..acc4bdd73f 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit a06c8a116e5767a8481b9018239fe729e01760a6 +Subproject commit acc4bdd73fdceb74d75cd5a1f261ae157ee32613 diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 5acf8a850d..3d1aab0daf 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 5acf8a850d98789a79fe37836b2ac7b623d95913 +Subproject commit 3d1aab0daf63c3b4476f73cba39cf5da49e1e4aa diff --git a/frozen/Adafruit_CircuitPython_MIDI b/frozen/Adafruit_CircuitPython_MIDI index d3f9adce6e..3d871907f0 160000 --- a/frozen/Adafruit_CircuitPython_MIDI +++ b/frozen/Adafruit_CircuitPython_MIDI @@ -1 +1 @@ -Subproject commit d3f9adce6e48d37222ef171a280cfa3122faf15b +Subproject commit 3d871907f0187c627277382f184209f5520703a6 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index df61e7b0be..207953aac0 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit df61e7b0be9dc0c6a1bbe60f526fbdc01b6c2819 +Subproject commit 207953aac033d40728b5f8dd7fd73d90facbca5c diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index 015eb1ccd5..36d4a31010 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit 015eb1ccd5eb5364d8e1cf20358e7dcda9f12efc +Subproject commit 36d4a31010461e47f265553ebd764c69d38a254c diff --git a/frozen/Adafruit_CircuitPython_PortalBase b/frozen/Adafruit_CircuitPython_PortalBase index a5b3f74049..bcfaae874f 160000 --- a/frozen/Adafruit_CircuitPython_PortalBase +++ b/frozen/Adafruit_CircuitPython_PortalBase @@ -1 +1 @@ -Subproject commit a5b3f74049dfa0d39caf1c0520e46d773ba4d643 +Subproject commit bcfaae874fbae294ce04549d55b96d6b41603944 diff --git a/frozen/Adafruit_CircuitPython_ProgressBar b/frozen/Adafruit_CircuitPython_ProgressBar index 1c39469bac..011acd627f 160000 --- a/frozen/Adafruit_CircuitPython_ProgressBar +++ b/frozen/Adafruit_CircuitPython_ProgressBar @@ -1 +1 @@ -Subproject commit 1c39469bac98eea022af695ac42e5096dae6130c +Subproject commit 011acd627fc24342c397fc640b204a798f7b69dd diff --git a/frozen/Adafruit_CircuitPython_RFM69 b/frozen/Adafruit_CircuitPython_RFM69 index 74ea48f7a5..c58defd709 160000 --- a/frozen/Adafruit_CircuitPython_RFM69 +++ b/frozen/Adafruit_CircuitPython_RFM69 @@ -1 +1 @@ -Subproject commit 74ea48f7a5d85591f5af804cacb57e9cfaab46c6 +Subproject commit c58defd70947531c5a9c37ddcb569f240567a78b diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x index cd1da8c938..2d8310f19d 160000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -1 +1 @@ -Subproject commit cd1da8c9384537b886ea697d5c38c7b34f8a178a +Subproject commit 2d8310f19d1bdce817df13e807b409b5b057fc21 diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index d1e8ac7ad9..49ab415d6b 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit d1e8ac7ad9dcd65ab83749db3e5c96ffee80ebb7 +Subproject commit 49ab415d6b601c99979262f9e91c21dcb3a927a7 diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 6e03832b11..2e6b3f9fee 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 6e03832b1170d75d7a7e0b8a578160298905b726 +Subproject commit 2e6b3f9feeacc678402454f7d3416b04a9a93e17 diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index 332143d4ca..da02c76d4c 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit 332143d4ca5762d2d351ceb170c0b4e37dd42793 +Subproject commit da02c76d4c802cd5abac73a5f274243b05e8cb35 diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 995959d5dc..850c3dc512 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 995959d5dca23fbe49590700d1aa26a96dca1df7 +Subproject commit 850c3dc512f7feae1eaad20bdc1c5e4c63c92f08 diff --git a/frozen/Adafruit_CircuitPython_SimpleIO b/frozen/Adafruit_CircuitPython_SimpleIO index d238fe99e2..272d225365 160000 --- a/frozen/Adafruit_CircuitPython_SimpleIO +++ b/frozen/Adafruit_CircuitPython_SimpleIO @@ -1 +1 @@ -Subproject commit d238fe99e24ea4cdb472f1d8a9c99dd189b0aeca +Subproject commit 272d225365eed46916390cf1f393dd08bc00b7d4 diff --git a/frozen/Adafruit_CircuitPython_SimpleMath b/frozen/Adafruit_CircuitPython_SimpleMath index 632655b8f5..fad0f89e76 160000 --- a/frozen/Adafruit_CircuitPython_SimpleMath +++ b/frozen/Adafruit_CircuitPython_SimpleMath @@ -1 +1 @@ -Subproject commit 632655b8f5f6f62e3b4d0b6161213634e0ae74e9 +Subproject commit fad0f89e760829a76f553ef8459f61001597a846 diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index 0c3a5ecaac..e86f258e43 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit 0c3a5ecaac0891776822556b18f79722d72a8f04 +Subproject commit e86f258e43591ce4a04661277e77e9fdf6fec27e diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index 148345d232..3aaf72165b 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit 148345d232c83133de3649fb70b471f11501b3d2 +Subproject commit 3aaf72165bc6ba10bf5219716c8654651649f87b diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 79bf4e87e9..d3b20192cf 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 79bf4e87e98356c54f13799ccb8fb84dff987bd1 +Subproject commit d3b20192cf94fdea68a412596e082108ba5ebbf0 diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk index d99a431599..724a85370d 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk index 3f2fee9cf4..b975aecd5e 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk index 0f099f8b22..c6d34efbd1 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk @@ -13,8 +13,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk index e1a9793289..38167546b9 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk index 22175fce5d..69f7dd09e0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s3_wrover diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk index 7c768eb51c..37979eed6f 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index b3c68b3b62..088dd9386c 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -13,8 +13,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s3_wroom diff --git a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk index fb7b969b80..aa1f5a40fb 100644 --- a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk index 3091d298e9..a03c697931 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk index a7204b957d..8bd07381d6 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk index 36d9c3b5d6..6ca93a9fd4 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk @@ -1,10 +1,10 @@ CIRCUITPY_CREATOR_ID = 0x0000239A -CIRCUITPY_CREATION_ID = 0x00010001 +CIRCUITPY_CREATION_ID = 0x00c30001 IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk index d415e140cb..2273fbe307 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk @@ -13,8 +13,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk index 657855cad8..49ec368c49 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk @@ -13,9 +13,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk index 6d7a58ea5c..125666b599 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=2MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 2MB diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk index 3a83ab500b..eb88c5caab 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk index 1883b1fbfa..433c43f1ff 100644 --- a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk index 1f9d037ef2..31fbf593ed 100644 --- a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk +++ b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk index 79246b1393..453591d3f8 100644 --- a/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk index e55ca0e4e8..8014d03bf1 100644 --- a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk @@ -12,13 +12,13 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_APA102 = 1 -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover # Include these Python libraries in firmware. # FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk index 7a7a032e2c..84ab3422e8 100644 --- a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk index 8e2517ba23..77de160464 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk +++ b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -14,8 +14,8 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk index b952dacef7..a652d71e8f 100644 --- a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk index e902c3975a..7d7ef438f6 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk index d007558640..06947b1275 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk index 6664ba8c98..86865981e6 100644 --- a/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk index b6ead37eee..8e7b09dbc9 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk index 7fff66f5d8..698c1fff88 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk index 4e65fc940d..f9c6cd9c44 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk index 9558b05576..d6b401ac87 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk index e9eab16f91..3197d78a31 100644 --- a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk index 1b11f4fbee..02395a4fa8 100644 --- a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk index 7823674329..e261ad372d 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk index 7823674329..e261ad372d 100644 --- a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk index f25cdc4a63..e24f540814 100644 --- a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk index b4154bf3a4..38c74fd064 100644 --- a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk index f1ed49a32a..2b5328ad31 100644 --- a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk index 1478332fac..8f7a39f117 100644 --- a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk index ad9bce8cc0..63b35234b7 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk index c96ac0dc09..8bfc6e1c02 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk index 51f5fe468f..d044160804 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk index 6cb8d13d8e..02c1669434 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/hexky_s2/mpconfigboard.mk b/ports/espressif/boards/hexky_s2/mpconfigboard.mk index 726bd3bb51..dbde2f77e4 100644 --- a/ports/espressif/boards/hexky_s2/mpconfigboard.mk +++ b/ports/espressif/boards/hexky_s2/mpconfigboard.mk @@ -13,8 +13,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk b/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk index 58a7176119..b52c88cdc6 100644 --- a/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk +++ b/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk @@ -12,7 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=8MB -#CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +#CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk index 528938f7ac..379b6f087e 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk index f0c9eb5c0b..1eed59fc41 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk index c7795bbdeb..1738a22c0e 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk index 5e40a1e13c..acedc2ad51 100644 --- a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB # Include these Python libraries in firmware. diff --git a/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk b/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk index b060be0261..bd4aca0337 100644 --- a/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB # Include these Python libraries in firmware. diff --git a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk index 12bd7358b8..ce431624ae 100644 --- a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk +++ b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk index 887e6d8b9b..d551a5601c 100644 --- a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk +++ b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk @@ -11,6 +11,6 @@ INTERNAL_FLASH_FILESYSTEM = 1 # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk index 860f611354..db600060d6 100644 --- a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index 7e6646225f..9917654502 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk index 567f2ddea1..2b5c7b7d39 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk index 7385906921..baf78ce4b8 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk index 6060a5c581..4a7ce7966c 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk index f4c0be83dc..1ad615ef48 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk index a64f49c144..959161f193 100644 --- a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wroom +CIRCUITPY_MODULE = esp32s2_wroom diff --git a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk index 6683acac15..d0f2c7304c 100644 --- a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_MODULE = esp32s2_wrover diff --git a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk index 84c9787733..10ddea75f1 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk index cef7355051..f42f8ca7cc 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk index 84c9787733..10ddea75f1 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk index 866bd15ffa..eb6673b563 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB #CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk index 3b50324d3c..4413a8b641 100644 --- a/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB # CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk index ead608e6b2..8b1cd8bb51 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk index 32a711c257..9de950e632 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB # CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults b/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults index 1ecb1b4c16..ba91195364 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults @@ -6,6 +6,9 @@ # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y # end of Serial flasher config @@ -13,6 +16,6 @@ CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y # # Partition Table # -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB.csv" -CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" # end of Partition Table diff --git a/ports/espressif/esp-idf-config/sdkconfig-ble.defaults b/ports/espressif/esp-idf-config/sdkconfig-ble.defaults index 8180786fbf..0260d9f53f 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-ble.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-ble.defaults @@ -4,161 +4,7 @@ # # Bluetooth # -CONFIG_BT_ENABLED=y -# -# Bluetooth controller -# -CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=10 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 -CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE=0 -CONFIG_BT_CTRL_HCI_MODE_VHCI=y -# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set -CONFIG_BT_CTRL_HCI_TL=1 -CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 -# CONFIG_BT_CTRL_HW_CCA is not set -CONFIG_BT_CTRL_HW_CCA_VAL=20 -CONFIG_BT_CTRL_HW_CCA_EFF=0 -CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set -CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N27 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=10 -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 -CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -# CONFIG_BT_CTRL_BLE_SCAN_DUPL is not set -# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 -# -# MODEM SLEEP Options -# -# CONFIG_BT_CTRL_MODEM_SLEEP is not set -# end of MODEM SLEEP Options - -CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 -CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 -CONFIG_BT_CTRL_HCI_TL_EFF=1 -# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set -# end of Bluetooth controller - -# CONFIG_BT_BLUEDROID_ENABLED is not set -CONFIG_BT_NIMBLE_ENABLED=y -# CONFIG_BT_CONTROLLER_ONLY is not set -# -# NimBLE Options -# -CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y -# CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set -# CONFIG_BT_NIMBLE_LOG_LEVEL_NONE is not set -# CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR is not set -# CONFIG_BT_NIMBLE_LOG_LEVEL_WARNING is not set -CONFIG_BT_NIMBLE_LOG_LEVEL_INFO=y -# CONFIG_BT_NIMBLE_LOG_LEVEL_DEBUG is not set -CONFIG_BT_NIMBLE_LOG_LEVEL=1 -CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3 -CONFIG_BT_NIMBLE_MAX_BONDS=3 -CONFIG_BT_NIMBLE_MAX_CCCDS=8 -CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=0 -CONFIG_BT_NIMBLE_TASK_STACK_SIZE=4096 -CONFIG_BT_NIMBLE_ROLE_CENTRAL=y -CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y -CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y -CONFIG_BT_NIMBLE_ROLE_OBSERVER=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -CONFIG_BT_NIMBLE_SM_LEGACY=y -CONFIG_BT_NIMBLE_SM_SC=y -# CONFIG_BT_NIMBLE_DEBUG is not set -# CONFIG_BT_NIMBLE_SM_SC_DEBUG_KEYS is not set -CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="nimble" -CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 -CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=256 -CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0 -CONFIG_BT_NIMBLE_ACL_BUF_COUNT=20 -CONFIG_BT_NIMBLE_ACL_BUF_SIZE=255 -CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 -CONFIG_BT_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 -CONFIG_BT_NIMBLE_HCI_EVT_LO_BUF_COUNT=8 -CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT=12 -# CONFIG_BT_NIMBLE_HS_FLOW_CTRL is not set -CONFIG_BT_NIMBLE_RPA_TIMEOUT=900 -# CONFIG_BT_NIMBLE_MESH is not set -CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS=y -CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS=2000 -# CONFIG_BT_NIMBLE_HOST_BASED_PRIVACY is not set -CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=y -CONFIG_BT_NIMBLE_MAX_CONN_REATTEMPT=3 -CONFIG_BT_NIMBLE_EXT_ADV=y -CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=1 -CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN=1650 -CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV=y -CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS=1 -# CONFIG_BT_NIMBLE_BLUFI_ENABLE is not set -CONFIG_BT_NIMBLE_USE_ESP_TIMER=y -# end of NimBLE Options - +# CONFIG_BT_ENABLED is not set # end of Bluetooth # end of Component config - -# -# Deprecated options for backward compatibility -# -# CONFIG_BLUEDROID_ENABLED is not set -CONFIG_NIMBLE_ENABLED=y -CONFIG_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y -# CONFIG_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set -CONFIG_NIMBLE_MAX_CONNECTIONS=3 -CONFIG_NIMBLE_MAX_BONDS=3 -CONFIG_NIMBLE_MAX_CCCDS=8 -CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=0 -CONFIG_NIMBLE_TASK_STACK_SIZE=4096 -CONFIG_NIMBLE_ROLE_CENTRAL=y -CONFIG_NIMBLE_ROLE_PERIPHERAL=y -CONFIG_NIMBLE_ROLE_BROADCASTER=y -CONFIG_NIMBLE_ROLE_OBSERVER=y -CONFIG_NIMBLE_NVS_PERSIST=y -CONFIG_NIMBLE_SM_LEGACY=y -CONFIG_NIMBLE_SM_SC=y -# CONFIG_NIMBLE_DEBUG is not set -# CONFIG_NIMBLE_SM_SC_DEBUG_KEYS is not set -CONFIG_NIMBLE_SVC_GAP_DEVICE_NAME="nimble" -CONFIG_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 -CONFIG_NIMBLE_ATT_PREFERRED_MTU=256 -CONFIG_NIMBLE_SVC_GAP_APPEARANCE=0 -CONFIG_NIMBLE_ACL_BUF_COUNT=20 -CONFIG_NIMBLE_ACL_BUF_SIZE=255 -CONFIG_NIMBLE_HCI_EVT_BUF_SIZE=70 -CONFIG_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 -CONFIG_NIMBLE_HCI_EVT_LO_BUF_COUNT=8 -CONFIG_NIMBLE_MSYS1_BLOCK_COUNT=12 -# CONFIG_NIMBLE_HS_FLOW_CTRL is not set -CONFIG_NIMBLE_RPA_TIMEOUT=900 -# CONFIG_NIMBLE_MESH is not set -CONFIG_NIMBLE_CRYPTO_STACK_MBEDTLS=y -CONFIG_SW_COEXIST_ENABLE=y -# end of Deprecated options for backward compatibility diff --git a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults index e9b91113d5..b00d04770f 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults @@ -14,44 +14,36 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_COMPILER_OPTIMIZATION_NONE is not set -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=1 +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 # CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set # end of Compiler options # # Component config # -# -# ESP32S3-Specific -# -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -# end of ESP32S3-Specific - # # Common ESP-related # -# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # end of Common ESP-related # # ESP System Settings # -# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y # CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set -CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set -# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set +CONFIG_ESP_CONSOLE_UART_DEFAULT=y # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set -CONFIG_ESP_CONSOLE_NONE=y -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y -CONFIG_ESP_CONSOLE_UART_NUM=-1 +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 # end of ESP System Settings # @@ -70,7 +62,8 @@ CONFIG_FREERTOS_DEBUG_OCDAWARE=y CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y # CONFIG_HAL_ASSERTION_DISABLE is not set # CONFIG_HAL_ASSERTION_SILIENT is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=1 +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 # end of Hardware Abstraction Layer (HAL) and Low Level (LL) # @@ -86,16 +79,17 @@ CONFIG_LWIP_ESP_LWIP_ASSERT=y # # CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y -# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set -CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set # CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=1 -# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +CONFIG_ESP32S2_PANIC_PRINT_HALT=y # CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set -CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set -# CONFIG_CONSOLE_UART_DEFAULT is not set +CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set -CONFIG_ESP_CONSOLE_UART_NONE=y -CONFIG_CONSOLE_UART_NUM=-1 +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 # end of Deprecated options for backward compatibility diff --git a/ports/espressif/esp-idf-config/sdkconfig.defaults b/ports/espressif/esp-idf-config/sdkconfig.defaults index 5fb49faa82..9ad89d4811 100644 --- a/ports/espressif/esp-idf-config/sdkconfig.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig.defaults @@ -54,37 +54,25 @@ CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # # Security features # -CONFIG_SECURE_BOOT_SUPPORTS_RSA=y -CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -108,10 +96,10 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # # Partition Table # -# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +CONFIG_PARTITION_TABLE_SINGLE_APP=y # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set -CONFIG_PARTITION_TABLE_CUSTOM=y +# CONFIG_PARTITION_TABLE_CUSTOM is not set CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -142,7 +130,6 @@ CONFIG_APPTRACE_DEST_NONE=y CONFIG_APPTRACE_LOCK_ENABLE=y # end of Application Level Tracing -# CONFIG_BLE_MESH is not set # # Driver configurations # @@ -172,6 +159,10 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # end of TWAI configuration # @@ -180,6 +171,18 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + # # GDMA Configuration # @@ -194,24 +197,45 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y -CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +CONFIG_ESP_TLS_SERVER=y # CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS +# +# ADC-Calibration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# end of ADC-Calibration + # # Ethernet # +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 # CONFIG_ETH_USE_SPI_ETHERNET is not set # CONFIG_ETH_USE_OPENETH is not set # end of Ethernet @@ -240,16 +264,9 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y # Sleep Config # CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y -# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set # end of Sleep Config -# -# RTC Clock Config -# -CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y -# end of RTC Clock Config - # end of Hardware Settings # @@ -266,7 +283,7 @@ CONFIG_ESP_IPC_ISR_ENABLE=y CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 CONFIG_ESP_NETIF_TCPIP_LWIP=y # CONFIG_ESP_NETIF_LOOPBACK is not set -# CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER is not set +CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y # end of ESP NETIF Adapter # @@ -276,32 +293,34 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_REDUCE_TX_POWER=y # end of PHY # # Power Management # # CONFIG_PM_ENABLE is not set -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # # ESP System Settings # # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 CONFIG_ESP_INT_WDT_CHECK_CPU1=y -# CONFIG_ESP_TASK_WDT is not set +CONFIG_ESP_TASK_WDT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y # end of ESP System Settings @@ -314,16 +333,15 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # end of High resolution timer (esp_timer) # # Wi-Fi # # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # end of Wi-Fi @@ -340,10 +358,6 @@ CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y # FreeRTOS # CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y CONFIG_FREERTOS_HZ=100 # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -366,6 +380,7 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -578,7 +593,6 @@ CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="certificates/nina-fw/data/roots.p CONFIG_MBEDTLS_ECP_RESTARTABLE=y CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -729,7 +743,6 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -750,7 +763,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -783,6 +795,8 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -826,18 +840,41 @@ CONFIG_STACK_CHECK_NONE=y # CONFIG_WARN_WRITE_STRINGS is not set # CONFIG_DISABLE_GCC8_WARNINGS is not set CONFIG_ADC2_DISABLE_DAC=y +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 CONFIG_IPC_TASK_STACK_SIZE=1536 -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=8192 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART=y CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 CONFIG_INT_WDT_CHECK_CPU1=y -# CONFIG_TASK_WDT is not set +CONFIG_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y CONFIG_TIMER_TASK_STACK_SIZE=3584 # CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set CONFIG_TIMER_TASK_PRIORITY=1 diff --git a/ports/espressif/modules/wroom.c b/ports/espressif/modules/wroom.c deleted file mode 100644 index 5e530701bf..0000000000 --- a/ports/espressif/modules/wroom.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} diff --git a/ports/espressif/modules/wrover.c b/ports/espressif/modules/wrover.c deleted file mode 100644 index 23fa7ee5ca..0000000000 --- a/ports/espressif/modules/wrover.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash and RAM - common_hal_never_reset_pin(&pin_GPIO26); - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 2eeb86e49d..69b732e097 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -33,7 +33,12 @@ CIRCUITPY_ESPIDF ?= 1 CIRCUITPY_MODULE ?= none -ifeq ($(IDF_TARGET),esp32c3) +ifeq ($(IDF_TARGET),esp32) +CIRCUITPY_BLEIO = 0 +CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_USB = 0 + +else ifeq ($(IDF_TARGET),esp32c3) CIRCUITPY_AESIO = 0 CIRCUITPY_ALARM = 0 CIRCUITPY_AUDIOBUSIO = 0 @@ -49,11 +54,13 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO ?= 1 CIRCUITPY_TOUCHIO_USE_NATIVE = 0 CIRCUITPY_USB = 0 + else ifeq ($(IDF_TARGET),esp32s3) CIRCUITPY_BLEIO = 1 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_IMAGECAPTURE = 0 CIRCUITPY_PARALLELDISPLAY = 0 + else ifeq ($(IDF_TARGET),esp32s2) # No BLE on S2 CIRCUITPY_BLEIO = 0 From 55784c93de618e8f7e569e2196e49c7651465d56 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 26 Jun 2022 17:45:35 -0400 Subject: [PATCH 002/108] wip; compiles --- ports/espressif/Makefile | 18 +- .../boards/adafruit_feather_esp32_v2/board.c | 49 +++++ .../adafruit_feather_esp32_v2/mpconfigboard.h | 48 +++++ .../mpconfigboard.mk | 17 ++ .../boards/adafruit_feather_esp32_v2/pins.c | 86 +++++++++ .../adafruit_feather_esp32_v2/sdkconfig | 51 ++++++ .../boards/adafruit_feather_esp32s2/sdkconfig | 16 +- .../common-hal/alarm/touch/TouchAlarm.c | 30 ++- .../espressif/common-hal/analogio/AnalogIn.c | 6 +- .../espressif/common-hal/analogio/AnalogOut.c | 31 ++-- ports/espressif/common-hal/canio/CAN.c | 12 ++ .../common-hal/frequencyio/FrequencyIn.c | 16 +- .../common-hal/microcontroller/Pin.c | 7 +- .../common-hal/microcontroller/Processor.c | 22 ++- .../common-hal/microcontroller/__init__.c | 118 +++++++++++- ports/espressif/common-hal/touchio/TouchIn.c | 6 +- .../esp-idf-config/partitions-8MB-no-uf2.csv | 9 + .../sdkconfig-8MB-no-uf2.defaults | 18 ++ .../esp-idf-config/sdkconfig-8MB.defaults | 7 +- .../esp-idf-config/sdkconfig-ble.defaults | 156 +++++++++++++++- .../esp-idf-config/sdkconfig-esp32.defaults | 171 ++++++++++++++++++ .../esp-idf-config/sdkconfig-opt.defaults | 50 ++--- .../esp-idf-config/sdkconfig.defaults | 129 +++++-------- ports/espressif/modules/esp32_pico_mini_02.c | 37 ++++ ports/espressif/modules/esp32s2_wroom.c | 37 ++++ ports/espressif/modules/esp32s2_wrover.c | 38 ++++ ports/espressif/modules/esp32s3_wroom.c | 37 ++++ ports/espressif/modules/esp32s3_wrover.c | 38 ++++ ports/espressif/mpconfigport.h | 12 +- ports/espressif/mpconfigport.mk | 4 + ports/espressif/mphalport.c | 4 +- ports/espressif/peripherals/esp32/pins.c | 69 +++++++ ports/espressif/peripherals/esp32/pins.h | 111 ++++++++++++ ports/espressif/peripherals/esp32c3/pins.h | 22 +++ ports/espressif/peripherals/esp32s2/pins.h | 43 +++++ ports/espressif/peripherals/esp32s3/pins.h | 45 +++++ ports/espressif/peripherals/pins.h | 4 +- ports/espressif/peripherals/touch.c | 8 + ports/espressif/supervisor/port.c | 7 + ports/espressif/tools/build_memory_info.py | 9 + 40 files changed, 1450 insertions(+), 148 deletions(-) create mode 100644 ports/espressif/boards/adafruit_feather_esp32_v2/board.c create mode 100644 ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h create mode 100644 ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk create mode 100644 ports/espressif/boards/adafruit_feather_esp32_v2/pins.c create mode 100644 ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig create mode 100644 ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv create mode 100644 ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults create mode 100644 ports/espressif/esp-idf-config/sdkconfig-esp32.defaults create mode 100644 ports/espressif/modules/esp32_pico_mini_02.c create mode 100644 ports/espressif/modules/esp32s2_wroom.c create mode 100644 ports/espressif/modules/esp32s2_wrover.c create mode 100644 ports/espressif/modules/esp32s3_wroom.c create mode 100644 ports/espressif/modules/esp32s3_wrover.c create mode 100644 ports/espressif/peripherals/esp32/pins.c create mode 100644 ports/espressif/peripherals/esp32/pins.h diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index acdf496edb..f713e942e6 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -194,7 +194,12 @@ LDFLAGS += \ -Wl,--build-id=none \ -fno-rtti -ifeq ($(IDF_TARGET),esp32c3) +ifeq ($(IDF_TARGET),esp32) +LDFLAGS += \ + -T$(IDF_TARGET).rom.newlib-data.ld \ + -T$(IDF_TARGET).rom.newlib-funcs.ld \ + -T$(IDF_TARGET).rom.spiflash.ld +else ifeq ($(IDF_TARGET),esp32c3) LDFLAGS += \ -Tesp32c3.rom.newlib.ld \ -Tesp32c3.rom.version.ld \ @@ -362,6 +367,9 @@ $(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a libsmartconfig.a libwapi.a BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS)) +ifeq ($(IDF_TARGET),esp32) +BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/librtc.a +endif ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_ipc esp_netif esp_pm esp_phy esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls mdns newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant ifneq ($(CIRCUITPY_BLEIO),0) @@ -380,12 +388,16 @@ BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a endif -ifeq ($(IDF_TARGET),esp32c3) +ifeq ($(IDF_TARGET),esp32) +BOOTLOADER_OFFSET = 0x0 +else ifeq ($(IDF_TARGET),esp32c3) BOOTLOADER_OFFSET = 0x0 else ifeq ($(IDF_TARGET),esp32s3) BOOTLOADER_OFFSET = 0x0 -else +else ifeq ($(IDF_TARGET),esp32s2) BOOTLOADER_OFFSET = 0x1000 +else +$(error unknown IDF_TARGET $(IDF_TARGET)) endif IDF_CMAKE_TARGETS = \ diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/board.c b/ports/espressif/boards/adafruit_feather_esp32_v2/board.c new file mode 100644 index 0000000000..4c433a9da8 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/board.c @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // Turn on NeoPixel and I2C power by default. + gpio_set_direction(2, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(2, true); +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h new file mode 100644 index 0000000000..886963028b --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Adafruit Feather ESP32 V2" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO0) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO2) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO20, .sda = &pin_GPIO22}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO5, .mosi = &pin_GPIO19, .miso = &pin_GPIO21}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO8, .rx = &pin_GPIO7}} + +// For entering safe mode, use SW38 button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO38) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing SW38 button at start up.\n") diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk new file mode 100644 index 0000000000..9ec5919f54 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk @@ -0,0 +1,17 @@ +CIRCUITPY_CREATOR_ID = 0x0000239A +CIRCUITPY_CREATION_ID = 0x00320001 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 8MB + +CIRCUITPY_MODULE = esp32_pico_mini_02 diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/pins.c b/ports/espressif/boards/adafruit_feather_esp32_v2/pins.c new file mode 100644 index 0000000000..43cca6a7af --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/pins.c @@ -0,0 +1,86 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SW38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_I2C_POWER), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig new file mode 100644 index 0000000000..94333353af --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -0,0 +1,51 @@ + +# Espressif IoT Development Framework (ESP-IDF) Project Configuration +# +# Bootloader config +# +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +CONFIG_BOOTLOADER_LOG_LEVEL=0 +# end of Bootloader config + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# end of Serial flasher config + +# +# Partition Table +# +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +# end of Partition Table + +# +# Compiler options +# +# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set +# end of Compiler options + +# +# Component config +# +# +# ESP32-specific +# +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# end of ESP32-specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" +# end of LWIP + +# end of Component config + +# +# Deprecated options for backward compatibility +# +# CONFIG_SPIRAM_SUPPORT is not set +# end of Deprecated options for backward compatibility diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig index f19afafa3d..37fd534249 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig @@ -1,3 +1,9 @@ +# +# Component config +# +# +# ESP32S2-specific +# CONFIG_ESP32S2_SPIRAM_SUPPORT=y # # SPI RAM config @@ -7,12 +13,10 @@ CONFIG_SPIRAM_TYPE_ESPPSRAM16=y # CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set CONFIG_SPIRAM_SIZE=2097152 -# end of SPI RAM config - -CONFIG_DEFAULT_PSRAM_CLK_IO=30 # # PSRAM clock and cs IO for ESP32S2 # +CONFIG_DEFAULT_PSRAM_CLK_IO=30 CONFIG_DEFAULT_PSRAM_CS_IO=26 # end of PSRAM clock and cs IO for ESP32S2 @@ -30,8 +34,14 @@ CONFIG_SPIRAM_USE_MEMMAP=y # CONFIG_SPIRAM_USE_MALLOC is not set CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# end of ESP32S2-specific + # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # end of LWIP + +# end of Component config diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 941b99d6fd..0caeeea915 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -58,10 +58,17 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) { alarm->base.type = &alarm_touch_touchalarm_type; alarm->pin = NULL; + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_t wake_channel; + if (touch_pad_get_wakeup_status(&wake_channel) != ESP_OK) { + return alarm; + } + #else touch_pad_t wake_channel = touch_pad_get_current_meas_channel(); if (wake_channel == TOUCH_PAD_MAX) { return alarm; } + #endif // Map the pin number back to a pin object. for (size_t i = 0; i < mcu_pin_globals.map.used; i++) { @@ -122,16 +129,27 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar mp_hal_delay_ms(10); // configure trigger threshold + #if defined(CONFIG_IDF_TARGET_ESP32) + uint16_t touch_value; + touch_pad_read(touch_channel, &touch_value); + touch_pad_set_thresh(touch_channel, touch_value * 0.1); // 10% + #else uint32_t touch_value; touch_pad_read_benchmark(touch_channel, &touch_value); - touch_pad_set_thresh(touch_channel, touch_value * 0.1); // 10% + touch_pad_set_threshold(touch_channel, touch_value * 0.1); // 10% + #endif } } // configure touch interrupt + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_isr_register(touch_interrupt, NULL); + touch_pad_intr_enable(); + #else touch_pad_timeout_set(true, SOC_TOUCH_PAD_THRESHOLD_MAX); touch_pad_isr_register(touch_interrupt, NULL, TOUCH_PAD_INTR_MASK_ALL); touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE); + #endif } void alarm_touch_touchalarm_prepare_for_deep_sleep(void) { @@ -154,17 +172,25 @@ void alarm_touch_touchalarm_prepare_for_deep_sleep(void) { // intialize touchpad peripherals_touch_init(touch_channel); + #if !defined(CONFIG_IDF_TARGET_ESP32) // configure touchpad for sleep touch_pad_sleep_channel_enable(touch_channel, true); touch_pad_sleep_channel_enable_proximity(touch_channel, false); + #endif // wait for touch data to reset mp_hal_delay_ms(10); // configure trigger threshold + #if defined(CONFIG_IDF_TARGET_ESP32) + uint16_t touch_value; + touch_pad_read_filtered(touch_channel, &touch_value); + touch_pad_set_thresh(touch_channel, touch_value); + #else uint32_t touch_value; touch_pad_sleep_channel_read_smooth(touch_channel, &touch_value); - touch_pad_sleep_set_threshold(touch_channel, touch_value * 0.1); // 10% + touch_pad_sleep_set_threshold(touch_channel, touch_value / 10); // 10% + #endif // enable touchpad wakeup esp_sleep_enable_touchpad_wakeup(); diff --git a/ports/espressif/common-hal/analogio/AnalogIn.c b/ports/espressif/common-hal/analogio/AnalogIn.c index a81a8add22..fb2e098cb4 100644 --- a/ports/espressif/common-hal/analogio/AnalogIn.c +++ b/ports/espressif/common-hal/analogio/AnalogIn.c @@ -40,12 +40,16 @@ #define DEFAULT_VREF 1100 #define NO_OF_SAMPLES 2 #define ATTENUATION ADC_ATTEN_DB_11 -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#define DATA_WIDTH ADC_WIDTH_BIT_12 +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #define DATA_WIDTH ADC_WIDTH_BIT_12 #elif defined(CONFIG_IDF_TARGET_ESP32S2) #define DATA_WIDTH ADC_WIDTH_BIT_13 #elif defined(CONFIG_IDF_TARGET_ESP32S3) #define DATA_WIDTH ADC_WIDTH_BIT_12 +#else +#error No known CONFIG_IDF_TARGET_xxx found #endif void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, diff --git a/ports/espressif/common-hal/analogio/AnalogOut.c b/ports/espressif/common-hal/analogio/AnalogOut.c index cc99d4faa1..8720dcf8bb 100644 --- a/ports/espressif/common-hal/analogio/AnalogOut.c +++ b/ports/espressif/common-hal/analogio/AnalogOut.c @@ -35,20 +35,29 @@ #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate/translate.h" -#ifdef CONFIG_IDF_TARGET_ESP32S2 +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) #include "components/driver/include/driver/dac_common.h" +#define HAS_DAC 1 +#if defined(CONFIG_IDF_TARGET_ESP32) +#define pin_CHANNEL_1 pin_GPIO25 +#define pin_CHANNEL_2 pin_GPIO26 +#elif defined(CONFIG_IDF_TARGET_ESP32S2) +#define pin_CHANNEL_1 pin_GPIO17 +#define pin_CHANNEL_2 pin_GPIO18 +#endif +#else +#define HAS_DAC 0 #endif - -#include "common-hal/microcontroller/Pin.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 - if (pin == &pin_GPIO17) { + #if HAS_DAC + if (pin == &pin_CHANNEL_1) { self->channel = DAC_CHANNEL_1; - } else if (pin == &pin_GPIO18) { + } else if (pin == &pin_CHANNEL_2) { self->channel = DAC_CHANNEL_2; - } else { + } + else { raise_ValueError_invalid_pin(); } dac_output_enable(self->channel); @@ -58,7 +67,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC return self->channel == DAC_CHANNEL_MAX; #else return false; @@ -66,7 +75,7 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC dac_output_disable(self->channel); self->channel = DAC_CHANNEL_MAX; #endif @@ -74,7 +83,7 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC uint8_t dac_value = (value * 255) / 65535; dac_output_enable(self->channel); dac_output_voltage(self->channel, dac_value); @@ -82,7 +91,7 @@ void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, } void analogout_reset(void) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC dac_output_disable(DAC_CHANNEL_1); dac_output_disable(DAC_CHANNEL_2); #endif diff --git a/ports/espressif/common-hal/canio/CAN.c b/ports/espressif/common-hal/canio/CAN.c index c9f585b9be..67cf7b9591 100644 --- a/ports/espressif/common-hal/canio/CAN.c +++ b/ports/espressif/common-hal/canio/CAN.c @@ -76,30 +76,42 @@ STATIC twai_timing_config_t get_t_config(int baudrate) { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_25KBITS(); return t_config; } + #if defined(TWAI_TIMING_CONFIG_20KBITS) case 20000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_20KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_16KBITS) case 16000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_16KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_12_5KBITS) case 12500: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_12_5KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_10KBITS) case 10000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_10KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_5KBITS) case 5000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_5KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_1KBITS) case 1000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1KBITS(); return t_config; } + #endif default: mp_raise_ValueError(translate("Baudrate not supported by peripheral")); } diff --git a/ports/espressif/common-hal/frequencyio/FrequencyIn.c b/ports/espressif/common-hal/frequencyio/FrequencyIn.c index 9a7e8e812f..d35614ea19 100644 --- a/ports/espressif/common-hal/frequencyio/FrequencyIn.c +++ b/ports/espressif/common-hal/frequencyio/FrequencyIn.c @@ -55,15 +55,29 @@ static void IRAM_ATTR timer_interrupt_handler(void *self_in) { // reset interrupt timg_dev_t *device = self->timer.group ? &(TIMERG1) : &(TIMERG0); + + #if defined(CONFIG_IDF_TARGET_ESP32) + if (self->timer.idx) { + device->int_clr_timers.t1 = 1; + } else { + device->int_clr_timers.t0 = 1; + } + #else if (self->timer.idx) { device->int_clr_timers.t1_int_clr = 1; } else { device->int_clr_timers.t0_int_clr = 1; } - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #endif + + #if defined(CONFIG_IDF_TARGET_ESP32) + device->hw_timer[self->timer.idx].config.alarm_en = 1; + #elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C2) device->hw_timer[self->timer.idx].config.tx_alarm_en = 1; #elif defined(CONFIG_IDF_TARGET_ESP32S3) device->hw_timer[self->timer.idx].config.tn_alarm_en = 1; + #else + #error No known CONFIG_IDF_TARGET_xxx found #endif } diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index 1323c9ae5d..957ddd3492 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -55,7 +55,12 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) { } STATIC void _reset_pin(gpio_num_t pin_number) { - #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) + // Never ever reset pins used for flash and RAM. + #if defined(CONFIG_IDF_TARGET_ESP32) + if (pin_number == 6 || pin_number == 11 || pin_number == 9 || pin_number == 10) { + return; + } + #elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) // Never ever reset pins used for flash and RAM. if (26 <= pin_number && pin_number <= 32) { return; diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index 5ceefa411f..9b97b98cbd 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -39,11 +39,14 @@ #include "esp_system.h" #include "soc/efuse_reg.h" + +#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3) #include "driver/temp_sensor.h" +#endif float common_hal_mcu_processor_get_temperature(void) { float tsens_out; - #ifdef CONFIG_IDF_TARGET_ESP32S3 + #if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32) mp_raise_NotImplementedError(NULL); #else temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃. @@ -60,12 +63,16 @@ float common_hal_mcu_processor_get_voltage(void) { } uint32_t common_hal_mcu_processor_get_frequency(void) { - #ifdef CONFIG_IDF_TARGET_ESP32C3 + #if defined(CONFIG_IDF_TARGET_ESP32) + return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 100000; + #elif defined(CONFIG_IDF_TARGET_ESP32C3) return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32S2) return CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32S3) return CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000; + #else + #error No known CONFIG_IDF_TARGET_xxx found #endif } @@ -78,7 +85,13 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { uint8_t *ptr = &raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH - 1]; // MAC address contains 48 bits (6 bytes), 32 in the low order word + + #if defined(CONFIG_IDF_TARGET_ESP32) + uint32_t mac_address_part = REG_READ(EFUSE_BLK0_RDATA1_REG); + #else uint32_t mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_0_REG); + #endif + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; *ptr-- = swap_nibbles(mac_address_part & 0xff); @@ -88,7 +101,12 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { *ptr-- = swap_nibbles(mac_address_part & 0xff); // and 16 in the high order word + #if defined(CONFIG_IDF_TARGET_ESP32) + mac_address_part = REG_READ(EFUSE_BLK0_RDATA2_REG); + #else mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_1_REG); + #endif + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; *ptr-- = swap_nibbles(mac_address_part & 0xff); diff --git a/ports/espressif/common-hal/microcontroller/__init__.c b/ports/espressif/common-hal/microcontroller/__init__.c index 3cf41ba7f0..4af5ddba86 100644 --- a/ports/espressif/common-hal/microcontroller/__init__.c +++ b/ports/espressif/common-hal/microcontroller/__init__.c @@ -45,7 +45,9 @@ #include "soc/rtc_cntl_reg.h" #include "esp_private/system_internal.h" -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#include "esp32/rom/rtc.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #include "esp32c3/rom/rtc.h" #elif defined(CONFIG_IDF_TARGET_ESP32S2) #include "esp32s2/rom/rtc.h" @@ -55,6 +57,8 @@ #include "esp32s3/rom/rtc.h" #include "esp32s3/rom/usb/usb_persist.h" #include "esp32s3/rom/usb/chip_usb_dw_wrapper.h" +#else +#error No known CONFIG_IDF_TARGET_xxx found #endif void common_hal_mcu_delay_us(uint32_t delay) { @@ -85,16 +89,22 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { switch (runmode) { case RUNMODE_UF2: - #ifndef CONFIG_IDF_TARGET_ESP32C3 + #if defined(CONFIG_IDF_TARGET_ESP32) ||defined(CONFIG_IDF_TARGET_ESP32C3) + mp_arg_error_invalid(MP_QSTR_run_mode); + #else // 0x11F2 is APP_REQUEST_UF2_RESET_HINT & is defined by TinyUF2 esp_reset_reason_set_hint(0x11F2); #endif break; case RUNMODE_NORMAL: + #if defined(CONFIG_IDF_TARGET_ESP32) + safe_mode_on_next_reset(NO_SAFE_MODE); + #else // revert back to normal boot REG_WRITE(RTC_RESET_CAUSE_REG, 0); // reset uf2 REG_WRITE(RTC_CNTL_STORE0_REG, 0); // reset safe mode REG_WRITE(RTC_CNTL_OPTION1_REG, 0); // reset bootloader + #endif break; case RUNMODE_SAFE_MODE: // enter safe mode on next boot @@ -102,10 +112,12 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { break; case RUNMODE_BOOTLOADER: // DFU download - #ifndef CONFIG_IDF_TARGET_ESP32C3 + #if defined(CONFIG_IDF_TARGET_ESP32) ||defined(CONFIG_IDF_TARGET_ESP32C3) + mp_arg_error_invalid(MP_QSTR_run_mode); + #else chip_usb_set_persist_flags(USBDC_BOOT_DFU); - #endif REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT); + #endif break; default: break; @@ -149,49 +161,145 @@ watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { // This maps MCU pin names to pin objects. STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { + #ifdef GPIO0_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) }, + #endif + #ifdef GPIO1_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO1), MP_ROM_PTR(&pin_GPIO1) }, + #endif + #ifdef GPIO2_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO2), MP_ROM_PTR(&pin_GPIO2) }, + #endif + #ifdef GPIO3_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO3), MP_ROM_PTR(&pin_GPIO3) }, + #endif + #ifdef GPIO4_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO4), MP_ROM_PTR(&pin_GPIO4) }, + #endif + #ifdef GPIO5_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO5), MP_ROM_PTR(&pin_GPIO5) }, + #endif + #ifdef GPIO6_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) }, + #endif + #ifdef GPIO7_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) }, + #endif + #ifdef GPIO8_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) }, + #endif + #ifdef GPIO9_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) }, + #endif + #ifdef GPIO10_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) }, + #endif + #ifdef GPIO11_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) }, + #endif + #ifdef GPIO12_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) }, + #endif + #ifdef GPIO13_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO13), MP_ROM_PTR(&pin_GPIO13) }, + #endif + #ifdef GPIO14_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO14), MP_ROM_PTR(&pin_GPIO14) }, + #endif + #ifdef GPIO15_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO15), MP_ROM_PTR(&pin_GPIO15) }, + #endif + #ifdef GPIO16_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO16), MP_ROM_PTR(&pin_GPIO16) }, + #endif + #ifdef GPIO17_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO17), MP_ROM_PTR(&pin_GPIO17) }, + #endif + #ifdef GPIO18_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO18), MP_ROM_PTR(&pin_GPIO18) }, + #endif + #ifdef GPIO19_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO19), MP_ROM_PTR(&pin_GPIO19) }, + #endif + #ifdef GPIO20_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO20), MP_ROM_PTR(&pin_GPIO20) }, + #endif + #ifdef GPIO21_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO21), MP_ROM_PTR(&pin_GPIO21) }, - #ifndef CONFIG_IDF_TARGET_ESP32C3 + #endif + #ifdef GPIO22_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO22), MP_ROM_PTR(&pin_GPIO22) }, + #endif + #ifdef GPIO23_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) }, + #endif + #ifdef GPIO24_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO24), MP_ROM_PTR(&pin_GPIO24) }, + #endif + #ifdef GPIO25_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO25), MP_ROM_PTR(&pin_GPIO25) }, + #endif + #ifdef GPIO26_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO26), MP_ROM_PTR(&pin_GPIO26) }, + #endif + #ifdef GPIO27_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO27), MP_ROM_PTR(&pin_GPIO27) }, + #endif + #ifdef GPIO28_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO28), MP_ROM_PTR(&pin_GPIO28) }, + #endif + #ifdef GPIO29_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO29), MP_ROM_PTR(&pin_GPIO29) }, + #endif + #ifdef GPIO30_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO30), MP_ROM_PTR(&pin_GPIO30) }, + #endif + #ifdef GPIO31_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO31), MP_ROM_PTR(&pin_GPIO31) }, + #endif + #ifdef GPIO32_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO32), MP_ROM_PTR(&pin_GPIO32) }, + #endif + #ifdef GPIO33_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO33), MP_ROM_PTR(&pin_GPIO33) }, + #endif + #ifdef GPIO34_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO34), MP_ROM_PTR(&pin_GPIO34) }, + #endif + #ifdef GPIO35_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO35), MP_ROM_PTR(&pin_GPIO35) }, + #endif + #ifdef GPIO36_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO36), MP_ROM_PTR(&pin_GPIO36) }, + #endif + #ifdef GPIO37_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO37), MP_ROM_PTR(&pin_GPIO37) }, + #endif + #ifdef GPIO38_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO38), MP_ROM_PTR(&pin_GPIO38) }, + #endif + #ifdef GPIO39_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO39), MP_ROM_PTR(&pin_GPIO39) }, + #endif + #ifdef GPIO40_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO40), MP_ROM_PTR(&pin_GPIO40) }, + #endif + #ifdef GPIO41_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO41), MP_ROM_PTR(&pin_GPIO41) }, + #endif + #ifdef GPIO42_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO42), MP_ROM_PTR(&pin_GPIO42) }, + #endif + #ifdef GPIO43_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO43), MP_ROM_PTR(&pin_GPIO43) }, + #endif + #ifdef GPIO44_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO44), MP_ROM_PTR(&pin_GPIO44) }, + #endif + #ifdef GPIO45_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO45), MP_ROM_PTR(&pin_GPIO45) }, + #endif + #ifdef GPIO46_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO46), MP_ROM_PTR(&pin_GPIO46) }, #endif }; diff --git a/ports/espressif/common-hal/touchio/TouchIn.c b/ports/espressif/common-hal/touchio/TouchIn.c index 14a27637c8..523245f359 100644 --- a/ports/espressif/common-hal/touchio/TouchIn.c +++ b/ports/espressif/common-hal/touchio/TouchIn.c @@ -31,12 +31,16 @@ #include "shared-bindings/microcontroller/Pin.h" static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { + #if defined(CONFIG_IDF_TARGET_ESP32) + uint16_t touch_value; + #else uint32_t touch_value; + #endif; touch_pad_read_raw_data(self->pin->touch_channel, &touch_value); if (touch_value > UINT16_MAX) { return UINT16_MAX; } - return touch_value; + return (uint16_t)touch_value; } void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self, diff --git a/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv b/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv new file mode 100644 index 0000000000..e7bfe0c51f --- /dev/null +++ b/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv @@ -0,0 +1,9 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 2048K, +ota_1, 0, ota_1, 0x210000, 2048K, +user_fs, data, fat, 0x410000, 4032K, diff --git a/ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults b/ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults new file mode 100644 index 0000000000..2a2548ba04 --- /dev/null +++ b/ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults @@ -0,0 +1,18 @@ +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +# end of Serial flasher config + +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +# +# Partition Table +# +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +# end of Partition Table diff --git a/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults b/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults index ba91195364..1ecb1b4c16 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults @@ -6,9 +6,6 @@ # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y # end of Serial flasher config @@ -16,6 +13,6 @@ CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y # # Partition Table # -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB.csv" # end of Partition Table diff --git a/ports/espressif/esp-idf-config/sdkconfig-ble.defaults b/ports/espressif/esp-idf-config/sdkconfig-ble.defaults index 0260d9f53f..8180786fbf 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-ble.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-ble.defaults @@ -4,7 +4,161 @@ # # Bluetooth # -# CONFIG_BT_ENABLED is not set +CONFIG_BT_ENABLED=y +# +# Bluetooth controller +# +CONFIG_BT_CTRL_MODE_EFF=1 +CONFIG_BT_CTRL_BLE_MAX_ACT=10 +CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 +CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 +CONFIG_BT_CTRL_PINNED_TO_CORE=0 +CONFIG_BT_CTRL_HCI_MODE_VHCI=y +# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set +CONFIG_BT_CTRL_HCI_TL=1 +CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 +# CONFIG_BT_CTRL_HW_CCA is not set +CONFIG_BT_CTRL_HW_CCA_VAL=20 +CONFIG_BT_CTRL_HW_CCA_EFF=0 +CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y +# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set +# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set +CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 +CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y +# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set +CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 +CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y +# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set +CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N27 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=10 +CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +# CONFIG_BT_CTRL_BLE_SCAN_DUPL is not set +# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set +CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y +CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 +# +# MODEM SLEEP Options +# +# CONFIG_BT_CTRL_MODEM_SLEEP is not set +# end of MODEM SLEEP Options + +CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 +CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 +CONFIG_BT_CTRL_HCI_TL_EFF=1 +# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set +# end of Bluetooth controller + +# CONFIG_BT_BLUEDROID_ENABLED is not set +CONFIG_BT_NIMBLE_ENABLED=y +# CONFIG_BT_CONTROLLER_ONLY is not set +# +# NimBLE Options +# +CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y +# CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set +# CONFIG_BT_NIMBLE_LOG_LEVEL_NONE is not set +# CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR is not set +# CONFIG_BT_NIMBLE_LOG_LEVEL_WARNING is not set +CONFIG_BT_NIMBLE_LOG_LEVEL_INFO=y +# CONFIG_BT_NIMBLE_LOG_LEVEL_DEBUG is not set +CONFIG_BT_NIMBLE_LOG_LEVEL=1 +CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3 +CONFIG_BT_NIMBLE_MAX_BONDS=3 +CONFIG_BT_NIMBLE_MAX_CCCDS=8 +CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=0 +CONFIG_BT_NIMBLE_TASK_STACK_SIZE=4096 +CONFIG_BT_NIMBLE_ROLE_CENTRAL=y +CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y +CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y +CONFIG_BT_NIMBLE_ROLE_OBSERVER=y +CONFIG_BT_NIMBLE_NVS_PERSIST=y +CONFIG_BT_NIMBLE_SM_LEGACY=y +CONFIG_BT_NIMBLE_SM_SC=y +# CONFIG_BT_NIMBLE_DEBUG is not set +# CONFIG_BT_NIMBLE_SM_SC_DEBUG_KEYS is not set +CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="nimble" +CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 +CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=256 +CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0 +CONFIG_BT_NIMBLE_ACL_BUF_COUNT=20 +CONFIG_BT_NIMBLE_ACL_BUF_SIZE=255 +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_BT_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 +CONFIG_BT_NIMBLE_HCI_EVT_LO_BUF_COUNT=8 +CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT=12 +# CONFIG_BT_NIMBLE_HS_FLOW_CTRL is not set +CONFIG_BT_NIMBLE_RPA_TIMEOUT=900 +# CONFIG_BT_NIMBLE_MESH is not set +CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS=y +CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS=2000 +# CONFIG_BT_NIMBLE_HOST_BASED_PRIVACY is not set +CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=y +CONFIG_BT_NIMBLE_MAX_CONN_REATTEMPT=3 +CONFIG_BT_NIMBLE_EXT_ADV=y +CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=1 +CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN=1650 +CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV=y +CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS=1 +# CONFIG_BT_NIMBLE_BLUFI_ENABLE is not set +CONFIG_BT_NIMBLE_USE_ESP_TIMER=y +# end of NimBLE Options + # end of Bluetooth # end of Component config + +# +# Deprecated options for backward compatibility +# +# CONFIG_BLUEDROID_ENABLED is not set +CONFIG_NIMBLE_ENABLED=y +CONFIG_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y +# CONFIG_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set +CONFIG_NIMBLE_MAX_CONNECTIONS=3 +CONFIG_NIMBLE_MAX_BONDS=3 +CONFIG_NIMBLE_MAX_CCCDS=8 +CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=0 +CONFIG_NIMBLE_TASK_STACK_SIZE=4096 +CONFIG_NIMBLE_ROLE_CENTRAL=y +CONFIG_NIMBLE_ROLE_PERIPHERAL=y +CONFIG_NIMBLE_ROLE_BROADCASTER=y +CONFIG_NIMBLE_ROLE_OBSERVER=y +CONFIG_NIMBLE_NVS_PERSIST=y +CONFIG_NIMBLE_SM_LEGACY=y +CONFIG_NIMBLE_SM_SC=y +# CONFIG_NIMBLE_DEBUG is not set +# CONFIG_NIMBLE_SM_SC_DEBUG_KEYS is not set +CONFIG_NIMBLE_SVC_GAP_DEVICE_NAME="nimble" +CONFIG_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 +CONFIG_NIMBLE_ATT_PREFERRED_MTU=256 +CONFIG_NIMBLE_SVC_GAP_APPEARANCE=0 +CONFIG_NIMBLE_ACL_BUF_COUNT=20 +CONFIG_NIMBLE_ACL_BUF_SIZE=255 +CONFIG_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 +CONFIG_NIMBLE_HCI_EVT_LO_BUF_COUNT=8 +CONFIG_NIMBLE_MSYS1_BLOCK_COUNT=12 +# CONFIG_NIMBLE_HS_FLOW_CTRL is not set +CONFIG_NIMBLE_RPA_TIMEOUT=900 +# CONFIG_NIMBLE_MESH is not set +CONFIG_NIMBLE_CRYPTO_STACK_MBEDTLS=y +CONFIG_SW_COEXIST_ENABLE=y +# end of Deprecated options for backward compatibility diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults new file mode 100644 index 0000000000..6d949c2898 --- /dev/null +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults @@ -0,0 +1,171 @@ +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 +# +# SDK tool configuration +# +CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" +# end of SDK tool configuration + +# +# Bootloader config +# +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +# end of Bootloader config + +# +# Component config +# +# +# ESP32-specific +# +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_NO_BLOBS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific + +# +# Hardware Settings +# +# +# MAC Config +# +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +# end of Sleep Config + +# end of Hardware Settings + +# +# ESP System Settings +# +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +# end of ESP System Settings + +# +# Ethernet +# +CONFIG_ETH_USE_ESP32_EMAC=n + +# +# Wi-Fi +# +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +# end of Wi-Fi + +# +# FreeRTOS +# +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +# end of FreeRTOS + +# end of Component config + +# +# Deprecated options for backward compatibility +# +CONFIG_TOOLPREFIX="xtensa-esp32-elf-" +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +CONFIG_ESP_SYSTEM_PD_FLASH=y +# CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_ESP32_REDUCE_PHY_TX_POWER=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of Deprecated options for backward compatibility diff --git a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults index b00d04770f..e9b91113d5 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults @@ -14,36 +14,44 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_COMPILER_OPTIMIZATION_NONE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=1 # CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set # end of Compiler options # # Component config # +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +# end of ESP32S3-Specific + # # Common ESP-related # -CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set # end of Common ESP-related # # ESP System Settings # -CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set # CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set -# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set -CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set +# CONFIG_ESP_CONSOLE_USB_CDC is not set +# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_NONE is not set -CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_NONE=y +# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set +CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y -CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_CONSOLE_UART_NUM=-1 # end of ESP System Settings # @@ -62,8 +70,7 @@ CONFIG_FREERTOS_DEBUG_OCDAWARE=y CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y # CONFIG_HAL_ASSERTION_DISABLE is not set # CONFIG_HAL_ASSERTION_SILIENT is not set -# CONFIG_HAL_ASSERTION_ENABLE is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=1 # end of Hardware Abstraction Layer (HAL) and Low Level (LL) # @@ -79,17 +86,16 @@ CONFIG_LWIP_ESP_LWIP_ASSERT=y # # CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set +CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y # CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -CONFIG_ESP32S2_PANIC_PRINT_HALT=y +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=1 +# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set # CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set -# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y # CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_DEFAULT is not set # CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_CONSOLE_UART_NONE=y +CONFIG_CONSOLE_UART_NUM=-1 # end of Deprecated options for backward compatibility diff --git a/ports/espressif/esp-idf-config/sdkconfig.defaults b/ports/espressif/esp-idf-config/sdkconfig.defaults index 9ad89d4811..5fb49faa82 100644 --- a/ports/espressif/esp-idf-config/sdkconfig.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig.defaults @@ -54,25 +54,37 @@ CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # # Security features # +CONFIG_SECURE_BOOT_SUPPORTS_RSA=y +CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features +# +# Boot ROM Behavior +# +CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y +# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set +# end of Boot ROM Behavior + # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -96,10 +108,10 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # # Partition Table # -CONFIG_PARTITION_TABLE_SINGLE_APP=y +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set -# CONFIG_PARTITION_TABLE_CUSTOM is not set +CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -130,6 +142,7 @@ CONFIG_APPTRACE_DEST_NONE=y CONFIG_APPTRACE_LOCK_ENABLE=y # end of Application Level Tracing +# CONFIG_BLE_MESH is not set # # Driver configurations # @@ -159,10 +172,6 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set -# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set -# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # end of TWAI configuration # @@ -171,18 +180,6 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration -# -# RTCIO configuration -# -# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set -# end of RTCIO configuration - -# -# GPIO Configuration -# -# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set -# end of GPIO Configuration - # # GDMA Configuration # @@ -197,45 +194,24 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set -CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set -CONFIG_EFUSE_MAX_BLK_LEN=192 +CONFIG_EFUSE_MAX_BLK_LEN=256 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS -# -# ADC-Calibration -# -CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y -CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CAL_LUT_ENABLE=y -# end of ADC-Calibration - # # Ethernet # -CONFIG_ETH_ENABLED=y -CONFIG_ETH_USE_ESP32_EMAC=y -CONFIG_ETH_PHY_INTERFACE_RMII=y -CONFIG_ETH_RMII_CLK_INPUT=y -# CONFIG_ETH_RMII_CLK_OUTPUT is not set -CONFIG_ETH_RMII_CLK_IN_GPIO=0 -CONFIG_ETH_DMA_BUFFER_SIZE=512 -CONFIG_ETH_DMA_RX_BUFFER_NUM=10 -CONFIG_ETH_DMA_TX_BUFFER_NUM=10 # CONFIG_ETH_USE_SPI_ETHERNET is not set # CONFIG_ETH_USE_OPENETH is not set # end of Ethernet @@ -264,9 +240,16 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y # Sleep Config # CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set # end of Sleep Config +# +# RTC Clock Config +# +CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y +# end of RTC Clock Config + # end of Hardware Settings # @@ -283,7 +266,7 @@ CONFIG_ESP_IPC_ISR_ENABLE=y CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 CONFIG_ESP_NETIF_TCPIP_LWIP=y # CONFIG_ESP_NETIF_LOOPBACK is not set -CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y +# CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER is not set # end of ESP NETIF Adapter # @@ -293,34 +276,32 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 -CONFIG_ESP_PHY_REDUCE_TX_POWER=y # end of PHY # # Power Management # # CONFIG_PM_ENABLE is not set +CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # # ESP System Settings # # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 CONFIG_ESP_INT_WDT_CHECK_CPU1=y -CONFIG_ESP_TASK_WDT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_TASK_WDT is not set # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y # end of ESP System Settings @@ -333,15 +314,16 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -# CONFIG_ESP_TIMER_IMPL_FRC2 is not set -CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +CONFIG_ESP_TIMER_IMPL_SYSTIMER=y # end of High resolution timer (esp_timer) # # Wi-Fi # # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set +# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # end of Wi-Fi @@ -358,6 +340,10 @@ CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y # FreeRTOS # CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y +CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y +# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set +CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y CONFIG_FREERTOS_HZ=100 # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -380,7 +366,6 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set -# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -593,6 +578,7 @@ CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="certificates/nina-fw/data/roots.p CONFIG_MBEDTLS_ECP_RESTARTABLE=y CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -743,6 +729,7 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -763,6 +750,7 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -795,8 +783,6 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set -# CONFIG_WPA_MBO_SUPPORT is not set -# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -840,41 +826,18 @@ CONFIG_STACK_CHECK_NONE=y # CONFIG_WARN_WRITE_STRINGS is not set # CONFIG_DISABLE_GCC8_WARNINGS is not set CONFIG_ADC2_DISABLE_DAC=y -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ULP_COPROC_ENABLED is not set -CONFIG_ULP_COPROC_RESERVE_MEM=0 -CONFIG_BROWNOUT_DET=y -CONFIG_BROWNOUT_DET_LVL_SEL_0=y -# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set -CONFIG_BROWNOUT_DET_LVL=0 -# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set -# CONFIG_NO_BLOBS is not set -# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set -CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y -CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 CONFIG_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3584 -CONFIG_CONSOLE_UART=y +CONFIG_MAIN_TASK_STACK_SIZE=8192 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_TASK_WDT is not set CONFIG_TIMER_TASK_STACK_SIZE=3584 # CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set CONFIG_TIMER_TASK_PRIORITY=1 diff --git a/ports/espressif/modules/esp32_pico_mini_02.c b/ports/espressif/modules/esp32_pico_mini_02.c new file mode 100644 index 0000000000..e115ca27e0 --- /dev/null +++ b/ports/espressif/modules/esp32_pico_mini_02.c @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash + common_hal_never_reset_pin(&pin_GPIO6); + common_hal_never_reset_pin(&pin_GPIO11); + + // PSRAM + common_hal_never_reset_pin(&pin_GPIO9); + common_hal_never_reset_pin(&pin_GPIO10); +} diff --git a/ports/espressif/modules/esp32s2_wroom.c b/ports/espressif/modules/esp32s2_wroom.c new file mode 100644 index 0000000000..5e530701bf --- /dev/null +++ b/ports/espressif/modules/esp32s2_wroom.c @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} diff --git a/ports/espressif/modules/esp32s2_wrover.c b/ports/espressif/modules/esp32s2_wrover.c new file mode 100644 index 0000000000..23fa7ee5ca --- /dev/null +++ b/ports/espressif/modules/esp32s2_wrover.c @@ -0,0 +1,38 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} diff --git a/ports/espressif/modules/esp32s3_wroom.c b/ports/espressif/modules/esp32s3_wroom.c new file mode 100644 index 0000000000..5e530701bf --- /dev/null +++ b/ports/espressif/modules/esp32s3_wroom.c @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} diff --git a/ports/espressif/modules/esp32s3_wrover.c b/ports/espressif/modules/esp32s3_wrover.c new file mode 100644 index 0000000000..23fa7ee5ca --- /dev/null +++ b/ports/espressif/modules/esp32s3_wrover.c @@ -0,0 +1,38 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} diff --git a/ports/espressif/mpconfigport.h b/ports/espressif/mpconfigport.h index f390112387..72a9b32478 100644 --- a/ports/espressif/mpconfigport.h +++ b/ports/espressif/mpconfigport.h @@ -53,11 +53,13 @@ // Nearly all boards have this because it is used to enter the ROM bootloader. #ifndef CIRCUITPY_BOOT_BUTTON -#ifdef CONFIG_IDF_TARGET_ESP32C3 -#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) -#else -#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#endif + #ifdef CONFIG_IDF_TARGET_ESP32C3 + #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + #else + #ifndef CONFIG_IDF_TARGET_ESP32 + #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + #endif + #endif #endif #define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x9000) diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 69b732e097..834bd3c248 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -36,6 +36,10 @@ CIRCUITPY_MODULE ?= none ifeq ($(IDF_TARGET),esp32) CIRCUITPY_BLEIO = 0 CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_IMAGECAPTURE = 0 +CIRCUITPY_PARALLELDISPLAY = 0 +# Protomatter needs to support ESP32. +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_USB = 0 else ifeq ($(IDF_TARGET),esp32c3) diff --git a/ports/espressif/mphalport.c b/ports/espressif/mphalport.c index 39b080fba3..76d2c05cc3 100644 --- a/ports/espressif/mphalport.c +++ b/ports/espressif/mphalport.c @@ -28,7 +28,9 @@ #include "py/mphal.h" #include "supervisor/cpu.h" -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#include "components/esp_rom/include/esp32/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #include "components/esp_rom/include/esp32c3/rom/ets_sys.h" #elif defined(CONFIG_IDF_TARGET_ESP32S2) #include "components/esp_rom/include/esp32s2/rom/ets_sys.h" diff --git a/ports/espressif/peripherals/esp32/pins.c b/ports/espressif/peripherals/esp32/pins.c new file mode 100644 index 0000000000..9bf00a0e56 --- /dev/null +++ b/ports/espressif/peripherals/esp32/pins.c @@ -0,0 +1,69 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "peripherals/pins.h" + +const mcu_pin_obj_t pin_GPIO0 = PIN(0, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH_PAD_NUM1); +const mcu_pin_obj_t pin_GPIO1 = PIN(1, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO2 = PIN(2, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH_PAD_NUM2); +const mcu_pin_obj_t pin_GPIO3 = PIN(3, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO4 = PIN(4, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH_PAD_NUM0); +const mcu_pin_obj_t pin_GPIO5 = PIN(5, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO6 = PIN(6, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO7 = PIN(7, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO8 = PIN(8, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO9 = PIN(9, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO10 = PIN(10, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO11 = PIN(11, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO12 = PIN(12, ADC_UNIT_2, ADC_CHANNEL_5, TOUCH_PAD_NUM5); +const mcu_pin_obj_t pin_GPIO13 = PIN(13, ADC_UNIT_2, ADC_CHANNEL_4, TOUCH_PAD_NUM4); +const mcu_pin_obj_t pin_GPIO14 = PIN(14, ADC_UNIT_2, ADC_CHANNEL_6, TOUCH_PAD_NUM6); +const mcu_pin_obj_t pin_GPIO15 = PIN(15, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH_PAD_NUM3); +const mcu_pin_obj_t pin_GPIO16 = PIN(16, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO17 = PIN(17, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO18 = PIN(18, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO19 = PIN(19, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +// GPIO20 not exposed on some packages, but available in some modules +const mcu_pin_obj_t pin_GPIO20 = PIN(20, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO21 = PIN(21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO22 = PIN(22, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO23 = PIN(23, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +// no GPIO24 +const mcu_pin_obj_t pin_GPIO25 = PIN(25, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO26 = PIN(26, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO27 = PIN(27, ADC_UNIT_2, ADC_CHANNEL_7, TOUCH_PAD_NUM7); +// no GPIO28 +// no GPIO29 +// no GPIO30 +// no GPIO31 +const mcu_pin_obj_t pin_GPIO32 = PIN(32, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM9); +const mcu_pin_obj_t pin_GPIO33 = PIN(33, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM8); +const mcu_pin_obj_t pin_GPIO34 = PIN(34, ADC_UNIT_1, ADC_CHANNEL_6, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO35 = PIN(35, ADC_UNIT_1, ADC_CHANNEL_7, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO36 = PIN(36, ADC_UNIT_1, ADC_CHANNEL_0, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO37 = PIN(37, ADC_UNIT_1, ADC_CHANNEL_1, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO38 = PIN(38, ADC_UNIT_1, ADC_CHANNEL_2, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO39 = PIN(39, ADC_UNIT_1, ADC_CHANNEL_3, NO_TOUCH_CHANNEL); diff --git a/ports/espressif/peripherals/esp32/pins.h b/ports/espressif/peripherals/esp32/pins.h new file mode 100644 index 0000000000..6ec7c624a0 --- /dev/null +++ b/ports/espressif/peripherals/esp32/pins.h @@ -0,0 +1,111 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// DO NOT include this file directly. +// Use shared-bindings/microcontroller/Pin.h instead. +// This ensures that all necessary includes are already included. + +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32_PINS_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32_PINS_H + +#define GPIO0_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO19; +// GPIO20 not exposed on some packages, but available in some modules +#define GPIO20_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO21; +#define GPIO22_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO22; +#define GPIO23_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO23; +// no GPIO24 +#define GPIO25_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO25; +#define GPIO26_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO26; +#define GPIO27_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO27; +// no GPIO28 +// no GPIO29 +// no GPIO30 +// no GPIO31 +#define GPIO32_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO32; +#define GPIO33_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO33; +#define GPIO34_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO34; +#define GPIO35_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO35; +#define GPIO36_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO36; +#define GPIO37_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO37; +#define GPIO38_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO38; +#define GPIO39_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO39; + +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32_PINS_H diff --git a/ports/espressif/peripherals/esp32c3/pins.h b/ports/espressif/peripherals/esp32c3/pins.h index 3cce2763c6..9f55768825 100644 --- a/ports/espressif/peripherals/esp32c3/pins.h +++ b/ports/espressif/peripherals/esp32c3/pins.h @@ -31,27 +31,49 @@ #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32C3_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32C3_PINS_H +#define GPIO0_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO19; +#define GPIO20_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO21; #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32C3_PINS_H diff --git a/ports/espressif/peripherals/esp32s2/pins.h b/ports/espressif/peripherals/esp32s2/pins.h index b66db79861..cff6fea7cb 100644 --- a/ports/espressif/peripherals/esp32s2/pins.h +++ b/ports/espressif/peripherals/esp32s2/pins.h @@ -31,48 +31,91 @@ #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H +#define GPIO0_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO19; +#define GPIO20_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO21; +#define GPIO26_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO26; +#define GPIO27_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO27; +#define GPIO28_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO28; +#define GPIO29_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO29; +#define GPIO30_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO30; +#define GPIO31_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO31; +#define GPIO32_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO32; +#define GPIO33_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO33; +#define GPIO34_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO34; +#define GPIO35_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO35; +#define GPIO36_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO36; +#define GPIO37_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO37; +#define GPIO38_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO38; +#define GPIO39_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO39; +#define GPIO40_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO40; +#define GPIO41_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO41; +#define GPIO42_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO42; +#define GPIO43_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO43; +#define GPIO44_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO44; +#define GPIO45_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO45; +#define GPIO46_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO46; #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H diff --git a/ports/espressif/peripherals/esp32s3/pins.h b/ports/espressif/peripherals/esp32s3/pins.h index c2a932f572..7c0b8edd64 100644 --- a/ports/espressif/peripherals/esp32s3/pins.h +++ b/ports/espressif/peripherals/esp32s3/pins.h @@ -31,50 +31,95 @@ #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S3_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S3_PINS_H +#define GPIO0_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO19; +#define GPIO20_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO21; +#define GPIO26_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO26; +#define GPIO27_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO27; +#define GPIO28_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO28; +#define GPIO29_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO29; +#define GPIO30_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO30; +#define GPIO31_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO31; +#define GPIO32_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO32; +#define GPIO33_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO33; +#define GPIO34_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO34; +#define GPIO35_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO35; +#define GPIO36_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO36; +#define GPIO37_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO37; +#define GPIO38_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO38; +#define GPIO39_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO39; +#define GPIO40_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO40; +#define GPIO41_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO41; +#define GPIO42_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO42; +#define GPIO43_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO43; +#define GPIO44_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO44; +#define GPIO45_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO45; +#define GPIO46_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO46; +#define GPIO47_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO47; +#define GPIO48_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO48; #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S3_PINS_H diff --git a/ports/espressif/peripherals/pins.h b/ports/espressif/peripherals/pins.h index 4958c46410..9edad560c8 100644 --- a/ports/espressif/peripherals/pins.h +++ b/ports/espressif/peripherals/pins.h @@ -65,7 +65,9 @@ extern const mp_obj_type_t mcu_pin_type; } // Choose based on chip -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#include "esp32/pins.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #include "esp32c3/pins.h" #elif defined(CONFIG_IDF_TARGET_ESP32S2) #include "esp32s2/pins.h" diff --git a/ports/espressif/peripherals/touch.c b/ports/espressif/peripherals/touch.c index eeba49c683..e656bbddf1 100644 --- a/ports/espressif/peripherals/touch.c +++ b/ports/espressif/peripherals/touch.c @@ -48,9 +48,17 @@ void peripherals_touch_init(const touch_pad_t touchpad) { // touch_pad_config() must be done before touch_pad_fsm_start() the first time. // Otherwise the calibration is wrong and we get maximum raw values if there is // a trace of any significant length on the pin. + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_config(touchpad, 0); + #else touch_pad_config(touchpad); + #endif if (!touch_inited) { + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_sw_start(); + #else touch_pad_fsm_start(); + #endif touch_inited = true; } } diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 7ecdd140a2..b90e9d5712 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -78,7 +78,10 @@ #include "cam.h" #endif +#ifndef CONFIG_IDF_TARGET_ESP32 #include "soc/cache_memory.h" +#endif + #include "soc/rtc_cntl_reg.h" #include "esp_debug_helpers.h" @@ -91,6 +94,10 @@ // Heap sizes for when there is no external RAM for CircuitPython to use // exclusively. +#ifdef CONFIG_IDF_TARGET_ESP32 +// TODO: Determine better: 520kB of internal RAM; similar to 512kB for ESP32-S3. +#define HEAP_SIZE (176 * 1024) +#endif #ifdef CONFIG_IDF_TARGET_ESP32S2 #define HEAP_SIZE (48 * 1024) #endif diff --git a/ports/espressif/tools/build_memory_info.py b/ports/espressif/tools/build_memory_info.py index b26c007741..4f5304a288 100644 --- a/ports/espressif/tools/build_memory_info.py +++ b/ports/espressif/tools/build_memory_info.py @@ -15,6 +15,15 @@ from elftools.elf.elffile import ELFFile print() internal_memory = { + "esp32": [ + # Name, Start, Length + ("RTC Fast Memory", (0x3FF8_0000, 0x400C_0000), 8 * 1024), + ("RTC Slow Memory", (0x5000_0000,), 8 * 1024), + # First 64kB of Internal SRAM 0 can be configured as cached, and starts at 0x4007_0000 + ("Internal SRAM 0", (0x4008_0000,), 128 * 1024), + ("Internal SRAM 1", (0x3FFE_0000, 0x400A_0000), 128 * 1024), + ("Internal SRAM 2", (0x3FFA_E000,), 200 * 1024), + ], "esp32s2": [ # Name, Start, Length ("RTC Fast Memory", (0x3FF9_E000, 0x4007_0000), 8 * 1024), From 131d70cebd1697ff9199120f550e31832a67f140 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jun 2022 16:10:55 -0400 Subject: [PATCH 003/108] restore traceback to matrixportal build --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk index fdedf9bc9b..7178994d96 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -15,7 +15,6 @@ CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_SDCARDIO = 0 CIRCUITPY_SHARPDISPLAY = 0 -CIRCUITPY_TRACEBACK = 0 CIRCUITPY_ZLIB=0 # Include these Python libraries in firmware. From ca649505031f77a02ee3f7473fc7c14d131e0fb4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jun 2022 18:32:08 -0400 Subject: [PATCH 004/108] wip fixes --- ports/espressif/Makefile | 5 +++-- .../boards/adafruit_feather_esp32_v2/mpconfigboard.h | 3 +++ .../espressif/boards/adafruit_feather_esp32_v2/sdkconfig | 8 +------- ports/espressif/common-hal/alarm/touch/TouchAlarm.c | 4 ++-- ports/espressif/common-hal/microcontroller/Pin.c | 9 ++++++++- ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv | 4 ++-- ports/espressif/modules/esp32_pico_mini_02.c | 7 +++---- ports/espressif/tools/build_memory_info.py | 9 ++++++--- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index f713e942e6..3280ffa105 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -388,8 +388,9 @@ BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a endif +# BOOTLOADER_OFFSET is determined by chip type, based on the ROM bootloader, and is not changeable. ifeq ($(IDF_TARGET),esp32) -BOOTLOADER_OFFSET = 0x0 +BOOTLOADER_OFFSET = 0x1000 else ifeq ($(IDF_TARGET),esp32c3) BOOTLOADER_OFFSET = 0x0 else ifeq ($(IDF_TARGET),esp32s3) @@ -412,7 +413,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld $(B FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) -ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset +ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset --baud 460800 ifeq ($(UF2_BOOTLOADER),1) all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h index 886963028b..5a010cb5c7 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h @@ -46,3 +46,6 @@ // Explanation of how a user got into safe mode #define BOARD_USER_SAFE_MODE_ACTION translate("pressing SW38 button at start up.\n") + +#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO8) +#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO7) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index 94333353af..731ea37c4d 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -33,7 +33,7 @@ CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # # ESP32-specific # -# CONFIG_ESP32_SPIRAM_SUPPORT is not set +CONFIG_ESP32_SPIRAM_SUPPORT=y # end of ESP32-specific # @@ -43,9 +43,3 @@ CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" # end of LWIP # end of Component config - -# -# Deprecated options for backward compatibility -# -# CONFIG_SPIRAM_SUPPORT is not set -# end of Deprecated options for backward compatibility diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 0caeeea915..02f176cbf7 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -132,11 +132,11 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar #if defined(CONFIG_IDF_TARGET_ESP32) uint16_t touch_value; touch_pad_read(touch_channel, &touch_value); - touch_pad_set_thresh(touch_channel, touch_value * 0.1); // 10% + touch_pad_set_thresh(touch_channel, touch_value / 10); // 10% #else uint32_t touch_value; touch_pad_read_benchmark(touch_channel, &touch_value); - touch_pad_set_threshold(touch_channel, touch_value * 0.1); // 10% + touch_pad_set_thresh(touch_channel, touch_value / 10); // 10% #endif } } diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index 957ddd3492..995c281611 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -33,6 +33,10 @@ #include "components/driver/include/driver/gpio.h" #include "components/hal/include/hal/gpio_hal.h" +#include "esp_log.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + STATIC uint32_t never_reset_pins[2]; STATIC uint32_t in_use[2]; @@ -57,7 +61,7 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) { STATIC void _reset_pin(gpio_num_t pin_number) { // Never ever reset pins used for flash and RAM. #if defined(CONFIG_IDF_TARGET_ESP32) - if (pin_number == 6 || pin_number == 11 || pin_number == 9 || pin_number == 10) { + if (pin_number == 1 || pin_number == 6 || pin_number == 11 || pin_number == 9 || pin_number == 10 || pin_number == 17 || pin_number == 23) { return; } #elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) @@ -129,12 +133,15 @@ void common_hal_reset_pin(const mcu_pin_obj_t *pin) { } void reset_all_pins(void) { + ESP_LOGI("Pin.c", "reset_all_pins"); for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) { uint32_t iomux_address = GPIO_PIN_MUX_REG[i]; if (iomux_address == 0 || (never_reset_pins[i / 32] & (1 << i % 32)) != 0) { continue; } + ESP_LOGI("Pin.c", "about to reset pin %d", i); + vTaskDelay(100); _reset_pin(i); } in_use[0] = never_reset_pins[0]; diff --git a/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv b/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv index e7bfe0c51f..ba92d9fc73 100644 --- a/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv +++ b/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv @@ -4,6 +4,6 @@ # partition table,, 0x8000, 4K nvs, data, nvs, 0x9000, 20K, otadata, data, ota, 0xe000, 8K, -ota_0, 0, ota_0, 0x10000, 2048K, -ota_1, 0, ota_1, 0x210000, 2048K, +ota_0, app, ota_0, 0x10000, 2048K, +ota_1, app, ota_1, 0x210000, 2048K, user_fs, data, fat, 0x410000, 4032K, diff --git a/ports/espressif/modules/esp32_pico_mini_02.c b/ports/espressif/modules/esp32_pico_mini_02.c index e115ca27e0..e94c22dd0b 100644 --- a/ports/espressif/modules/esp32_pico_mini_02.c +++ b/ports/espressif/modules/esp32_pico_mini_02.c @@ -27,11 +27,10 @@ #include "modules/module.h" void never_reset_module_internal_pins(void) { - // SPI Flash + // SPI Flash and PSRAM common_hal_never_reset_pin(&pin_GPIO6); - common_hal_never_reset_pin(&pin_GPIO11); - - // PSRAM common_hal_never_reset_pin(&pin_GPIO9); common_hal_never_reset_pin(&pin_GPIO10); + common_hal_never_reset_pin(&pin_GPIO11); + } diff --git a/ports/espressif/tools/build_memory_info.py b/ports/espressif/tools/build_memory_info.py index 4f5304a288..df9d6a801e 100644 --- a/ports/espressif/tools/build_memory_info.py +++ b/ports/espressif/tools/build_memory_info.py @@ -82,9 +82,12 @@ with open(sys.argv[2], "r") as f: elif subtype == "ota_0": ota = partition[4].strip() size = app if ota is None else ota - if size[-1] not in ("k", "K"): - raise RuntimeError("Unhandled partition size suffix") - firmware_region = int(size[:-1]) * 1024 + if size[-1] in ("k", "K"): + firmware_region = int(size[:-1]) * 1024 + elif size[-1] in ("m", "M"): + firmware_region = int(size[:-1]) * 1024 * 1024 + else: + raise RuntimeError("Unhandled partition size suffix:", size[-1]) regions = dict((name, 0) for name, _, _ in internal_memory[target]) From 7608d90fcb4ffa0bb6919743915700a89e8c924e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 28 Jun 2022 18:42:03 -0500 Subject: [PATCH 005/108] Use arm-none-eabi-gcc-action --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a9bd65d8d..8dc31a3ff6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -287,12 +287,13 @@ jobs: fetch-depth: 1 - name: Get CP deps run: python tools/ci_fetch_deps.py ${{ matrix.board }} ${{ github.sha }} + - uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10-2020-q4' - name: Install dependencies run: | sudo apt-get install -y gettext pip install -r requirements-ci.txt -r requirements-dev.txt - wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - name: Versions run: | gcc --version @@ -487,8 +488,9 @@ jobs: pip install -r requirements-ci.txt -r requirements-dev.txt wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz - wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 + - uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10-2020-q4' - name: Install mkfs.fat run: | wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz From 780c4963cb7a216d7fb64b6f5aad6bfe33876fb2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jun 2022 23:06:49 -0400 Subject: [PATCH 006/108] wip; change never-ever reset pin mechanism --- ports/espressif/Makefile | 1 - ports/espressif/README.rst | 7 +- .../adafruit_esp32s2_camera/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../adafruit_feather_esp32s2/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../boards/adafruit_funhouse/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../adafruit_metro_esp32s2/mpconfigboard.mk | 2 +- .../adafruit_qtpy_esp32s2/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../boards/artisense_rd00/mpconfigboard.mk | 2 +- .../crumpspace_crumps2/mpconfigboard.mk | 2 +- .../electroniccats_bastwifi/mpconfigboard.mk | 2 +- .../espressif_hmi_devkit_1/mpconfigboard.mk | 2 +- .../espressif_kaluga_1.3/mpconfigboard.mk | 2 +- .../espressif_kaluga_1/mpconfigboard.mk | 2 +- .../espressif_saola_1_wroom/mpconfigboard.mk | 2 +- .../espressif_saola_1_wrover/mpconfigboard.mk | 2 +- .../franzininho_wifi_wroom/mpconfigboard.mk | 2 +- .../franzininho_wifi_wrover/mpconfigboard.mk | 2 +- .../gravitech_cucumber_m/mpconfigboard.mk | 2 +- .../gravitech_cucumber_ms/mpconfigboard.mk | 2 +- .../gravitech_cucumber_r/mpconfigboard.mk | 2 +- .../gravitech_cucumber_rs/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../boards/lilygo_ttgo_t8_s2/mpconfigboard.mk | 2 +- .../lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk | 2 +- .../boards/mixgo_ce_serial/mpconfigboard.mk | 2 +- .../boards/mixgo_ce_udisk/mpconfigboard.mk | 2 +- .../morpheans_morphesp-240/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../odt_pixelwing_esp32_s2/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../common-hal/microcontroller/Pin.c | 101 ++++++++++++------ ports/espressif/modules/esp32_pico_mini_02.c | 36 ------- ports/espressif/modules/esp32s2_wroom.c | 37 ------- ports/espressif/modules/esp32s2_wrover.c | 38 ------- ports/espressif/modules/esp32s3_wroom.c | 37 ------- ports/espressif/modules/esp32s3_wrover.c | 38 ------- ports/espressif/modules/module.h | 35 ------ ports/espressif/modules/none.c | 30 ------ ports/espressif/mpconfigport.mk | 7 +- ports/espressif/supervisor/port.c | 2 - 49 files changed, 117 insertions(+), 326 deletions(-) delete mode 100644 ports/espressif/modules/esp32_pico_mini_02.c delete mode 100644 ports/espressif/modules/esp32s2_wroom.c delete mode 100644 ports/espressif/modules/esp32s2_wrover.c delete mode 100644 ports/espressif/modules/esp32s3_wroom.c delete mode 100644 ports/espressif/modules/esp32s3_wrover.c delete mode 100644 ports/espressif/modules/module.h delete mode 100644 ports/espressif/modules/none.c diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 3280ffa105..0a8fdb36d5 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -247,7 +247,6 @@ SRC_C += \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ - modules/$(CIRCUITPY_MODULE).c \ shared/netutils/netutils.c \ peripherals/i2c.c \ peripherals/rmt.c \ diff --git a/ports/espressif/README.rst b/ports/espressif/README.rst index cea95dea04..949f3533ae 100644 --- a/ports/espressif/README.rst +++ b/ports/espressif/README.rst @@ -9,6 +9,7 @@ Support Status: .. csv-table:: :header: SoC, Status + ESP, "beta" ESP32-C3, "beta" ESP32-S2, "stable" ESP32-S3, "beta" @@ -20,13 +21,17 @@ How this port is organized: - **boards/** contains the configuration files for each development board and breakout available on the port. - **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. - **esp-idf/** contains the Espressif IoT Development Framework installation, including all the drivers for the port. -- **modules/** contains information specific to certain Espressif SoC based hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM. - **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. - **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. - **tools/** includes useful Python scripts for debugging and other purposes. At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled CircuitPython modules. +Connecting to the ESP32 +--------------------------------------- +The ESP32 chip itself has no USB support. On many boards there is a USB-serial adapter chip, such as a CP2102N, CP2104 or CH9102F, usually connected to the ESP32 TXD0 (GPIO1)and RXD0 (GPIO3) pins, for access to the bootloader. CircuitPython also uses this serial channel for the REPL. + + Connecting to the ESP32-C3 --------------------------------------- diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk index 724a85370d..7a352fc83c 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk index 9ec5919f54..a83269f3ac 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk @@ -14,4 +14,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 8MB -CIRCUITPY_MODULE = esp32_pico_mini_02 +CIRCUITPY_ESP_PSRAM = 1 diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk index b975aecd5e..407844ed4b 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk index c6d34efbd1..d939630dfd 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk @@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk index 38167546b9..7a2f3d3691 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk index 69f7dd09e0..6e4c716fe0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = qio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s3_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index 088dd9386c..0412fabed3 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s3_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk index aa1f5a40fb..961e3371bc 100644 --- a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk index a03c697931..beccc8275e 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk index 8bd07381d6..d293096e4b 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk index 2273fbe307..64cf3630bb 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk @@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk index 433c43f1ff..8c81c7bc6c 100644 --- a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk index 31fbf593ed..621b714156 100644 --- a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk +++ b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk index 8014d03bf1..4d4ae5de60 100644 --- a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk @@ -18,7 +18,7 @@ CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_APA102 = 1 -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 # Include these Python libraries in firmware. # FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk index 77de160464..99a75f1db4 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk +++ b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -18,4 +18,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk index 02395a4fa8..aedb03801b 100644 --- a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk index e261ad372d..5c0d16346d 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk index e261ad372d..5c0d16346d 100644 --- a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk index e24f540814..56b5a65eb8 100644 --- a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk index 38c74fd064..4442a577b6 100644 --- a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk index 2b5328ad31..53d1a4a846 100644 --- a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk index 8f7a39f117..5f5bd893cb 100644 --- a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk index 63b35234b7..04f713043f 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk index 8bfc6e1c02..b3421d59a1 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk index d044160804..c4b76ff756 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk index 02c1669434..d15530b48c 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk index 379b6f087e..68521578a7 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk index 1eed59fc41..5de3534e39 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk index 1738a22c0e..dc311d0558 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk index db600060d6..30ca08c176 100644 --- a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index 9917654502..3148b3ece7 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk index 2b5c7b7d39..4b4b69a347 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk index baf78ce4b8..f4a3560716 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk index 4a7ce7966c..800c55d57c 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk index 1ad615ef48..f00e1082ba 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk index 959161f193..08cce69957 100644 --- a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wroom +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk index d0f2c7304c..a668d5ae9c 100644 --- a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE = esp32s2_wrover +CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index 995c281611..c271ae8686 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -40,6 +40,73 @@ STATIC uint32_t never_reset_pins[2]; STATIC uint32_t in_use[2]; +// Bit mask of all pins that should never ever be reset. +// Typically these are SPI flash and PSRAM control pins, and communication pins. +static const uint64_t pin_mask_reset_forbidden = + #if defined(CONFIG_IDF_TARGET_ESP32) + // Never ever reset serial pins for bootloader and possibly USB-serial converter. + GPIO_SEL_1 | // TXD0 + GPIO_SEL_3 | // RXD0 + // Never ever reset pins used to communicate with SPI flash and PSRAM. + GPIO_SEL_6 | // CLK + GPIO_SEL_9 | // (PSRAM) SD2 + GPIO_SEL_10 | // (PSRAM) SD3 + GPIO_SEL_11 | // CMD + GPIO_SEL_16 | // SPIHD + GPIO_SEL_17 | // SPIDO + GPIO_SEL_18 | // SPIWP + GPIO_SEL_23 | // SPIDI + #endif // ESP32 + + #if defined(CONFIG_IDF_TARGET_ESP32C3) + // Never ever reset pins used to communicate with SPI flash. + GPIO_SEL_11 | // VDD_SPI + GPIO_SEL_12 | // SPIHD + GPIO_SEL_13 | // SPIWP + GPIO_SEL_14 | // SPICS0 + GPIO_SEL_15 | // SPICLK + GPIO_SEL_16 | // SPID + GPIO_SEL_17 | // SPIQ + #if CIRCUITPY_ESP_USB_SERIAL_JTAG + // Never ever reset serial/JTAG communication pins. + GPIO_SEL_18 | // USB D- + GPIO_SEL_19 | // USB D+ + #endif + #endif // ESP32C3 + + #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) + // Never ever reset pins used to communicate with SPI flash and PSRAM. + GPIO_SEL_19 | // USB D- + GPIO_SEL_20 | // USB D+ + #if CIRCUITPY_ESP_PSRAM + // Board uses PSRAM, and needs another chip select. + GPIO_SEL_26 | // SPICS1 + #endif + GPIO_SEL_27 | // SPIHD + GPIO_SEL_28 | // SPIWP + GPIO_SEL_29 | // SPICS0 + GPIO_SEL_30 | // SPICLK + GPIO_SEL_31 | // SPIHD + GPIO_SEL_32 | // SPIQ + #if defined(CONFIG_SPIRAM_MODE_OCT) + // Never reset octal SPI flash pins DQ4-DQ7 and DQS/DM. + GPIO_SEL_33 | // SPIIO4 + GPIO_SEL_34 | // SPIIO5 + GPIO_SEL_35 | // SPIIO6 + GPIO_SEL_36 | // SPIIO7 + GPIO_SEL_37 | // SPIDQS + #endif + #if CIRCUITPY_USB + // Never ever reset USB pins. + GPIO_SEL_19 | // USB D- + GPIO_SEL_20 | // USB D+ + #endif + #endif // ESP32S2, ESP32S3 + + 0; // Terminate last "|". + + + void never_reset_pin_number(gpio_num_t pin_number) { if (pin_number == NO_PIN) { return; @@ -59,40 +126,10 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) { } STATIC void _reset_pin(gpio_num_t pin_number) { - // Never ever reset pins used for flash and RAM. - #if defined(CONFIG_IDF_TARGET_ESP32) - if (pin_number == 1 || pin_number == 6 || pin_number == 11 || pin_number == 9 || pin_number == 10 || pin_number == 17 || pin_number == 23) { + // Never ever reset pins used for flash, RAM, and basic communication. + if (pin_mask_reset_forbidden & (((uint64_t)1) << pin_number)) { return; } - #elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) - // Never ever reset pins used for flash and RAM. - if (26 <= pin_number && pin_number <= 32) { - return; - } - #ifdef CONFIG_SPIRAM_MODE_OCT - // Octal DQ4-DQ7 and DQS/DM - if (33 <= pin_number && pin_number <= 37) { - return; - } - #endif - - #if CIRCUITPY_USB - // Never reset USB pins. - if (pin_number == 19 || pin_number == 20) { - return; - } - #endif - #elif defined(CONFIG_IDF_TARGET_ESP32C3) - // Never ever reset pins used for flash and RAM. - if (11 <= pin_number && pin_number <= 17) { - return; - } - #if CIRCUITPY_ESP_USB_SERIAL_JTAG - if (pin_number == 18 || pin_number == 19) { - return; - } - #endif - #endif // Give the board a chance to reset the pin in a particular way. if (espressif_board_reset_pin_number(pin_number)) { diff --git a/ports/espressif/modules/esp32_pico_mini_02.c b/ports/espressif/modules/esp32_pico_mini_02.c deleted file mode 100644 index e94c22dd0b..0000000000 --- a/ports/espressif/modules/esp32_pico_mini_02.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash and PSRAM - common_hal_never_reset_pin(&pin_GPIO6); - common_hal_never_reset_pin(&pin_GPIO9); - common_hal_never_reset_pin(&pin_GPIO10); - common_hal_never_reset_pin(&pin_GPIO11); - -} diff --git a/ports/espressif/modules/esp32s2_wroom.c b/ports/espressif/modules/esp32s2_wroom.c deleted file mode 100644 index 5e530701bf..0000000000 --- a/ports/espressif/modules/esp32s2_wroom.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} diff --git a/ports/espressif/modules/esp32s2_wrover.c b/ports/espressif/modules/esp32s2_wrover.c deleted file mode 100644 index 23fa7ee5ca..0000000000 --- a/ports/espressif/modules/esp32s2_wrover.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash and RAM - common_hal_never_reset_pin(&pin_GPIO26); - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} diff --git a/ports/espressif/modules/esp32s3_wroom.c b/ports/espressif/modules/esp32s3_wroom.c deleted file mode 100644 index 5e530701bf..0000000000 --- a/ports/espressif/modules/esp32s3_wroom.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} diff --git a/ports/espressif/modules/esp32s3_wrover.c b/ports/espressif/modules/esp32s3_wrover.c deleted file mode 100644 index 23fa7ee5ca..0000000000 --- a/ports/espressif/modules/esp32s3_wrover.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { - // SPI Flash and RAM - common_hal_never_reset_pin(&pin_GPIO26); - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} diff --git a/ports/espressif/modules/module.h b/ports/espressif/modules/module.h deleted file mode 100644 index 643cdc854e..0000000000 --- a/ports/espressif/modules/module.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -#ifndef MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H -#define MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H - -#include "shared-bindings/microcontroller/Pin.h" - -void never_reset_module_internal_pins(void); - -#endif // MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H diff --git a/ports/espressif/modules/none.c b/ports/espressif/modules/none.c deleted file mode 100644 index aa751bf3f4..0000000000 --- a/ports/espressif/modules/none.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "modules/module.h" - -void never_reset_module_internal_pins(void) { -} diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 834bd3c248..04bfd7e4c5 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -31,8 +31,6 @@ CIRCUITPY_WATCHDOG ?= 1 CIRCUITPY_ESPIDF ?= 1 -CIRCUITPY_MODULE ?= none - ifeq ($(IDF_TARGET),esp32) CIRCUITPY_BLEIO = 0 CIRCUITPY_BLEIO_HCI = 0 @@ -82,3 +80,8 @@ endif # only if something else is turned off, such as HID. USB_NUM_ENDPOINT_PAIRS = 7 USB_NUM_IN_ENDPOINTS = 5 + +#ifndef CIRCUITPY_ESP_PSRAM +#error CIRCUITPY_ESP_PSRAM must be specified in mpconfigboard.mk as 0 or 1. Use 1 if the board has PSRAM. +#endif +CFLAGS += -DCIRCUITPY_ESP_PSRAM=$(CIRCUITPY_ESP_PSRAM) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index b90e9d5712..38ca3573e6 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -29,7 +29,6 @@ #include #include "supervisor/board.h" #include "supervisor/port.h" -#include "modules/module.h" #include "py/runtime.h" #include "supervisor/esp_port.h" @@ -162,7 +161,6 @@ safe_mode_t port_init(void) { #endif heap = NULL; - never_reset_module_internal_pins(); #ifndef DEBUG #define DEBUG (0) From b0efd130c9a0134ae7927fcbfb41245393ea86eb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Jun 2022 23:19:36 -0400 Subject: [PATCH 007/108] ESP32 REPL working through debug UART --- ports/espressif/Makefile | 2 +- .../adafruit_feather_esp32_v2/sdkconfig | 1 + ports/espressif/common-hal/busio/UART.c | 4 +-- .../common-hal/microcontroller/Pin.c | 33 ++++++++----------- supervisor/shared/serial.c | 2 +- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 0a8fdb36d5..204802cb16 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -412,7 +412,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld $(B FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) -ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset --baud 460800 +ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset --baud 921600 ifeq ($(UF2_BOOTLOADER),1) all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index 731ea37c4d..94333b1591 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -34,6 +34,7 @@ CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # ESP32-specific # CONFIG_ESP32_SPIRAM_SUPPORT=y +CONFIG_UART_ISR_IN_IRAM=y # end of ESP32-specific # diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 0ca608a002..385307cc3e 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -75,8 +75,8 @@ static void uart_event_task(void *param) { void uart_reset(void) { for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { // Ignore the UART used by the IDF. - #ifdef CONFIG_CONSOLE_UART_NUM - if (num == CONFIG_CONSOLE_UART_NUM) { + #ifdef CONFIG_ESP_CONSOLE_UART_NUM + if (num == CONFIG_ESP_CONSOLE_UART_NUM) { continue; } #endif diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index c271ae8686..943386306f 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -33,12 +33,11 @@ #include "components/driver/include/driver/gpio.h" #include "components/hal/include/hal/gpio_hal.h" -#include "esp_log.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" +STATIC uint64_t never_reset_pins; +STATIC uint64_t in_use; -STATIC uint32_t never_reset_pins[2]; -STATIC uint32_t in_use[2]; +// 64-bit pin mask for a single bit +#define PIN_BIT(pin_number) (((uint64_t)1) << pin_number) // Bit mask of all pins that should never ever be reset. // Typically these are SPI flash and PSRAM control pins, and communication pins. @@ -111,7 +110,7 @@ void never_reset_pin_number(gpio_num_t pin_number) { if (pin_number == NO_PIN) { return; } - never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; + never_reset_pins |= PIN_BIT(pin_number); } void common_hal_never_reset_pin(const mcu_pin_obj_t *pin) { @@ -127,7 +126,7 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) { STATIC void _reset_pin(gpio_num_t pin_number) { // Never ever reset pins used for flash, RAM, and basic communication. - if (pin_mask_reset_forbidden & (((uint64_t)1) << pin_number)) { + if (pin_mask_reset_forbidden & PIN_BIT(pin_number)) { return; } @@ -152,8 +151,8 @@ void reset_pin_number(gpio_num_t pin_number) { if (pin_number == NO_PIN) { return; } - never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32); - in_use[pin_number / 32] &= ~(1 << pin_number % 32); + never_reset_pins &= ~PIN_BIT(pin_number); + in_use &= ~PIN_BIT(pin_number); _reset_pin(pin_number); } @@ -170,30 +169,26 @@ void common_hal_reset_pin(const mcu_pin_obj_t *pin) { } void reset_all_pins(void) { - ESP_LOGI("Pin.c", "reset_all_pins"); for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) { uint32_t iomux_address = GPIO_PIN_MUX_REG[i]; if (iomux_address == 0 || - (never_reset_pins[i / 32] & (1 << i % 32)) != 0) { + (never_reset_pins & PIN_BIT(i))) { continue; } - ESP_LOGI("Pin.c", "about to reset pin %d", i); - vTaskDelay(100); _reset_pin(i); } - in_use[0] = never_reset_pins[0]; - in_use[1] = never_reset_pins[1]; + in_use = never_reset_pins; } void claim_pin_number(gpio_num_t pin_number) { if (pin_number == NO_PIN) { return; } - in_use[pin_number / 32] |= (1 << (pin_number % 32)); + in_use |= PIN_BIT(pin_number); } void claim_pin(const mcu_pin_obj_t *pin) { - in_use[pin->number / 32] |= (1 << (pin->number % 32)); + claim_pin_number(pin->number); } void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) { @@ -201,9 +196,7 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) { } bool pin_number_is_free(gpio_num_t pin_number) { - uint8_t offset = pin_number / 32; - uint32_t mask = 1 << (pin_number % 32); - return (in_use[offset] & mask) == 0; + return in_use & PIN_BIT(pin_number); } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index af90fce4d7..6453a4a930 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -54,7 +54,7 @@ #include "py/mpprint.h" #include "shared-bindings/busio/UART.h" busio_uart_obj_t debug_uart; -byte buf_array[64]; +byte buf_array[256]; #endif #if CIRCUITPY_USB_VENDOR From 8bb369cac50a88a2622cf20429bd56b750502171 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 30 Jun 2022 20:42:30 -0400 Subject: [PATCH 008/108] refactor debug UART to console UART; get working on ESP32 --- ports/broadcom/mpconfigport.h | 4 +- .../adafruit_feather_esp32_v2/mpconfigboard.h | 5 +- .../ai_thinker_esp32-c3s-2m/mpconfigboard.h | 4 +- .../ai_thinker_esp32-c3s/mpconfigboard.h | 4 +- .../mpconfigboard.h | 4 +- .../boards/lilygo_ttgo_t-01c3/mpconfigboard.h | 4 +- .../lilygo_ttgo_t-oi-plus/mpconfigboard.h | 4 +- .../boards/microdev_micro_c3/mpconfigboard.h | 4 +- ports/espressif/common-hal/busio/UART.c | 18 ++-- ports/espressif/common-hal/busio/UART.h | 2 +- .../common-hal/microcontroller/Pin.c | 2 +- ports/espressif/supervisor/serial.c | 21 ++--- .../boards/imxrt1060_evk/mpconfigboard.h | 5 +- ports/mimxrt10xx/supervisor/serial.c | 6 +- ports/nrf/boards/microbit_v2/mpconfigboard.h | 5 +- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 4 +- py/circuitpy_mpconfig.h | 19 ++++- py/circuitpy_mpconfig.mk | 3 - supervisor/serial.h | 3 +- supervisor/shared/serial.c | 83 +++++++++---------- supervisor/shared/usb/tusb_config.h | 4 +- 21 files changed, 110 insertions(+), 98 deletions(-) diff --git a/ports/broadcom/mpconfigport.h b/ports/broadcom/mpconfigport.h index 4fce84c973..fc3966fc71 100644 --- a/ports/broadcom/mpconfigport.h +++ b/ports/broadcom/mpconfigport.h @@ -60,7 +60,7 @@ #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS -#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO14) -#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO15) +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15) #endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h index 5a010cb5c7..104fbfc86d 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h @@ -47,5 +47,6 @@ // Explanation of how a user got into safe mode #define BOARD_USER_SAFE_MODE_ACTION translate("pressing SW38 button at start up.\n") -#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO8) -#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO7) +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h index d7a81502fa..a42f8b0436 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h +++ b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h @@ -37,5 +37,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h index 0b8a3b0ae8..20fb1ff022 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h +++ b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h @@ -37,5 +37,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h index 69c4580aba..2b8ab21ad6 100644 --- a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h +++ b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h @@ -37,5 +37,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h index e0eebc9754..bbb8cff195 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h +++ b/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h @@ -6,5 +6,5 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO20) #define DEFAULT_UART_BUS_TX (&pin_GPIO21) -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h index eb3ff11932..26a30e07dd 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h @@ -6,5 +6,5 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO20) #define DEFAULT_UART_BUS_TX (&pin_GPIO21) -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h index e94f14c80b..f5bc8faf0b 100644 --- a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h +++ b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h @@ -44,5 +44,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 385307cc3e..740a327a47 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -50,8 +50,8 @@ static void uart_event_task(void *param) { if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) { switch (event.type) { case UART_PATTERN_DET: - // When the debug uart receives CTRL+C, wake the main task and schedule a keyboard interrupt - if (self->is_debug) { + // When the console uart receives CTRL+C, wake the main task and schedule a keyboard interrupt + if (self->is_console) { port_wake_main_task(); if (mp_interrupt_char == CHAR_CTRL_C) { uart_flush(self->uart_num); @@ -60,8 +60,8 @@ static void uart_event_task(void *param) { } break; case UART_DATA: - // When the debug uart receives any key, wake the main task - if (self->is_debug) { + // When the console uart receives any key, wake the main task + if (self->is_console) { port_wake_main_task(); } break; @@ -162,13 +162,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uart_set_mode(self->uart_num, mode) != ESP_OK) { mp_raise_RuntimeError(translate("UART init")); } - // On the debug uart, enable pattern detection to look for CTRL+C - #ifdef CIRCUITPY_DEBUG_UART_RX - if (rx == CIRCUITPY_DEBUG_UART_RX) { - self->is_debug = true; + + // On the console uart, enable pattern detection to look for CTRL+C + #if CIRCUITPY_CONSOLE_UART + if (rx == CIRCUITPY_CONSOLE_UART_RX) { + self->is_console = true; uart_enable_pattern_det_baud_intr(self->uart_num, CHAR_CTRL_C, 1, 1, 0, 0); } #endif + // Start a task to listen for uart events xTaskCreatePinnedToCore( uart_event_task, diff --git a/ports/espressif/common-hal/busio/UART.h b/ports/espressif/common-hal/busio/UART.h index cd2dcc4d57..4880346015 100644 --- a/ports/espressif/common-hal/busio/UART.h +++ b/ports/espressif/common-hal/busio/UART.h @@ -46,7 +46,7 @@ typedef struct { uint8_t character_bits; bool rx_error; uint32_t timeout_ms; - bool is_debug; + bool is_console; QueueHandle_t event_queue; TaskHandle_t event_task; } busio_uart_obj_t; diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index 943386306f..d2ccc897d4 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -196,7 +196,7 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) { } bool pin_number_is_free(gpio_num_t pin_number) { - return in_use & PIN_BIT(pin_number); + return !(in_use & PIN_BIT(pin_number)); } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { diff --git a/ports/espressif/supervisor/serial.c b/ports/espressif/supervisor/serial.c index 9a0ecee4df..7b0166f5b1 100644 --- a/ports/espressif/supervisor/serial.c +++ b/ports/espressif/supervisor/serial.c @@ -27,6 +27,10 @@ #include "py/mpconfig.h" #include "supervisor/serial.h" +#if CIRCUITPY_ESP_USB_SERIAL_JTAG && CIRCUITPY_CONSOLE_UART +#error CIRCUITPY_ESP_USB_SERIAL_JTAG and CIRCUITPY_CONSOLE_UART cannot both be enabled. +#endif + #if CIRCUITPY_ESP_USB_SERIAL_JTAG #include "supervisor/usb_serial_jtag.h" #endif @@ -37,14 +41,13 @@ void port_serial_init(void) { #endif } + bool port_serial_connected(void) { #if CIRCUITPY_ESP_USB_SERIAL_JTAG - if (usb_serial_jtag_connected()) { - return true; - } - #endif - + return usb_serial_jtag_connected(); + #else return false; + #endif } char port_serial_read(void) { @@ -58,12 +61,10 @@ char port_serial_read(void) { bool port_serial_bytes_available(void) { #if CIRCUITPY_ESP_USB_SERIAL_JTAG - if (usb_serial_jtag_bytes_available()) { - return true; - } - #endif - + return usb_serial_jtag_bytes_available(); + #else return false; + #endif } void port_serial_write_substring(const char *text, uint32_t length) { diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h b/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h index 8e026fa7ce..3b63172328 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h @@ -16,9 +16,8 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B1_07) #define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B1_06) -#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO_AD_B0_12) -#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO_AD_B0_13) - +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO_AD_B0_12) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO_AD_B0_13) // Put host on the first USB so that right angle OTG adapters can fit. This is // the right port when looking at the board. diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index 63f468beaf..cb557d36a8 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -33,9 +33,7 @@ #include "fsl_clock.h" #include "fsl_lpuart.h" -// TODO: Switch this to using DEBUG_UART. -// If the board defined a debug uart tx or rx pin then we enable this code -#if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX) +#if defined(CIRCUITPY_CONSOLE_UART) // static LPUART_Type *uart_instance = LPUART1; // evk static LPUART_Type *uart_instance = LPUART4; // feather 1011 // static LPUART_Type *uart_instance = LPUART2; // feather 1062 @@ -89,4 +87,4 @@ void port_serial_write_substring(const char *text, uint32_t len) { LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len); } -#endif // USE_DEBUG_PORT_CODE +#endif // CIRCUITPY_CONSOLE_UART diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.h b/ports/nrf/boards/microbit_v2/mpconfigboard.h index bae49dfae2..eba5af6c22 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.h +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.h @@ -52,5 +52,6 @@ #define BOOTLOADER_SETTING_SIZE (0) #define BOARD_HAS_32KHZ_XTAL (0) -#define CIRCUITPY_DEBUG_UART_TX (&pin_P0_06) -#define CIRCUITPY_DEBUG_UART_RX (&pin_P1_08) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_P0_06) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_P1_08) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index c4399f5a3d..bde2c3ec73 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,5 +46,5 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define CIRCUITPY_DEBUG_UART_TX (&pin_PD08) -#define CIRCUITPY_DEBUG_UART_RX (&pin_PD09) +#define CIRCUITPY_CONSOLE_UART_TX (&pin_PD08) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_PD09) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 752020bafc..c26e34aab9 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -198,10 +198,11 @@ typedef long mp_off_t; // extra built in names to add to the global namespace +// Not indented so as not to confused the editor. #define MICROPY_PORT_BUILTINS \ - { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, +{ MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ +{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ +{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, \ ////////////////////////////////////////////////////////////////////////////////////////////////// // board-specific definitions, which control and may override definitions below. @@ -296,6 +297,18 @@ typedef long mp_off_t; #define BOARD_UART_ROOT_POINTER mp_obj_t board_uart_bus; #endif +#if defined(CIRCUITPY_CONSOLE_UART_RX) || defined(CIRCUITPY_CONSOLE_UART_TX) +#if !(defined(CIRCUITPY_CONSOLE_UART_RX) && defined(CIRCUITPY_CONSOLE_UART_TX)) +#error Both CIRCUITPY_CONSOLE_UART_RX and CIRCUITPY_CONSOLE_UART_TX must be defined if one is defined. +#endif +#define CIRCUITPY_CONSOLE_UART (1) +#ifndef CIRCUITPY_CONSOLE_UART_BAUDRATE +#define CIRCUITPY_CONSOLE_UART_BAUDRATE (115200) +#endif +#else +#define CIRCUITPY_CONSOLE_UART (0) +#endif + // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 8505fe1cb7..4b1ff9cb67 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -168,9 +168,6 @@ CFLAGS += -DCIRCUITPY_OPT_LOAD_ATTR_FAST_PATH=$(CIRCUITPY_OPT_LOAD_ATTR_FAST_PAT CIRCUITPY_OPT_MAP_LOOKUP_CACHE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_OPT_MAP_LOOKUP_CACHE=$(CIRCUITPY_OPT_MAP_LOOKUP_CACHE) -CIRCUITPY_CONSOLE_UART ?= 0 -CFLAGS += -DCIRCUITPY_CONSOLE_UART=$(CIRCUITPY_CONSOLE_UART) - CIRCUITPY_COUNTIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) diff --git a/supervisor/serial.h b/supervisor/serial.h index a6646e9542..997a2bc38f 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -51,12 +51,13 @@ bool serial_connected(void); // These have no-op versions that are weak and the port can override. They work // in tandem with the cross-port mechanics like USB and BLE. +void port_serial_early_init(void); void port_serial_init(void); bool port_serial_connected(void); char port_serial_read(void); bool port_serial_bytes_available(void); void port_serial_write_substring(const char *text, uint32_t length); -int debug_uart_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +int console_uart_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); #endif // MICROPY_INCLUDED_SUPERVISOR_SERIAL_H diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 6453a4a930..7c9861dfec 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -45,42 +45,43 @@ #include "tusb.h" #endif -/* - * Note: DEBUG_UART currently only works on STM32 and nRF. - * Enabling on another platform will cause a crash. - */ - -#if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX) +#if CIRCUITPY_CONSOLE_UART #include "py/mpprint.h" #include "shared-bindings/busio/UART.h" -busio_uart_obj_t debug_uart; -byte buf_array[256]; + +busio_uart_obj_t console_uart; +// on Espressif, the receive buffer must be larger than the hardware FIFO length. See uart_driver_install(). +#if defined(SOC_UART_FIFO_LEN) +byte console_uart_rx_buf[SOC_UART_FIFO_LEN + 1]; +#else +byte console_uart_rx_buf[64]; +#endif #endif #if CIRCUITPY_USB_VENDOR bool tud_vendor_connected(void); #endif -#if defined(CIRCUITPY_DEBUG_UART_TX) -STATIC void debug_uart_print_strn(void *env, const char *str, size_t len) { +#if CIRCUITPY_CONSOLE_UART +STATIC void console_uart_print_strn(void *env, const char *str, size_t len) { (void)env; int uart_errcode; - common_hal_busio_uart_write(&debug_uart, (const uint8_t *)str, len, &uart_errcode); + common_hal_busio_uart_write(&console_uart, (const uint8_t *)str, len, &uart_errcode); } -const mp_print_t debug_uart_print = {NULL, debug_uart_print_strn}; +const mp_print_t console_uart_print = {NULL, console_uart_print_strn}; #endif -int debug_uart_printf(const char *fmt, ...) { - #if defined(CIRCUITPY_DEBUG_UART_TX) - // Skip prints that occur before debug serial is started. It's better than +int console_uart_printf(const char *fmt, ...) { + #if CIRCUITPY_CONSOLE_UART + // Skip prints that occur before console serial is started. It's better than // crashing. - if (common_hal_busio_uart_deinited(&debug_uart)) { + if (common_hal_busio_uart_deinited(&console_uart)) { return 0; } va_list ap; va_start(ap, fmt); - int ret = mp_vprintf(&debug_uart_print, fmt, ap); + int ret = mp_vprintf(&console_uart_print, fmt, ap); va_end(ap); return ret; #else @@ -88,6 +89,9 @@ int debug_uart_printf(const char *fmt, ...) { #endif } +MP_WEAK void port_serial_early_init(void) { +} + MP_WEAK void port_serial_init(void) { } @@ -109,29 +113,24 @@ MP_WEAK void port_serial_write_substring(const char *text, uint32_t length) { } void serial_early_init(void) { - #if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX) - debug_uart.base.type = &busio_uart_type; + // Set up console UART, if enabled. - #if defined(CIRCUITPY_DEBUG_UART_RX) - const mcu_pin_obj_t *rx = MP_OBJ_TO_PTR(CIRCUITPY_DEBUG_UART_RX); - #else - const mcu_pin_obj_t *rx = NULL; - #endif + #if CIRCUITPY_CONSOLE_UART + console_uart.base.type = &busio_uart_type; - #if defined(CIRCUITPY_DEBUG_UART_TX) - const mcu_pin_obj_t *tx = MP_OBJ_TO_PTR(CIRCUITPY_DEBUG_UART_TX); - #else - const mcu_pin_obj_t *tx = NULL; - #endif + const mcu_pin_obj_t *console_rx = MP_OBJ_TO_PTR(CIRCUITPY_CONSOLE_UART_RX); + const mcu_pin_obj_t *console_tx = MP_OBJ_TO_PTR(CIRCUITPY_CONSOLE_UART_TX); - common_hal_busio_uart_construct(&debug_uart, tx, rx, NULL, NULL, NULL, - false, 115200, 8, BUSIO_UART_PARITY_NONE, 1, 1.0f, 64, - buf_array, true); - common_hal_busio_uart_never_reset(&debug_uart); + common_hal_busio_uart_construct(&console_uart, console_tx, console_rx, NULL, NULL, NULL, + false, 115200, 8, BUSIO_UART_PARITY_NONE, 1, 1.0f, sizeof(console_uart_rx_buf), + console_uart_rx_buf, true); + common_hal_busio_uart_never_reset(&console_uart); // Do an initial print so that we can confirm the serial output is working. - debug_uart_printf("Serial debug setup\r\n"); + console_uart_printf("Serial console setup\r\n"); #endif + + port_serial_early_init(); } void serial_init(void) { @@ -145,7 +144,7 @@ bool serial_connected(void) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_TX) && defined(CIRCUITPY_DEBUG_UART_RX) + #if CIRCUITPY_CONSOLE_UART return true; #endif @@ -180,11 +179,11 @@ char serial_read(void) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_RX) - if (common_hal_busio_uart_rx_characters_available(&debug_uart)) { + #if CIRCUITPY_CONSOLE_UART + if (common_hal_busio_uart_rx_characters_available(&console_uart)) { int uart_errcode; char text; - common_hal_busio_uart_read(&debug_uart, (uint8_t *)&text, 1, &uart_errcode); + common_hal_busio_uart_read(&console_uart, (uint8_t *)&text, 1, &uart_errcode); return text; } #endif @@ -217,8 +216,8 @@ bool serial_bytes_available(void) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_RX) - if (common_hal_busio_uart_rx_characters_available(&debug_uart)) { + #if CIRCUITPY_CONSOLE_UART + if (common_hal_busio_uart_rx_characters_available(&console_uart)) { return true; } #endif @@ -261,10 +260,10 @@ void serial_write_substring(const char *text, uint32_t length) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_TX) + #if CIRCUITPY_CONSOLE_UART int uart_errcode; - common_hal_busio_uart_write(&debug_uart, (const uint8_t *)text, length, &uart_errcode); + common_hal_busio_uart_write(&console_uart, (const uint8_t *)text, length, &uart_errcode); #endif #if CIRCUITPY_SERIAL_BLE diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index 13b4367f47..c2ad1362a3 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -48,8 +48,8 @@ extern "C" { // COMMON CONFIGURATION // --------------------------------------------------------------------+ -// When debugging TinyUSB, only output to the UART debug link. -#if CIRCUITPY_DEBUG_TINYUSB > 0 && defined(CIRCUITPY_DEBUG_UART_TX) +// When debugging TinyUSB, only output to the console UART link. +#if CIRCUITPY_DEBUG_TINYUSB > 0 && defined(CIRCUITPY_CONSOLE_UART) #define CFG_TUSB_DEBUG CIRCUITPY_DEBUG_TINYUSB #define CFG_TUSB_DEBUG_PRINTF debug_uart_printf #endif From 6bcd75a391c3ddec5fc57911f94c05c96e0ebf07 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 1 Jul 2022 10:44:07 -0500 Subject: [PATCH 009/108] Add WiFi workflow to the section about branding --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 1f45007082..15cfb41829 100644 --- a/README.rst +++ b/README.rst @@ -90,9 +90,11 @@ If you'd like to use the term "CircuitPython" and Blinka for your product here i * Your product is listed on `circuitpython.org `__ (source `here `_). This is to ensure that a user of your product can always download the latest version of CircuitPython from the standard place. -* Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in - AND/OR provides file and serial access over Bluetooth Low Energy. Boards that do not support USB - should be clearly marked as BLE-only CircuitPython. +* Your product supports at least one standard "workflow" for serial and file access: + * With a user accessible USB plug which appears as a CIRCUITPY drive when plugged in. + * With file and serial access over Bluetooth Low Energy using the BLE Workflow. + * With file access over WiFi using the WiFi workflow, and serial access over USB. +* Boards that do not support the USB workflow should be clearly marked. If you choose not to meet these requirements, then we ask you call your version of CircuitPython something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is From a1fa1ad0d8049827981c8c422f507c4d028e081c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 30 Jun 2022 15:59:04 -0500 Subject: [PATCH 010/108] Always release displays during deep sleep Closes #6523 --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 17fe8167f2..015c4b512c 100644 --- a/main.c +++ b/main.c @@ -570,6 +570,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re else if (awoke_from_true_deep_sleep || port_get_raw_ticks(NULL) > CIRCUITPY_WORKFLOW_CONNECTION_SLEEP_DELAY * 1024) { // OK to start sleeping, real or fake. + #if CIRCUITPY_DISPLAYIO + common_hal_displayio_release_displays(); + #endif status_led_deinit(); deinit_rxtx_leds(); board_deinit(); From 7589e53fea04d2bada44b7729432a3ee2a9237a4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 29 Jun 2022 16:31:55 -0700 Subject: [PATCH 011/108] WIP websocket accept and hashlib --- locale/circuitpython.pot | 4 + ports/espressif/common-hal/hashlib/Hash.c | 52 +++++++++ ports/espressif/common-hal/hashlib/Hash.h | 41 +++++++ ports/espressif/common-hal/hashlib/__init__.c | 40 +++++++ ports/espressif/mpconfigport.mk | 1 + py/circuitpy_defns.mk | 5 + shared-bindings/hashlib/Hash.c | 103 ++++++++++++++++++ shared-bindings/hashlib/Hash.h | 43 ++++++++ shared-bindings/hashlib/__init__.c | 90 +++++++++++++++ shared-bindings/hashlib/__init__.h | 36 ++++++ .../shared/web_workflow/static/serial.html | 16 +++ .../shared/web_workflow/static/serial.js | 43 ++++++++ .../shared/web_workflow/static/welcome.html | 2 +- supervisor/shared/web_workflow/web_workflow.c | 40 +++++++ 14 files changed, 515 insertions(+), 1 deletion(-) create mode 100644 ports/espressif/common-hal/hashlib/Hash.c create mode 100644 ports/espressif/common-hal/hashlib/Hash.h create mode 100644 ports/espressif/common-hal/hashlib/__init__.c create mode 100644 shared-bindings/hashlib/Hash.c create mode 100644 shared-bindings/hashlib/Hash.h create mode 100644 shared-bindings/hashlib/__init__.c create mode 100644 shared-bindings/hashlib/__init__.h create mode 100644 supervisor/shared/web_workflow/static/serial.html create mode 100644 supervisor/shared/web_workflow/static/serial.js diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5740e1e288..a66a386f1d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2199,6 +2199,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/ports/espressif/common-hal/hashlib/Hash.c b/ports/espressif/common-hal/hashlib/Hash.c new file mode 100644 index 0000000000..8e2ab02edb --- /dev/null +++ b/ports/espressif/common-hal/hashlib/Hash.c @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/hashlib/Hash.h" + +#include "components/mbedtls/mbedtls/include/mbedtls/ssl.h" + +void common_hal_hashlib_hash_update(hashlib_hash_obj_t *self, const uint8_t *data, size_t datalen) { + if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + mbedtls_sha1_update_ret(&self->sha1, data, datalen); + return; + } +} + +void common_hal_hashlib_hash_digest(hashlib_hash_obj_t *self, uint8_t *data, size_t datalen) { + if (datalen < common_hal_hashlib_hash_get_digest_size(self)) { + return; + } + if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + mbedtls_sha1_finish_ret(&self->sha1, data); + } +} + +size_t common_hal_hashlib_hash_get_digest_size(hashlib_hash_obj_t *self) { + if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + return 20; + } + return 0; +} diff --git a/ports/espressif/common-hal/hashlib/Hash.h b/ports/espressif/common-hal/hashlib/Hash.h new file mode 100644 index 0000000000..ece282833e --- /dev/null +++ b/ports/espressif/common-hal/hashlib/Hash.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_HASHLIB_HASH_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_HASHLIB_HASH_H + +#include "components/mbedtls/mbedtls/include/mbedtls/sha1.h" + +typedef struct { + mp_obj_base_t base; + union { + mbedtls_sha1_context sha1; + }; + // Of MBEDTLS_SSL_HASH_* + uint8_t hash_type; +} hashlib_hash_obj_t; + +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_HASHLIB_HASH_H diff --git a/ports/espressif/common-hal/hashlib/__init__.c b/ports/espressif/common-hal/hashlib/__init__.c new file mode 100644 index 0000000000..1e6b2a4802 --- /dev/null +++ b/ports/espressif/common-hal/hashlib/__init__.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/hashlib/__init__.h" + +#include "components/mbedtls/mbedtls/include/mbedtls/ssl.h" + + +bool common_hal_hashlib_new(hashlib_hash_obj_t *self, const char *algorithm) { + if (strcmp(algorithm, "sha1") == 0) { + self->hash_type = MBEDTLS_SSL_HASH_SHA1; + mbedtls_sha1_init(&self->sha1); + mbedtls_sha1_starts_ret(&self->sha1); + return true; + } + return false; +} diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 2eeb86e49d..ddaa4836d3 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -19,6 +19,7 @@ CIRCUITPY_COUNTIO ?= 1 CIRCUITPY_DUALBANK ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_FREQUENCYIO ?= 1 +CIRCUITPY_HASHLIB ?= 1 CIRCUITPY_IMAGECAPTURE ?= 1 CIRCUITPY_I2CPERIPHERAL ?= 1 CIRCUITPY_RGBMATRIX ?= 1 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c5c89ab19f..af49c876ba 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -207,6 +207,9 @@ endif ifeq ($(CIRCUITPY_GNSS),1) SRC_PATTERNS += gnss/% endif +ifeq ($(CIRCUITPY_HASHLIB),1) +SRC_PATTERNS += hashlib/% +endif ifeq ($(CIRCUITPY_I2CPERIPHERAL),1) SRC_PATTERNS += i2cperipheral/% endif @@ -419,6 +422,8 @@ SRC_COMMON_HAL_ALL = \ gnss/GNSS.c \ gnss/PositionFix.c \ gnss/SatelliteSystem.c \ + hashlib/__init__.c \ + hashlib/Hash.c \ i2cperipheral/I2CPeripheral.c \ i2cperipheral/__init__.c \ microcontroller/Pin.c \ diff --git a/shared-bindings/hashlib/Hash.c b/shared-bindings/hashlib/Hash.c new file mode 100644 index 0000000000..5dab05fa10 --- /dev/null +++ b/shared-bindings/hashlib/Hash.c @@ -0,0 +1,103 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/hashlib/Hash.h" + +// #include "shared-bindings/util.h" + +// #include "shared/runtime/buffer_helper.h" +// #include "shared/runtime/interrupt_char.h" + +// #include "py/mperrno.h" +// #include "py/mphal.h" +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/objstr.h" +#include "py/runtime.h" + +//| class Hash: +//| """In progress hash algorithm. This object is always created by a `hashlib.new()`. It has no +//| user-visible constructor.""" +//| + +//| digest_size: int +//| """Digest size in bytes""" +//| +STATIC mp_obj_t hashlib_hash_get_digest_size(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type)); + hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_hashlib_hash_get_digest_size(self)); +} +MP_PROPERTY_GETTER(hashlib_hash_digest_size_obj, hashlib_hash_get_digest_size); + +//| def update(self, data: ReadableBuffer) -> None: +//| """Update the hash with the given bytes. +//| +//| :param ~circuitpython_typing.ReadableBuffer data: Update the hash from data in this buffer""" +//| ... +//| +mp_obj_t hashlib_hash_update(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type)); + hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + + common_hal_hashlib_hash_update(self, bufinfo.buf, bufinfo.len); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(hashlib_hash_update_obj, hashlib_hash_update); + +//| def digest(self) -> bytes: +//| """Returns the current digest as bytes() with a length of `hashlib.Hash.digest_size`.""" +//| ... +//| +STATIC mp_obj_t hashlib_hash_digest(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type)); + hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in); + + size_t size = common_hal_hashlib_hash_get_digest_size(self); + mp_obj_t obj = mp_obj_new_bytes_of_zeros(size); + mp_obj_str_t *o = MP_OBJ_TO_PTR(obj); + + common_hal_hashlib_hash_digest(self, (uint8_t *)o->data, size); + return obj; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(hashlib_hash_digest_obj, hashlib_hash_digest); + +STATIC const mp_rom_map_elem_t hashlib_hash_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_PTR(&hashlib_hash_digest_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&hashlib_hash_update_obj) }, + { MP_ROM_QSTR(MP_QSTR_digest), MP_ROM_PTR(&hashlib_hash_digest_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(hashlib_hash_locals_dict, hashlib_hash_locals_dict_table); + +const mp_obj_type_t hashlib_hash_type = { + { &mp_type_type }, + .name = MP_QSTR_Hash, + .locals_dict = (mp_obj_dict_t *)&hashlib_hash_locals_dict, +}; diff --git a/shared-bindings/hashlib/Hash.h b/shared-bindings/hashlib/Hash.h new file mode 100644 index 0000000000..f3845b02ff --- /dev/null +++ b/shared-bindings/hashlib/Hash.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB_HASH_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB_HASH_H + +#include "py/obj.h" + +#include "common-hal/hashlib/Hash.h" + +extern const mp_obj_type_t hashlib_hash_type; + +// So that new can call it when given data. +mp_obj_t hashlib_hash_update(mp_obj_t self_in, mp_obj_t buf_in); + +void common_hal_hashlib_hash_update(hashlib_hash_obj_t *self, const uint8_t *data, size_t datalen); +void common_hal_hashlib_hash_digest(hashlib_hash_obj_t *self, uint8_t *data, size_t datalen); +size_t common_hal_hashlib_hash_get_digest_size(hashlib_hash_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB_HASH_H diff --git a/shared-bindings/hashlib/__init__.c b/shared-bindings/hashlib/__init__.c new file mode 100644 index 0000000000..4b5be0165b --- /dev/null +++ b/shared-bindings/hashlib/__init__.c @@ -0,0 +1,90 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/mpconfig.h" +#include "py/runtime.h" +#include "shared-bindings/hashlib/__init__.h" +#include "shared-bindings/hashlib/Hash.h" +#include "supervisor/shared/translate/translate.h" + +//| """Hashing related functions +//| +//| |see_cpython_module| :mod:`cpython:hashlib`. +//| """ +//| +//| def new(name, data=b"") -> hashlib.Hash: +//| """Returns a Hash object setup for the named algorithm. Raises ValueError when the named +//| algorithm is unsupported. +//| +//| :return: a hash object for the given algorithm +//| :rtype: hashlib.Hash""" +//| ... +//| +STATIC mp_obj_t hashlib_new(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_name, ARG_data }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_name, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_data, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const char *algorithm = mp_obj_str_get_str(args[ARG_name].u_obj); + + hashlib_hash_obj_t *self = m_new_obj(hashlib_hash_obj_t); + self->base.type = &hashlib_hash_type; + + if (!common_hal_hashlib_new(self, algorithm)) { + mp_raise_ValueError(translate("Unsupported hash algorithm")); + } + + if (args[ARG_data].u_obj != mp_const_none) { + hashlib_hash_update(self, args[ARG_data].u_obj); + } + return self; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(hashlib_new_obj, 1, hashlib_new); + +STATIC const mp_rom_map_elem_t hashlib_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_hashlib) }, + + { MP_ROM_QSTR(MP_QSTR_new), MP_ROM_PTR(&hashlib_new_obj) }, + + // Hash is deliberately omitted here because CPython doesn't expose the + // object on `hashlib` only the internal `_hashlib`. +}; + +STATIC MP_DEFINE_CONST_DICT(hashlib_module_globals, hashlib_module_globals_table); + +const mp_obj_module_t hashlib_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&hashlib_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_hashlib, hashlib_module, CIRCUITPY_HASHLIB); diff --git a/shared-bindings/hashlib/__init__.h b/shared-bindings/hashlib/__init__.h new file mode 100644 index 0000000000..ae47b546a4 --- /dev/null +++ b/shared-bindings/hashlib/__init__.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB___INIT___H + +#include + +#include "shared-bindings/hashlib/Hash.h" + +bool common_hal_hashlib_new(hashlib_hash_obj_t *self, const char *algorithm); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB___INIT___H diff --git a/supervisor/shared/web_workflow/static/serial.html b/supervisor/shared/web_workflow/static/serial.html new file mode 100644 index 0000000000..766a7a23e2 --- /dev/null +++ b/supervisor/shared/web_workflow/static/serial.html @@ -0,0 +1,16 @@ + + + + Simple client + + + + +

+  
+ + + +
+ + diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js new file mode 100644 index 0000000000..36c980dc08 --- /dev/null +++ b/supervisor/shared/web_workflow/static/serial.js @@ -0,0 +1,43 @@ + +var ws; + +function onSubmit() { + var input = document.getElementById("input"); + // You can send message to the Web Socket using ws.send. + ws.send(input.value); + output("send: " + input.value); + input.value = ""; + input.focus(); +} + +function onCloseClick() { + ws.close(); +} + +function output(str) { + var log = document.getElementById("log"); + log.innerHTML += str; +} + +// Connect to Web Socket +ws = new WebSocket("ws://cpy-f57ce8.local/cp/serial/"); +// ws = new WebSocket("ws://127.0.0.1:9001") + +// Set event handlers. +ws.onopen = function() { + output("onopen"); +}; + +ws.onmessage = function(e) { + // e.data contains received string. + output("onmessage: " + e.data); +}; + +ws.onclose = function() { + output("onclose"); +}; + +ws.onerror = function(e) { + output("onerror"); + console.log(e) +}; diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index 7fb68c302e..6ef1ccd767 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -3,8 +3,8 @@ CircuitPython + -

 Welcome!

Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank. diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index cbe1b24e86..b9a1de67f2 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -86,6 +86,10 @@ typedef struct { bool authenticated; bool expect; bool json; + bool websocket; + uint32_t websocket_version; + // RFC6455 for websockets says this header should be 24 base64 characters long. + char websocket_key[24 + 1]; } _request; static wifi_radio_error_t wifi_status = WIFI_RADIO_ERROR_NONE; @@ -519,6 +523,7 @@ static void _reply_redirect(socketpool_socket_obj_t *socket, _request *request, "Location: http://", hostname, ".local", path, "\r\n", NULL); _cors_header(socket, request); _send_str(socket, "\r\n"); + ESP_LOGI(TAG, "redirect"); } static void _reply_directory_json(socketpool_socket_obj_t *socket, _request *request, FF_DIR *dir, const char *request_path, const char *path) { @@ -826,6 +831,8 @@ STATIC_FILE(directory_html); STATIC_FILE(directory_js); STATIC_FILE(welcome_html); STATIC_FILE(welcome_js); +STATIC_FILE(serial_html); +STATIC_FILE(serial_js); STATIC_FILE(blinka_16x16_ico); static void _reply_static(socketpool_socket_obj_t *socket, _request *request, const uint8_t *response, size_t response_len, const char *content_type) { @@ -844,6 +851,13 @@ static void _reply_static(socketpool_socket_obj_t *socket, _request *request, co #define _REPLY_STATIC(socket, request, filename) _reply_static(socket, request, filename, filename##_length, filename##_content_type) +static void _reply_websocket_upgrade(socketpool_socket_obj_t *socket, _request *request) { + ESP_LOGI(TAG, "websocket!"); + // Compute accept key + // Reply with upgrade + // Copy socket state into websocket and mark given socket as closed even though it isn't actually. +} + static bool _reply(socketpool_socket_obj_t *socket, _request *request) { if (request->redirect) { _reply_redirect(socket, request, request->path); @@ -980,6 +994,22 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { _reply_with_devices_json(socket, request); } else if (strcmp(path, "/version.json") == 0) { _reply_with_version_json(socket, request); + } else if (strcmp(path, "/serial/") == 0) { + if (!request->authenticated) { + if (_api_password[0] != '\0') { + _reply_unauthorized(socket, request); + } else { + _reply_forbidden(socket, request); + } + } else if (request->websocket) { + ESP_LOGI(TAG, "websocket!"); + _reply_websocket_upgrade(socket, request); + } else { + _REPLY_STATIC(socket, request, serial_html); + } + _reply_with_version_json(socket, request); + } else { + _reply_missing(socket, request); } } else if (strcmp(request->method, "GET") != 0) { _reply_method_not_allowed(socket, request); @@ -992,6 +1022,8 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { _REPLY_STATIC(socket, request, directory_js); } else if (strcmp(request->path, "/welcome.js") == 0) { _REPLY_STATIC(socket, request, welcome_js); + } else if (strcmp(request->path, "/serial.js") == 0) { + _REPLY_STATIC(socket, request, serial_js); } else if (strcmp(request->path, "/favicon.ico") == 0) { // TODO: Autogenerate this based on the blinka bitmap and change the // palette based on MAC address. @@ -1015,6 +1047,7 @@ static void _reset_request(_request *request) { request->authenticated = false; request->expect = false; request->json = false; + request->websocket = false; } static void _process_request(socketpool_socket_obj_t *socket, _request *request) { @@ -1111,6 +1144,13 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) strcpy(request->origin, request->header_value); } else if (strcmp(request->header_key, "X-Timestamp") == 0) { request->timestamp_ms = strtoull(request->header_value, NULL, 10); + } else if (strcmp(request->header_key, "Upgrade") == 0) { + request->websocket = strcmp(request->header_value, "websocket") == 0; + } else if (strcmp(request->header_key, "Sec-WebSocket-Version") == 0) { + request->websocket_version = strtoul(request->header_value, NULL, 10); + } else if (strcmp(request->header_key, "Sec-WebSocket-Key") == 0 && + strlen(request->header_value) == 24) { + strcpy(request->websocket_key, request->header_value); } ESP_LOGI(TAG, "Header %s %s", request->header_key, request->header_value); } else if (request->offset > sizeof(request->header_value) - 1) { From 6a9892e864df8d32bdfce5dbf9760381f1b37630 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 1 Jul 2022 13:57:15 -0500 Subject: [PATCH 012/108] link to workflow page in docs. Capitalize "Workflow" --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 15cfb41829..66ad78f6eb 100644 --- a/README.rst +++ b/README.rst @@ -90,11 +90,11 @@ If you'd like to use the term "CircuitPython" and Blinka for your product here i * Your product is listed on `circuitpython.org `__ (source `here `_). This is to ensure that a user of your product can always download the latest version of CircuitPython from the standard place. -* Your product supports at least one standard "workflow" for serial and file access: +* Your product supports at least one standard "`Workflow `__" for serial and file access: * With a user accessible USB plug which appears as a CIRCUITPY drive when plugged in. * With file and serial access over Bluetooth Low Energy using the BLE Workflow. - * With file access over WiFi using the WiFi workflow, and serial access over USB. -* Boards that do not support the USB workflow should be clearly marked. + * With file access over WiFi using the WiFi Workflow with serial access over USB and/or WebSocket. +* Boards that do not support the USB Workflow should be clearly marked. If you choose not to meet these requirements, then we ask you call your version of CircuitPython something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is From fd4695d0f20dbc5995fa7bd43c1af75b18ff2237 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Wed, 6 Apr 2022 14:20:28 -0700 Subject: [PATCH 013/108] Gettting started with pin mapping. --- ports/espressif/boards/lolin_c3_mini/board.c | 48 ++++++++++ .../boards/lolin_c3_mini/mpconfigboard.h | 37 ++++++++ .../boards/lolin_c3_mini/mpconfigboard.mk | 21 +++++ ports/espressif/boards/lolin_c3_mini/pins.c | 91 +++++++++++++++++++ .../espressif/boards/lolin_c3_mini/sdkconfig | 37 ++++++++ 5 files changed, 234 insertions(+) create mode 100644 ports/espressif/boards/lolin_c3_mini/board.c create mode 100644 ports/espressif/boards/lolin_c3_mini/mpconfigboard.h create mode 100644 ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk create mode 100644 ports/espressif/boards/lolin_c3_mini/pins.c create mode 100644 ports/espressif/boards/lolin_c3_mini/sdkconfig diff --git a/ports/espressif/boards/lolin_c3_mini/board.c b/ports/espressif/boards/lolin_c3_mini/board.c new file mode 100644 index 0000000000..0432485111 --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/board.c @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h new file mode 100644 index 0000000000..12b0826e5c --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "LOLIN_C3_MINI" // from Wemos MP +#define MICROPY_HW_MCU_NAME "ESP32-C3FH4" // from Wemos MP + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO10) // no I2C labels on S2 Mini, def from Wemos MP +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) // no I2C labels on S2 Mini, def from Wemos MP + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO2) // no SPI labels on S2 Mini, def from Wemos MP +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO4) // no SPI labels on S2 Mini, def from Wemos MP +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) // no SPI labels on S2 Mini, def from Wemos MP diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk new file mode 100644 index 0000000000..d41a67a305 --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x303A +USB_PID = 0x80C3 +USB_PRODUCT = "C3 Mini" +USB_MANUFACTURER = "Lolin" + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=4MB + + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c new file mode 100644 index 0000000000..a4b18c4e9b --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -0,0 +1,91 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // S2 Mini Board bottom, right, top-bottom + // GPIO0-GPIO14: broken out as a bloc on ESP32-S2FN4R2 SoC + // mpconfigboard.h: GPIO0: CIRCUITPY_BOOT_BUTTON + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, // RTC_GPIO0,GPIO0 + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, // RTC_GPIO1,GPIO1,TOUCH1,ADC1_CH0 + + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, // RTC_GPIO2,GPIO2,TOUCH2,ADC1_CH1 + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, // RTC_GPIO3,GPIO3,TOUCH3,ADC1_CH2 + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO3) }, // D1 mini pin A0 + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, // RTC_GPIO4,GPIO4,TOUCH4,ADC1_CH3 + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // RTC_GPIO5,GPIO5,TOUCH5,ADC1_CH4 + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO5) }, // D1 mini pin D0 GPIO16 + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // RTC_GPIO6,GPIO6,TOUCH6,ADC1_CH5 + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // RTC_GPIO7,GPIO7,TOUCH7,ADC1_CH6 + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO7) }, // def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, // D1 mini pin D5 GPIO14 + + // mpconfigboard.h: GPIO8/GPIO9: SCL/SDA I2C0 + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, // RTC_GPIO8,GPIO8,TOUCH8,ADC1_CH7 + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // RTC_GPIO9,GPIO9,TOUCH9,ADC1_CH8,FSPIHD + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO9) }, // def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO9) }, // D1 mini pin D6 GPIO12 + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },// RTC_GPIO10,GPIO10,TOUCH10,ADC1_CH9,FSPICS0,FSPIIO4 + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },// RTC_GPIO11,GPIO11,TOUCH11,ADC2_CH0,FSPID,FSPIIO5 + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) },// def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO11) },// D1 mini pin D7 GPIO13 + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },// RTC_GPIO12,GPIO12,TOUCH12,ADC2_CH1,FSPICLK,FSPIIO6 + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },// RTC_GPIO13,GPIO13,TOUCH13,ADC2_CH2,FSPIQ,FSPIIO7 + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO13) },// D1 mini pin D8 GPIO15 + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },// RTC_GPIO14,GPIO14,TOUCH14,ADC2_CH3,FSPIWP,FSPIDQS + + // S2 Mini Board bottom, left, bottom-top + // mpconfigboard.h: GPIO15: CIRCUITPY_STATUS_LED_POWER + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },// XTAL_32K_P: RTC_GPIO15,GPIO15,U0RTS,ADC2_CH4,XTAL_32K_P + + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },// XTAL_32K_N: RTC_GPIO16,GPIO16,U0CTS,ADC2_CH5,XTAL_32K_N + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO16) },// D1 mini pin D4 GPIO2 LED + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },// DAC_1: RTC_GPIO17,GPIO17,U1TXD,ADC2_CH6,DAC_1 + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },// DAC_2: RTC_GPIO18,GPIO18,U1RXD,ADC2_CH7,DAC_2,CLK_OUT3 + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO18) },// D1 mini pin D3 GPIO0 + // skip GPIO19-GPIO20: USB_D-/USB_D+ + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },// RTC_GPIO21,GPIO21 + + // skip GPIO22-GPIO25: not broken out on ESP32-S2FN4R2 SoC + // skip GPIO26-GPIO32: SPI Flash & RAM, not broken out on S2 Mini (internal to ESP32-S2FN4R2 SoC?) + + // GPIO33-GPIO40: broken out as a bloc on ESP32-S2FN4R2 SoC, last 2 half of JTAG + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },// SPIIO4,GPIO33,FSPIHD + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },// def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO33) },// D1 mini pin D2 GPIO4 + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },// SPIIO5,GPIO34,FSPICS0 + + // mpconfigboard.h: GPIO35/GPIO36/GPIO37: MOSI/MESO/SCK SPI + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },// SPIIO6,GPIO35,FSPID + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO35) },// def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO35) },// D1 mini pin D1 GPIO5 + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },// SPIIO7,GPIO36,FSPICLK + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },// SPIDQS,GPIO37,FSPIQ + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },// GPIO38,FSPIWP + + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },// MTCK,GPIO39,CLK_OUT3 + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },// MTDO,GPIO40,CLK_OUT2 + + // S2 Mini - not broken out on board + /* + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },// MTDI,GPIO41,CLK_OUT1 + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },// MTMS,GPIO42 + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, // U0TXD,GPIO43,CLK_OUT1 + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },// + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, // U0RXD,GPIO44,CLK_OUT2 + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },// GPIO45 + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },// GPIO46 + */ + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, // board singleton implicit from schematic/shield standard +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig new file mode 100644 index 0000000000..007cca768e --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LC3Mini" +# end of LWIP From dc1c86738a213bb08279899104636fbf39dfc1c8 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 13:52:22 -0700 Subject: [PATCH 014/108] Initial pin mapping pass --- .../boards/lolin_c3_mini/mpconfigboard.h | 14 +- .../boards/lolin_c3_mini/mpconfigboard.mk | 4 +- ports/espressif/boards/lolin_c3_mini/pins.c | 129 +++++++----------- 3 files changed, 57 insertions(+), 90 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h index 12b0826e5c..b45cc706a0 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -29,9 +29,13 @@ #define MICROPY_HW_BOARD_NAME "LOLIN_C3_MINI" // from Wemos MP #define MICROPY_HW_MCU_NAME "ESP32-C3FH4" // from Wemos MP -#define DEFAULT_I2C_BUS_SCL (&pin_GPIO10) // no I2C labels on S2 Mini, def from Wemos MP -#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) // no I2C labels on S2 Mini, def from Wemos MP +// From Wemos C3 Mini Schematic +// https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf +// And MP Config +// https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO10) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO2) // no SPI labels on S2 Mini, def from Wemos MP -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO4) // no SPI labels on S2 Mini, def from Wemos MP -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) // no SPI labels on S2 Mini, def from Wemos MP +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO4) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO2) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index d41a67a305..d353ff4497 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x303A -USB_PID = 0x80C3 +USB_VID = 0x303A # TODO: I Assume this is Wemos, need to check +USB_PID = 0x80C3 # TODO: Does this board have a new PID? USB_PRODUCT = "C3 Mini" USB_MANUFACTURER = "Lolin" diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index a4b18c4e9b..1406ae19bc 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -3,89 +3,52 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - // S2 Mini Board bottom, right, top-bottom - // GPIO0-GPIO14: broken out as a bloc on ESP32-S2FN4R2 SoC - // mpconfigboard.h: GPIO0: CIRCUITPY_BOOT_BUTTON - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, // RTC_GPIO0,GPIO0 - { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, // RTC_GPIO1,GPIO1,TOUCH1,ADC1_CH0 + // C3 Mini Board + // From Wemos C3 Mini Schematic + // https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf + // Starting on Left side going counterclockwise + // And MP Config + // https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI - { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, // RTC_GPIO2,GPIO2,TOUCH2,ADC1_CH1 - { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, // RTC_GPIO3,GPIO3,TOUCH3,ADC1_CH2 - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO3) }, // D1 mini pin A0 - - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, // RTC_GPIO4,GPIO4,TOUCH4,ADC1_CH3 - { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // RTC_GPIO5,GPIO5,TOUCH5,ADC1_CH4 - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO5) }, // D1 mini pin D0 GPIO16 - - { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // RTC_GPIO6,GPIO6,TOUCH6,ADC1_CH5 - { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // RTC_GPIO7,GPIO7,TOUCH7,ADC1_CH6 - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO7) }, // def from Wemos MP - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, // D1 mini pin D5 GPIO14 - - // mpconfigboard.h: GPIO8/GPIO9: SCL/SDA I2C0 - { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, // RTC_GPIO8,GPIO8,TOUCH8,ADC1_CH7 - { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // RTC_GPIO9,GPIO9,TOUCH9,ADC1_CH8,FSPIHD - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO9) }, // def from Wemos MP - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO9) }, // D1 mini pin D6 GPIO12 - - { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },// RTC_GPIO10,GPIO10,TOUCH10,ADC1_CH9,FSPICS0,FSPIIO4 - { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },// RTC_GPIO11,GPIO11,TOUCH11,ADC2_CH0,FSPID,FSPIIO5 - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) },// def from Wemos MP - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO11) },// D1 mini pin D7 GPIO13 - - { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },// RTC_GPIO12,GPIO12,TOUCH12,ADC2_CH1,FSPICLK,FSPIIO6 - { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },// RTC_GPIO13,GPIO13,TOUCH13,ADC2_CH2,FSPIQ,FSPIIO7 - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO13) },// D1 mini pin D8 GPIO15 - - { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },// RTC_GPIO14,GPIO14,TOUCH14,ADC2_CH3,FSPIWP,FSPIDQS - - // S2 Mini Board bottom, left, bottom-top - // mpconfigboard.h: GPIO15: CIRCUITPY_STATUS_LED_POWER - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO15) }, - { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },// XTAL_32K_P: RTC_GPIO15,GPIO15,U0RTS,ADC2_CH4,XTAL_32K_P - - { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },// XTAL_32K_N: RTC_GPIO16,GPIO16,U0CTS,ADC2_CH5,XTAL_32K_N - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO16) },// D1 mini pin D4 GPIO2 LED - { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },// DAC_1: RTC_GPIO17,GPIO17,U1TXD,ADC2_CH6,DAC_1 - - { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },// DAC_2: RTC_GPIO18,GPIO18,U1RXD,ADC2_CH7,DAC_2,CLK_OUT3 - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO18) },// D1 mini pin D3 GPIO0 - // skip GPIO19-GPIO20: USB_D-/USB_D+ - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },// RTC_GPIO21,GPIO21 - - // skip GPIO22-GPIO25: not broken out on ESP32-S2FN4R2 SoC - // skip GPIO26-GPIO32: SPI Flash & RAM, not broken out on S2 Mini (internal to ESP32-S2FN4R2 SoC?) - - // GPIO33-GPIO40: broken out as a bloc on ESP32-S2FN4R2 SoC, last 2 half of JTAG - { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },// SPIIO4,GPIO33,FSPIHD - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },// def from Wemos MP - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO33) },// D1 mini pin D2 GPIO4 - { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },// SPIIO5,GPIO34,FSPICS0 - - // mpconfigboard.h: GPIO35/GPIO36/GPIO37: MOSI/MESO/SCK SPI - { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },// SPIIO6,GPIO35,FSPID - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO35) },// def from Wemos MP - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO35) },// D1 mini pin D1 GPIO5 - { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },// SPIIO7,GPIO36,FSPICLK - - { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },// SPIDQS,GPIO37,FSPIQ - { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },// GPIO38,FSPIWP - - { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },// MTCK,GPIO39,CLK_OUT3 - { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },// MTDO,GPIO40,CLK_OUT2 - - // S2 Mini - not broken out on board - /* - { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },// MTDI,GPIO41,CLK_OUT1 - { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },// MTMS,GPIO42 - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, // U0TXD,GPIO43,CLK_OUT1 - { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },// - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, // U0RXD,GPIO44,CLK_OUT2 - { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, - { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },// GPIO45 - { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },// GPIO46 - */ - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, // board singleton implicit from schematic/shield standard + // 1: LAN_IN + // 2: VDD3P3 + // 3: VDD3P3 + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) },// Reset Button + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, // 4: GPIO0/32K_P/A0 + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, // 5: GPIO1/32K_N/A1 + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, // 6: GPIO2/A2/FSPIQ + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO2) }, // mpboardconfig.h + // 7: CHIP_EN + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, // 8: GPIO3/A3 + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, // mpboardconfig.h + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, // 9: GPIO4/A4/FSPIHD/MTMS + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, // mpboardconfig.h + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // 10: GPIO5/A2_0/FSPIWP/MTDI + // 11: VDD3P3_RTC + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // 12: GPIO6/FSPICLK/MTCK + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, // mpboardconfig.h + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // 13: GPIO7/FSPID/MTD0 + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, // 14: GPIO8 + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, // mpboardconfig.h + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // 15: GPIO9 + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, // 16: GPIO10/FSPICS0 + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO10) }, // mpboardconfig.h + // 17: VDD3P3_SPI + // 18: VDD_SPI + // 19: SPIHD + // 20: SPIWP + // 21: SPICSO + // 22: SPICLK + // 23: SPID + // 24: SPIQ + // Used for USB 25: GPIO18/D- + // Used for USB 26: GPIO19/D+ + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, // 27: GPIO20/U0RXD + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO22) }, // 28: FPIO22/U0TXD + // 29: XTAL_N + // 30: XTAL_P + // 31: VDDA + // 32: VDDA + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },// board singleton implicit from schematic/shield standard }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From bcf27e146be86f2c2dde6cdf249b068915072351 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:16:15 -0700 Subject: [PATCH 015/108] fix build break and add io 20/21 --- ports/espressif/boards/lolin_c3_mini/pins.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index 1406ae19bc..82c0499ab5 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -31,9 +31,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, // 14: GPIO8 { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // 15: GPIO9 - { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, // 16: GPIO10/FSPICS0 + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, // 16: GPIO10/FSPICS0 { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO10) }, // mpboardconfig.h - // 17: VDD3P3_SPI + // 17: VDD3P3_CPJ // 18: VDD_SPI // 19: SPIHD // 20: SPIWP @@ -44,7 +44,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // Used for USB 25: GPIO18/D- // Used for USB 26: GPIO19/D+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, // 27: GPIO20/U0RXD - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO22) }, // 28: FPIO22/U0TXD + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, // 28: GPIO21/U0TXD + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, // 29: XTAL_N // 30: XTAL_P // 31: VDDA From 6763b7b968bcea6e156522cc600646864babd667 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:32:58 -0700 Subject: [PATCH 016/108] add A5 --- ports/espressif/boards/lolin_c3_mini/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index 82c0499ab5..fcbb97232c 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -24,6 +24,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, // 9: GPIO4/A4/FSPIHD/MTMS { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // 10: GPIO5/A2_0/FSPIWP/MTDI + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, // Board screen has A5, Schematic has A2_0 (huh?) // 11: VDD3P3_RTC { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // 12: GPIO6/FSPICLK/MTCK { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, // mpboardconfig.h From 9bae8549c517cb6bb78148d56d76eca74e47b81d Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:40:10 -0700 Subject: [PATCH 017/108] add UART RX TX to mpconfigboard --- ports/espressif/boards/lolin_c3_mini/mpconfigboard.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h index b45cc706a0..5c253a4d33 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -39,3 +39,6 @@ #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO4) #define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) #define DEFAULT_SPI_BUS_SCK (&pin_GPIO2) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO20) +#define DEFAULT_UART_BUS_TX (&pin_GPIO21) From c1e6003d2676e564bf9863e979992d35bda72460 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:56:41 -0700 Subject: [PATCH 018/108] remove comment that breaks {ID Checker --- ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index d353ff4497..d41a67a305 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x303A # TODO: I Assume this is Wemos, need to check -USB_PID = 0x80C3 # TODO: Does this board have a new PID? +USB_VID = 0x303A +USB_PID = 0x80C3 USB_PRODUCT = "C3 Mini" USB_MANUFACTURER = "Lolin" From af629ab180dbcb44a9f605c8ad533d810dedcc02 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 15:50:07 -0700 Subject: [PATCH 019/108] Add assumed PID value --- ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index d41a67a305..b745b2d29e 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x303A -USB_PID = 0x80C3 +USB_PID = 0x80F5 USB_PRODUCT = "C3 Mini" USB_MANUFACTURER = "Lolin" From f95edd93a0fd090c89748b13ab7a04f55c504e84 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:09:33 -0700 Subject: [PATCH 020/108] C3 boards are Bin only --- tools/build_board_info.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 72ccb98551..79d9bf7b46 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -77,6 +77,7 @@ extension_by_board = { "ai_thinker_esp32-c3s-2m": BIN, "espressif_esp32c3_devkitm_1_n4": BIN, "lilygo_ttgo_t-01c3": BIN, + "lolin-c3-mini": BIN, "microdev_micro_c3": BIN, "lilygo_ttgo_t-oi-plus": BIN, # broadcom From 03c1871d6b2972cecdbbc562db9cf3a927234d69 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:19:56 -0700 Subject: [PATCH 021/108] Folders have underscores not dashes --- tools/build_board_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 79d9bf7b46..d73f0e3f1c 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -77,7 +77,7 @@ extension_by_board = { "ai_thinker_esp32-c3s-2m": BIN, "espressif_esp32c3_devkitm_1_n4": BIN, "lilygo_ttgo_t-01c3": BIN, - "lolin-c3-mini": BIN, + "lolin_c3_mini": BIN, "microdev_micro_c3": BIN, "lilygo_ttgo_t-oi-plus": BIN, # broadcom From b37236f83f45692bab0933d9443ca36ff77e77d6 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:44:49 -0700 Subject: [PATCH 022/108] C3 does not have PSRAM --- .../espressif/boards/lolin_c3_mini/sdkconfig | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index 007cca768e..b96cda80a6 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,35 +1,4 @@ -CONFIG_ESP32S2_SPIRAM_SUPPORT=y -# -# SPI RAM config -# -# CONFIG_SPIRAM_TYPE_AUTO is not set -CONFIG_SPIRAM_TYPE_ESPPSRAM16=y -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_SIZE=2097152 -# end of SPI RAM config - -CONFIG_DEFAULT_PSRAM_CLK_IO=30 -# -# PSRAM clock and cs IO for ESP32S2 -# -CONFIG_DEFAULT_PSRAM_CS_IO=26 -# end of PSRAM clock and cs IO for ESP32S2 - -# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set -# CONFIG_SPIRAM_RODATA is not set -# CONFIG_SPIRAM_SPEED_80M is not set -CONFIG_SPIRAM_SPEED_40M=y -# CONFIG_SPIRAM_SPEED_26M is not set -# CONFIG_SPIRAM_SPEED_20M is not set -CONFIG_SPIRAM=y -CONFIG_SPIRAM_BOOT_INIT=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -CONFIG_SPIRAM_USE_MEMMAP=y -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -# CONFIG_SPIRAM_USE_MALLOC is not set -CONFIG_SPIRAM_MEMTEST=y -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set # # LWIP # From a3070f6c2a6057182a8972d3980cd47eb95df669 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Tue, 12 Apr 2022 20:05:41 -0700 Subject: [PATCH 023/108] Changes to Pin Mappings --- ports/espressif/boards/lolin_c3_mini/board.c | 4 +-- .../boards/lolin_c3_mini/mpconfigboard.h | 4 +++ .../boards/lolin_c3_mini/mpconfigboard.mk | 4 +-- ports/espressif/boards/lolin_c3_mini/pins.c | 26 ++++++++++++++----- .../espressif/boards/lolin_c3_mini/sdkconfig | 3 +-- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/board.c b/ports/espressif/boards/lolin_c3_mini/board.c index 0432485111..d77b968d3e 100644 --- a/ports/espressif/boards/lolin_c3_mini/board.c +++ b/ports/espressif/boards/lolin_c3_mini/board.c @@ -31,8 +31,8 @@ void board_init(void) { // Debug UART #ifdef DEBUG - common_hal_never_reset_pin(&pin_GPIO43); - common_hal_never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO21); #endif /* DEBUG */ } diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h index 5c253a4d33..3956d2c5b0 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -42,3 +42,7 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO20) #define DEFAULT_UART_BUS_TX (&pin_GPIO21) + +// // Serial over UART +#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index b745b2d29e..60c8639232 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x303A USB_PID = 0x80F5 -USB_PRODUCT = "C3 Mini" -USB_MANUFACTURER = "Lolin" +USB_PRODUCT = "Lolin C3 Mini" +USB_MANUFACTURER = "Wemos" IDF_TARGET = esp32c3 diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index fcbb97232c..230ed31b9f 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -7,25 +7,32 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // From Wemos C3 Mini Schematic // https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf // Starting on Left side going counterclockwise - // And MP Config + // MP Config // https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI + // C3 Data Sheet + // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf // 1: LAN_IN // 2: VDD3P3 // 3: VDD3P3 + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) },// Reset Button { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, // 4: GPIO0/32K_P/A0 { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, // 5: GPIO1/32K_N/A1 { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, // 6: GPIO2/A2/FSPIQ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO2) }, // mpboardconfig.h + // 7: CHIP_EN + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, // 8: GPIO3/A3 { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, // 9: GPIO4/A4/FSPIHD/MTMS { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // 10: GPIO5/A2_0/FSPIWP/MTDI { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, // Board screen has A5, Schematic has A2_0 (huh?) - // 11: VDD3P3_RTC + + // 11: VDD3P3_RTC: Input power supply for RTC + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // 12: GPIO6/FSPICLK/MTCK { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, // mpboardconfig.h { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // 13: GPIO7/FSPID/MTD0 @@ -34,24 +41,29 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // 15: GPIO9 { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, // 16: GPIO10/FSPICS0 { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO10) }, // mpboardconfig.h - // 17: VDD3P3_CPJ + + // 17: VDD3P3_CPU: Input power supply for CPU IO // 18: VDD_SPI + + // Ports of embedded flash for ESP32-C3FH4 // 19: SPIHD // 20: SPIWP // 21: SPICSO // 22: SPICLK // 23: SPID // 24: SPIQ - // Used for USB 25: GPIO18/D- - // Used for USB 26: GPIO19/D+ + + // 25: GPIO18/D-: Used for USB + // 26: GPIO19/D+: Used for USB + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, // 27: GPIO20/U0RXD - { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, // 28: GPIO21/U0TXD - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + // 29: XTAL_N // 30: XTAL_P // 31: VDDA // 32: VDDA + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },// board singleton implicit from schematic/shield standard }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index b96cda80a6..833f8368fa 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,6 +1,5 @@ -# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set # # LWIP # -CONFIG_LWIP_LOCAL_HOSTNAME="LC3Mini" +CONFIG_LWIP_LOCAL_HOSTNAME="lolin-c3-mini" # end of LWIP From f10fa566aacc9d4fc67fbd3b77a9c3f8f598bb34 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Wed, 13 Apr 2022 00:21:29 -0700 Subject: [PATCH 024/108] REPL works. Based on QTPYC3. --- ports/espressif/boards/lolin_c3_mini/board.c | 15 ++- .../boards/lolin_c3_mini/mpconfigboard.h | 27 ++--- .../boards/lolin_c3_mini/mpconfigboard.mk | 9 -- ports/espressif/boards/lolin_c3_mini/pins.c | 99 +++++++++---------- 4 files changed, 68 insertions(+), 82 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/board.c b/ports/espressif/boards/lolin_c3_mini/board.c index d77b968d3e..8bca964dc7 100644 --- a/ports/espressif/boards/lolin_c3_mini/board.c +++ b/ports/espressif/boards/lolin_c3_mini/board.c @@ -24,24 +24,23 @@ * THE SOFTWARE. */ -#include "supervisor/board.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + +#include "components/driver/include/driver/gpio.h" void board_init(void) { - // Debug UART - #ifdef DEBUG - common_hal_never_reset_pin(&pin_GPIO20); - common_hal_never_reset_pin(&pin_GPIO21); - #endif /* DEBUG */ } bool board_requests_safe_mode(void) { return false; } -void reset_board(void) { +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + return false; +} +void reset_board(void) { } void board_deinit(void) { diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h index 3956d2c5b0..03e4d5d436 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -24,25 +24,28 @@ * THE SOFTWARE. */ -// Micropython setup +// Board setup -#define MICROPY_HW_BOARD_NAME "LOLIN_C3_MINI" // from Wemos MP +#define MICROPY_HW_BOARD_NAME "Wemos Lolin C3 Mini" // from Wemos MP #define MICROPY_HW_MCU_NAME "ESP32-C3FH4" // from Wemos MP // From Wemos C3 Mini Schematic // https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf // And MP Config // https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI -#define DEFAULT_I2C_BUS_SCL (&pin_GPIO10) -#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) +// Status LED +#define MICROPY_HW_NEOPIXEL (&pin_GPIO7) -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO4) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO2) +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO6, .sda = &pin_GPIO5}} -#define DEFAULT_UART_BUS_RX (&pin_GPIO20) -#define DEFAULT_UART_BUS_TX (&pin_GPIO21) +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO10, .mosi = &pin_GPIO7, .miso = &pin_GPIO8}} -// // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index 60c8639232..793730f025 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -6,16 +6,7 @@ USB_MANUFACTURER = "Wemos" IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = MPZ - -# The default queue depth of 16 overflows on release builds, -# so increase it to 32. -CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE=qio CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=4MB - - -# Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index 230ed31b9f..d3828311ed 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // C3 Mini Board - // From Wemos C3 Mini Schematic + // Wemos Lolin C3 Mini Schematic // https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf // Starting on Left side going counterclockwise // MP Config @@ -12,58 +12,51 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // C3 Data Sheet // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf - // 1: LAN_IN - // 2: VDD3P3 - // 3: VDD3P3 - - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) },// Reset Button - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, // 4: GPIO0/32K_P/A0 - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, // 5: GPIO1/32K_N/A1 - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, // 6: GPIO2/A2/FSPIQ - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO2) }, // mpboardconfig.h - - // 7: CHIP_EN - - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, // 8: GPIO3/A3 - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, // mpboardconfig.h - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, // 9: GPIO4/A4/FSPIHD/MTMS - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, // mpboardconfig.h - { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // 10: GPIO5/A2_0/FSPIWP/MTDI - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, // Board screen has A5, Schematic has A2_0 (huh?) - - // 11: VDD3P3_RTC: Input power supply for RTC - - { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // 12: GPIO6/FSPICLK/MTCK - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, // mpboardconfig.h - { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // 13: GPIO7/FSPID/MTD0 - { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, // 14: GPIO8 - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, // mpboardconfig.h - { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // 15: GPIO9 - { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, // 16: GPIO10/FSPICS0 - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO10) }, // mpboardconfig.h - - // 17: VDD3P3_CPU: Input power supply for CPU IO - // 18: VDD_SPI - - // Ports of embedded flash for ESP32-C3FH4 - // 19: SPIHD - // 20: SPIWP - // 21: SPICSO - // 22: SPICLK - // 23: SPID - // 24: SPIQ - - // 25: GPIO18/D-: Used for USB - // 26: GPIO19/D+: Used for USB - - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, // 27: GPIO20/U0RXD - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, // 28: GPIO21/U0TXD - - // 29: XTAL_N - // 30: XTAL_P - // 31: VDDA - // 32: VDDA - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },// board singleton implicit from schematic/shield standard + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 3253ae250312a57e0c542452c93c945bee7137f6 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Tue, 19 Apr 2022 17:34:36 -0700 Subject: [PATCH 025/108] tested and corrected several pins --- ports/espressif/boards/lolin_c3_mini/pins.c | 62 ++++++++++----------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index d3828311ed..8078ffad48 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -12,49 +12,49 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // C3 Data Sheet // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },// board singleton implicit from schematic/shield standard - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO3) }, - - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1) }, - - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO21) }, - - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO20) }, - - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO7) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, From 6c7faf0eba6dbdd3119b0b4af97e363c88f0beba Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 10 Jun 2022 23:54:59 -0700 Subject: [PATCH 026/108] Change USB VID & PID to Creator and Creation IDs --- ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index 793730f025..bdb569f430 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,7 +1,5 @@ -USB_VID = 0x303A -USB_PID = 0x80F5 -USB_PRODUCT = "Lolin C3 Mini" -USB_MANUFACTURER = "Wemos" +CIRCUITPY_CREATOR_ID = 0x1988_1988 +CIRCUITPY_CREATION_ID = 0x00C3_0001 IDF_TARGET = esp32c3 From d4b26daf1be096367e73b467ad626bb556f23dc8 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Sat, 11 Jun 2022 23:41:35 -0700 Subject: [PATCH 027/108] correct creator and creation IDs --- ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk index bdb569f430..28e4190adf 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x1988_1988 -CIRCUITPY_CREATION_ID = 0x00C3_0001 +CIRCUITPY_CREATOR_ID = 0x19881988 +CIRCUITPY_CREATION_ID = 0x00C30001 IDF_TARGET = esp32c3 From 7e367eeb584ff1dbc2e15c8ee0f91a9297a4c13d Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Thu, 16 Jun 2022 00:09:26 -0700 Subject: [PATCH 028/108] Update "D" mappings --- ports/espressif/boards/lolin_c3_mini/pins.c | 34 ++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index 8078ffad48..ccc70f6043 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -12,47 +12,59 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // C3 Data Sheet // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO20) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From aa53d3693428590c09a461fe20b130717634708f Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Thu, 23 Jun 2022 14:54:23 -0700 Subject: [PATCH 029/108] setting CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER to 8.5 --- ports/espressif/boards/lolin_c3_mini/sdkconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index 833f8368fa..b511505909 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,5 +1,6 @@ # # LWIP # +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=8.5 CONFIG_LWIP_LOCAL_HOSTNAME="lolin-c3-mini" # end of LWIP From aaeda978184006a7ce9271e778ce93a63adf89fd Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Mon, 27 Jun 2022 21:57:32 -0700 Subject: [PATCH 030/108] update PHY section, correct name --- ports/espressif/boards/lolin_c3_mini/sdkconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index b511505909..d997c9aa57 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,6 +1,13 @@ +# +# PHY +# +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=15 +# end of PHY + # # LWIP # -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=8.5 CONFIG_LWIP_LOCAL_HOSTNAME="lolin-c3-mini" # end of LWIP + + From c3cf9ba9cea944ff5783a530b68121a7e8f7d266 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 1 Jul 2022 14:47:58 -0700 Subject: [PATCH 031/108] remove wifi max from sdkconfig --- ports/espressif/boards/lolin_c3_mini/sdkconfig | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index d997c9aa57..2cb6b06589 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,9 +1,3 @@ -# -# PHY -# -CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=15 -# end of PHY - # # LWIP # From 07b2697ae387e3157616e606ed970291d487270c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 1 Jul 2022 16:57:10 -0700 Subject: [PATCH 032/108] WIP websocket to serial --- ports/espressif/common-hal/hashlib/Hash.c | 5 + py/circuitpy_mpconfig.mk | 3 + supervisor/shared/serial.c | 27 +++ supervisor/shared/web_workflow/web_workflow.c | 41 +++- supervisor/shared/web_workflow/websocket.c | 179 ++++++++++++++++++ supervisor/shared/web_workflow/websocket.h | 38 ++++ supervisor/supervisor.mk | 4 +- 7 files changed, 288 insertions(+), 9 deletions(-) create mode 100644 supervisor/shared/web_workflow/websocket.c create mode 100644 supervisor/shared/web_workflow/websocket.h diff --git a/ports/espressif/common-hal/hashlib/Hash.c b/ports/espressif/common-hal/hashlib/Hash.c index 8e2ab02edb..8090128acb 100644 --- a/ports/espressif/common-hal/hashlib/Hash.c +++ b/ports/espressif/common-hal/hashlib/Hash.c @@ -40,7 +40,12 @@ void common_hal_hashlib_hash_digest(hashlib_hash_obj_t *self, uint8_t *data, siz return; } if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + // We copy the sha1 state so we can continue to update if needed or get + // the digest a second time. + mbedtls_sha1_context copy; + mbedtls_sha1_clone(©, &self->sha1); mbedtls_sha1_finish_ret(&self->sha1, data); + mbedtls_sha1_clone(&self->sha1, ©); } } diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 8505fe1cb7..de88dcc727 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -242,6 +242,9 @@ CFLAGS += -DCIRCUITPY_GIFIO=$(CIRCUITPY_GIFIO) CIRCUITPY_GNSS ?= 0 CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) +CIRCUITPY_HASHLIB ?= $(CIRCUITPY_WEB_WORKFLOW) +CFLAGS += -DCIRCUITPY_HASHLIB=$(CIRCUITPY_HASHLIB) + CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index af90fce4d7..04e974e4b5 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -45,6 +45,10 @@ #include "tusb.h" #endif +#if CIRCUITPY_WEB_WORKFLOW +#include "supervisor/shared/web_workflow/websocket.h" +#endif + /* * Note: DEBUG_UART currently only works on STM32 and nRF. * Enabling on another platform will cause a crash. @@ -165,6 +169,13 @@ bool serial_connected(void) { } #endif + #if CIRCUITPY_WEB_WORKFLOW + if (websocket_connected()) { + return true; + } + #endif + + if (port_serial_connected()) { return true; } @@ -195,6 +206,12 @@ char serial_read(void) { } #endif + #if CIRCUITPY_WEB_WORKFLOW + if (websocket_available()) { + return websocket_read_char(); + } + #endif + #if CIRCUITPY_USB_CDC if (!usb_cdc_console_enabled()) { return -1; @@ -229,6 +246,12 @@ bool serial_bytes_available(void) { } #endif + #if CIRCUITPY_WEB_WORKFLOW + if (websocket_available()) { + return true; + } + #endif + #if CIRCUITPY_USB_CDC if (usb_cdc_console_enabled() && tud_cdc_available() > 0) { return true; @@ -271,6 +294,10 @@ void serial_write_substring(const char *text, uint32_t length) { ble_serial_write(text, length); #endif + #if CIRCUITPY_WEB_WORKFLOW + websocket_write(text, length); + #endif + #if CIRCUITPY_USB_CDC if (!usb_cdc_console_enabled()) { return; diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index b9a1de67f2..07298c17e9 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -39,8 +39,11 @@ #include "supervisor/shared/reload.h" #include "supervisor/shared/translate/translate.h" #include "supervisor/shared/web_workflow/web_workflow.h" +#include "supervisor/shared/web_workflow/websocket.h" #include "supervisor/usb.h" +#include "shared-bindings/hashlib/__init__.h" +#include "shared-bindings/hashlib/Hash.h" #include "shared-bindings/mdns/RemoteService.h" #include "shared-bindings/mdns/Server.h" #include "shared-bindings/socketpool/__init__.h" @@ -260,20 +263,19 @@ void supervisor_start_web_workflow(void) { active.num = -1; active.connected = false; + websocket_init(); + // TODO: // GET /cp/serial.txt // - Most recent 1k of serial output. // GET /edit/ // - Super basic editor - // GET /ws/circuitpython - // GET /ws/user - // - WebSockets #endif } static void _send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { int sent = -EAGAIN; - while (sent == -EAGAIN) { + while (sent == -EAGAIN && common_hal_socketpool_socket_get_connected(socket)) { sent = socketpool_socket_send(socket, buf, len); } if (sent < len) { @@ -851,17 +853,39 @@ static void _reply_static(socketpool_socket_obj_t *socket, _request *request, co #define _REPLY_STATIC(socket, request, filename) _reply_static(socket, request, filename, filename##_length, filename##_content_type) + + static void _reply_websocket_upgrade(socketpool_socket_obj_t *socket, _request *request) { ESP_LOGI(TAG, "websocket!"); // Compute accept key + hashlib_hash_obj_t hash; + common_hal_hashlib_new(&hash, "sha1"); + common_hal_hashlib_hash_update(&hash, (const uint8_t *)request->websocket_key, strlen(request->websocket_key)); + const char *magic_string = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + common_hal_hashlib_hash_update(&hash, (const uint8_t *)magic_string, strlen(magic_string)); + size_t digest_size = common_hal_hashlib_hash_get_digest_size(&hash); + size_t encoded_size = (digest_size + 1) * 4 / 3 + 1; + uint8_t encoded_accept[encoded_size]; + common_hal_hashlib_hash_digest(&hash, encoded_accept, sizeof(encoded_accept)); + _base64_in_place((char *)encoded_accept, digest_size, encoded_size); + // Reply with upgrade - // Copy socket state into websocket and mark given socket as closed even though it isn't actually. + _send_strs(socket, "HTTP/1.1 101 Switching Protocols\r\n", + "Upgrade: websocket\r\n", + "Connection: Upgrade\r\n", + "Sec-WebSocket-Accept: ", encoded_accept, "\r\n", + "\r\n", NULL); + websocket_handoff(socket); + + ESP_LOGI(TAG, "socket upgrade done"); + // socket is now closed and "disconnected". } static bool _reply(socketpool_socket_obj_t *socket, _request *request) { if (request->redirect) { _reply_redirect(socket, request, request->path); } else if (strlen(request->origin) > 0 && !_origin_ok(request->origin)) { + ESP_LOGI(TAG, "bad origin %s", request->origin); _reply_forbidden(socket, request); } else if (memcmp(request->path, "/fs/", 4) == 0) { if (!request->authenticated) { @@ -995,7 +1019,7 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (strcmp(path, "/version.json") == 0) { _reply_with_version_json(socket, request); } else if (strcmp(path, "/serial/") == 0) { - if (!request->authenticated) { + if (false && !request->authenticated) { if (_api_password[0] != '\0') { _reply_unauthorized(socket, request); } else { @@ -1007,7 +1031,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else { _REPLY_STATIC(socket, request, serial_html); } - _reply_with_version_json(socket, request); } else { _reply_missing(socket, request); } @@ -1177,6 +1200,7 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) return; } bool reload = _reply(socket, request); + ESP_LOGI(TAG, "reply done"); _reset_request(request); autoreload_resume(AUTORELOAD_SUSPEND_WEB); if (reload) { @@ -1194,10 +1218,12 @@ void supervisor_web_workflow_background(void) { uint32_t port; int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port); if (newsoc == -EBADF) { + ESP_LOGI(TAG, "listen closed"); common_hal_socketpool_socket_close(&listening); return; } if (newsoc > 0) { + ESP_LOGI(TAG, "new socket %d", newsoc); // Close the active socket because we have another we accepted. if (!common_hal_socketpool_socket_get_closed(&active)) { common_hal_socketpool_socket_close(&active); @@ -1218,6 +1244,7 @@ void supervisor_web_workflow_background(void) { // If we have a request in progress, continue working on it. if (common_hal_socketpool_socket_get_connected(&active)) { + ESP_LOGI(TAG, "active connected"); _process_request(&active, &active_request); } } diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c new file mode 100644 index 0000000000..8aec9d206c --- /dev/null +++ b/supervisor/shared/web_workflow/websocket.c @@ -0,0 +1,179 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/shared/web_workflow/websocket.h" + +typedef struct { + socketpool_socket_obj_t socket; + uint8_t opcode; + uint8_t frame_len; + uint8_t payload_len_size; + bool masked; + uint32_t mask; + size_t frame_index; + size_t payload_remaining; +} _websocket; + +static _websocket cp_serial; + +static const char *TAG = "CP websocket"; + +void websocket_init(void) { + cp_serial.socket.num = -1; + cp_serial.socket.connected = false; +} + +void websocket_handoff(socketpool_socket_obj_t *socket) { + ESP_LOGI(TAG, "socket handed off"); + cp_serial.socket = *socket; + // Mark the original socket object as closed without telling the lower level. + socket->connected = false; + socket->num = -1; + ESP_LOGI(TAG, "socket hand off done"); +} + +bool websocket_connected(void) { + return common_hal_socketpool_socket_get_connected(&cp_serial.socket); +} + +static bool _read_byte(uint8_t *c) { + int len = socketpool_socket_recv_into(&cp_serial.socket, c, 1); + if (len != 1) { + if (len != -EAGAIN) { + ESP_LOGE(TAG, "recv error %d", len); + } + return false; + } + return true; +} + +static void _read_next_frame_header(void) { + uint8_t h; + if (cp_serial.frame_index == 0 && _read_byte(&h)) { + cp_serial.frame_index++; + cp_serial.opcode = h & 0xf; + ESP_LOGI(TAG, "fin %d opcode %x", h >> 7, cp_serial.opcode); + } + if (cp_serial.frame_index == 1 && _read_byte(&h)) { + cp_serial.frame_index++; + uint8_t len = h & 0xf; + cp_serial.masked = (h >> 7) == 1; + if (len <= 125) { + cp_serial.payload_remaining = len; + cp_serial.payload_len_size = 0; + } else if (len == 126) { // 16 bit length + cp_serial.payload_len_size = 2; + } else if (len == 127) { // 64 bit length + cp_serial.payload_len_size = 8; + } + cp_serial.frame_len = 2 + cp_serial.payload_len_size; + if (cp_serial.masked) { + cp_serial.frame_len += 4; + } + + ESP_LOGI(TAG, "mask %d length %x", cp_serial.masked, len); + } + while (cp_serial.frame_index > 1 && + cp_serial.frame_index < (cp_serial.payload_len_size + 2) && + _read_byte(&h)) { + cp_serial.frame_index++; + cp_serial.payload_remaining = cp_serial.payload_remaining << 8 | c; + } + while (cp_serial.frame_index > (cp_serial.payload_len_size + 2) && + cp_serial.frame_index < cp_serial.frame_len && + _read_byte(&h)) { + cp_serial.frame_index++; + cp_serial.mask = cp_serial.mask << 8 | c; + } +} + +static bool _read_next_payload_byte(uint8_t *c) { + _read_next_frame_header(); + if (cp_serial.frame_index > cp_serial.frame_len && + cp_serial.payload_remaining > 0) { + if (_read_byte(c)) { + cp_serial.frame_index++; + cp_serial.payload_remaining--; + return true; + } + } + return false; +} + +bool websocket_available(void) { + if (!websocket_connected()) { + return false; + } + _read_next_frame_header(); + return cp_serial.payload_remaining > 0 && cp_serial.frame_index >= cp_serial.frame_len; +} + +char websocket_read_char(void) { + return _read_next_payload_byte(); +} + +static void _send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { + int sent = -EAGAIN; + while (sent == -EAGAIN) { + sent = socketpool_socket_send(socket, buf, len); + } + if (sent < len) { + ESP_LOGE(TAG, "short send %d %d", sent, len); + } +} + +static void _websocket_send(_websocket *ws, const char *text, size_t len) { + if (!websocket_connected()) { + return; + } + uint32_t opcode = 1; + uint8_t frame_header[2]; + frame_header[0] = 1 << 7 | opcode; + uint8_t payload_len; + if (len <= 125) { + payload_len = len; + } else if (len < (1 << 16)) { + payload_len = 126; + } else { + payload_len = 127; + } + frame_header[1] = payload_len; + _send_raw(&ws->socket, (const uint8_t *)frame_header, 2); + if (payload_len == 126) { + _send_raw(&ws->socket, (const uint8_t *)&len, 2); + } else if (payload_len == 127) { + uint32_t zero = 0; + // 64 bits where top four bytes are zero. + _send_raw(&ws->socket, (const uint8_t *)&zero, 4); + _send_raw(&ws->socket, (const uint8_t *)&len, 4); + } + _send_raw(&ws->socket, (const uint8_t *)text, len); + ESP_LOGI(TAG, "sent over websocket: %s", text); +} + +void websocket_write(const char *text, size_t len) { + _websocket_send(&cp_serial, text, len); +} diff --git a/supervisor/shared/web_workflow/websocket.h b/supervisor/shared/web_workflow/websocket.h new file mode 100644 index 0000000000..c5c5114586 --- /dev/null +++ b/supervisor/shared/web_workflow/websocket.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include + +#include "shared-bindings/socketpool/Socket.h" + +void websocket_init(void); +void websocket_handoff(socketpool_socket_obj_t *socket); +bool websocket_connected(void); +bool websocket_available(void); +char websocket_read_char(void); +void websocket_write(const char *text, size_t len); diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 45df5f687f..5b8cb513a7 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -168,8 +168,8 @@ $(BUILD)/autogen_web_workflow_static.c: ../../tools/gen_web_workflow_static.py $ $(STATIC_RESOURCES) ifeq ($(CIRCUITPY_WEB_WORKFLOW),1) - SRC_SUPERVISOR += supervisor/shared/web_workflow/web_workflow.c - + SRC_SUPERVISOR += supervisor/shared/web_workflow/web_workflow.c \ + supervisor/shared/web_workflow/websocket.c SRC_SUPERVISOR += $(BUILD)/autogen_web_workflow_static.c endif From dce9396fe325922394a783bb47b81f2263231713 Mon Sep 17 00:00:00 2001 From: Nick Lopez Date: Sat, 2 Jul 2022 14:30:36 -0700 Subject: [PATCH 033/108] issue adafruit#6538 loose bounds checking on WAIT PIO instruction --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index bee77238b5..9e8d5feebc 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -436,7 +436,7 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, if (first_in_pin == NULL) { mp_raise_ValueError_varg(translate("Missing first_in_pin. Instruction %d waits based on pin"), i); } - if (wait_index > in_pin_count) { + if (wait_index >= in_pin_count) { mp_raise_ValueError_varg(translate("Instruction %d waits on input outside of count"), i); } } From 5522ba532229b44cb5d167ba1a27a2a44d4bf659 Mon Sep 17 00:00:00 2001 From: Maxime Leroy Date: Fri, 1 Jul 2022 21:19:02 +0000 Subject: [PATCH 034/108] Translated using Weblate (French) Currently translated at 98.9% (975 of 985 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 77 +++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index c98b2f54db..f553567e50 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-06-30 22:19+0000\n" +"PO-Revision-Date: 2022-07-03 00:22+0000\n" "Last-Translator: Maxime Leroy \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -558,7 +558,9 @@ msgstr "Au-dessous de la fréquence d'images minimale" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "Bit clock et word select doivent êtres sur des broches séquentielles" +msgstr "" +"La sélection du bit d'horloge et de mot doit être sur des broches " +"séquentielles" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -603,7 +605,7 @@ msgstr "Tampon + décalage trop petit %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "Éléments du tampon doit être 4 octets ou moins" +msgstr "Les éléments du tampon doivent faire 4 octets ou moins" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." @@ -655,7 +657,7 @@ msgstr "Les blocs CBC doivent être des multiples de 16 octets" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "L’appareil CIRCUITPY ne peut pas être trouvé ou créé." #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" @@ -671,18 +673,18 @@ msgstr "Initialisation de la caméra" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." -msgstr "L'alarme peut seulement être depuis TRC IO depuis le someil profond." +msgstr "L'alarme ne peut être que sur TRC IO depuis un sommeil profond." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" "L'alarme peut seulement être sur une broche basse tandis que d'autres " -"alarment sont sur des broches hautes depuis le someil profond." +"alarment sont sur des broches hautes depuis le sommeil profond." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" -"L'alarme peut seulement être sur deux broches basses depuis le someil " +"L'alarme peut seulement être sur deux broches basses depuis le sommeil " "profond." #: ports/espressif/common-hal/_bleio/Characteristic.c @@ -762,7 +764,7 @@ msgstr "On ne peut faire de sous-classes de tranches" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" -msgstr "" +msgstr "Impossible de transférer sans une broche MOSI ou MISO" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" @@ -771,10 +773,13 @@ msgstr "Impossible de faire varier la fréquence sur un minuteur déjà utilisé #: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge, only level" msgstr "" +"Impossible de réveiller via une bordure d'une broche, seulement via un niveau" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." -msgstr "Ne peut reveillé sur le board de broche. Seuleument à niveau." +msgstr "" +"Impossible de réveiller via une bordure d'une broche. Seulement via un " +"niveau." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -782,7 +787,7 @@ msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "Le code principal de CircuitPython s'est écrasé durement. Oups !\n" +msgstr "Le code principal de CircuitPython s'est complètement planté. Oups !\n" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap." @@ -1027,7 +1032,7 @@ msgstr "" #: shared-bindings/bitmaptools/__init__.c msgid "For RGB colorspaces, input bitmap must have 16 bits per pixel" msgstr "" -"Avec l'espace de couleur RGB, l'image d'entrée doit avoir 16 bits par pixel" +"Avec l'espace de couleur RVB, l'image d'entrée doit avoir 16 bits par pixel" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" @@ -1295,7 +1300,7 @@ msgstr "Ce calque est déjà dans un groupe" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass" -msgstr "" +msgstr "Le calque doit être une sous-classe de Group ou TileGrid" #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" @@ -1521,7 +1526,7 @@ msgstr "Aucun out dans le programme" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c msgid "No pull up found on SDA or SCL; check your wiring" -msgstr "Aucun pull up trouvé sur SDA ou SCL; vérifiez votre cablage" +msgstr "Aucun pull up trouvé sur SDA ou SCL; vérifiez votre câblage" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1579,7 +1584,7 @@ msgstr "Le nombre de data_pins doit être 8 ou 16, et non %d" msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" -"L'objet a été désinitialisé et ne peut plus être utilisé. Créez un nouvel " +"L'objet a été dés-initialisé et ne peut plus être utilisé. Créez un nouvel " "objet." #: ports/nrf/common-hal/busio/UART.c @@ -1630,7 +1635,7 @@ msgstr "" #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." -msgstr "Seulement une TouchAlarm peu être réglée en someil profond." +msgstr "Seulement une TouchAlarm peu être réglée en sommeil profond." #: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c msgid "Only one address is allowed" @@ -1780,7 +1785,8 @@ msgstr "" #: main.c msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" msgstr "" -"Feinte de someil profond jusqu'à l'alarme, CTRL-C ou écriture au fichier.\n" +"Feinte un sommeil profond jusqu'à l'alarme, CTRL-C ou l'écriture d'un " +"fichier.\n" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Program does IN without loading ISR" @@ -1818,7 +1824,7 @@ msgstr "Erreur d'initialisation du RNG" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RS485" -msgstr "" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -2241,7 +2247,7 @@ msgstr "Erreur de sécurité inconnue : 0x%04x" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown system firmware error at %s:%d: %d" -msgstr "" +msgstr "Erreur du firmware système inconnue à %s:%d : %d" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -2314,7 +2320,7 @@ msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n" #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" -"WatchDogTimer ne peut pas être désinitialisé une fois que le mode est réglé " +"WatchDogTimer ne peut pas être dés-initialisé une fois que le mode est réglé " "sur RESET" #: shared-bindings/watchdog/WatchDogTimer.c @@ -2367,8 +2373,8 @@ msgstr "Vous êtres en mode sûr parce que :\n" msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -"Vous avez pressé le bouton de reset pendant le démarrage. Pressez le à " -"nouveau pour sortir du mode sûr." +"Vous avez pressé le bouton reset pendant le démarrage. Pressez-le à nouveau " +"pour sortir du mode sûr." #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2518,7 +2524,7 @@ msgstr "tampon est plus petit que la taille demandée" #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "buffer size must be a multiple of element size" -msgstr "taille du tampon doit être un multiple de la taille de l'élement" +msgstr "taille du tampon doit être un multiple de la taille de l’élément" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -2564,11 +2570,11 @@ msgstr "ne peut avoir qu'un seul parent" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "il peut y avoir jusqu'à 4 paramètres pour l'assemblage Thumb" +msgstr "il ne peut pas y avoir plus de 4 paramètres pour l'assemblage Thumb" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "maximum 4 paramètres pour l'assembleur Xtensa" +msgstr "il ne peut pas y avoir plus de 4 paramètres pour l'assemblage Xtensa" #: py/objtype.c msgid "can't add special method to already-subclassed class" @@ -2659,7 +2665,7 @@ msgstr "impossible de charger avec l'indice '%q'" #: py/builtinimport.c msgid "can't perform relative import" -msgstr "" +msgstr "ne peut importer relativement" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" @@ -2772,7 +2778,9 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "tampon color doit être un bytearray ou une matrice de type 'b' ou 'B'" +msgstr "" +"le tampon de couleurs doit être un bytearray ou une matrice de type 'b' ou " +"'B'" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -3082,7 +3090,7 @@ msgstr "fonction définie que pour les ndarrays" #: extmod/ulab/code/numpy/carray/carray.c msgid "function is implemented for ndarrays only" -msgstr "" +msgstr "la fonction n'est implémentée que pour les ndarrays" #: py/argcheck.c #, c-format @@ -3220,7 +3228,7 @@ msgstr "les données d'entrée doivent être un itérable" #: extmod/ulab/code/numpy/vector.c msgid "input dtype must be float or complex" -msgstr "" +msgstr "le dtype d'entrée doit être un flottant ou un complexe" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "input matrix is asymmetric" @@ -3273,7 +3281,7 @@ msgstr "les entrées ne sont pas itérables" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "l'argument 2 de int() doit être >=2 et <=36" +msgstr "Le deuxième argument de int() doit être compris entre 2 et 36 inclus" #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" @@ -3356,7 +3364,8 @@ msgstr "l'argument 1 de issubclass() doit être une classe" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" -"l'argument 2 de issubclass() doit être une classe ou un tuple de classes" +"le deuxième argument de issubclass() doit être une classe ou un tuple de " +"classes" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "iterations did not converge" @@ -3419,7 +3428,7 @@ msgstr "loopback + silent mode non pris en charge par le périphérique" #: ports/espressif/common-hal/mdns/Server.c msgid "mDNS already initialized" -msgstr "" +msgstr "mDNS a déjà été initialisé" #: ports/espressif/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" @@ -3710,7 +3719,8 @@ msgstr "offset doit être >= 0" #: extmod/ulab/code/numpy/create.c msgid "offset must be non-negative and no greater than buffer length" -msgstr "offset doit être non-négatif, et au plus la taille du tampon" +msgstr "" +"offset ne doit pas être négatif, et pas plus grand que la taille du tampon" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -3766,8 +3776,7 @@ msgstr "ord attend un caractère" #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" -"ord() attend un caractère mais une chaîne de caractère de longueur %d a été " -"trouvée" +"ord() attend un caractère mais une chaîne de %d caractères a été trouvée" #: extmod/ulab/code/utils/utils.c msgid "out array is too small" From 2879cc21b33008c0d09e0295588d8c85659b1161 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 1 Jul 2022 23:40:48 +0000 Subject: [PATCH 035/108] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (985 of 985 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b6124350e3..b89963bf8f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-06-16 08:18+0000\n" +"PO-Revision-Date: 2022-07-03 00:22+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: main.c msgid "" @@ -1200,7 +1200,7 @@ msgstr "Erro interno #%d" #: supervisor/shared/safe_mode.c msgid "Internal watchdog timer expired." -msgstr "" +msgstr "O temporizador do watchdog interno expirou." #: py/argcheck.c msgid "Invalid %q" From 046af7629eb07497e5ffb42ff2678549000de0f8 Mon Sep 17 00:00:00 2001 From: thetazero Date: Tue, 5 Jul 2022 12:03:04 -0400 Subject: [PATCH 036/108] Correct typo --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index fc7b116595..37800e689f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -70,7 +70,7 @@ The test suite in the top level `tests` directory. It needs the unix port to ru Then you can run the test suite: cd ../../tests - ./run-tests + ./run-tests.py A successful run will say something like From cd77517b2f95271a709bb9d6a2726256da7960e0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 5 Jul 2022 16:35:42 -0700 Subject: [PATCH 037/108] Add build for ESP32-S3 Box Lite --- .../boards/espressif_esp32s3_box_lite/board.c | 109 ++++++++++++++++++ .../mpconfigboard.h | 30 +++++ .../mpconfigboard.mk | 17 +++ .../boards/espressif_esp32s3_box_lite/pins.c | 67 +++++++++++ .../espressif_esp32s3_box_lite/sdkconfig | 37 ++++++ 5 files changed, 260 insertions(+) create mode 100644 ports/espressif/boards/espressif_esp32s3_box_lite/board.c create mode 100644 ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h create mode 100644 ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk create mode 100644 ports/espressif/boards/espressif_esp32s3_box_lite/pins.c create mode 100644 ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/board.c b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c new file mode 100644 index 0000000000..1f439e52fb --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c @@ -0,0 +1,109 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +uint8_t display_init_sequence[] = { + 0x01, 0x80, 0x96, // _SWRESET and Delay 150ms + 0x11, 0x80, 0xFF, // _SLPOUT and Delay 500ms + 0x3A, 0x81, 0x55, 0x0A, // _COLMOD and Delay 10ms + 0x13, 0x80, 0x0A, // _NORON and Delay 10ms + 0x36, 0x01, 0xC8, // _MADCTL + 0x29, 0x80, 0xFF, // _DISPON and Delay 500ms +}; + +void board_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_GPIO7, &pin_GPIO6, NULL, false); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_GPIO4, // TFT_DC Command or data + &pin_GPIO5, // TFT_CS Chip select + &pin_GPIO48, // TFT_RST Reset + 60000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 320, // Width + 240, // Height + 0, // column start + 0, // row start + 0, // rotation + 16, // Color depth + false, // Grayscale + false, // pixels in a byte share a row. Only valid for depths < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO45, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + false, // backlight_on_high + false, // SH1107_addressing + 50000); // backlight pwm frequency + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h new file mode 100644 index 0000000000..fddcddc7c3 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h @@ -0,0 +1,30 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "ESP32-S3-Box-Lite" +#define MICROPY_HW_MCU_NAME "ESP32S3" diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk new file mode 100644 index 0000000000..647ad3440a --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x7005 +USB_PRODUCT = "ESP32-S3-Box-Lite" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/pins.c b/ports/espressif/boards/espressif_esp32s3_box_lite/pins.c new file mode 100644 index 0000000000..73ef15697c --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/pins.c @@ -0,0 +1,67 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // First PMOD connector + { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_U0TXD), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_G43), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_U0RXD), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_G44), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_G13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_G12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_G14), MP_ROM_PTR(&pin_GPIO14) }, + + // Second PMOD connector + { MP_ROM_QSTR(MP_QSTR_G38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_G39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_G40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_G41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_G42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_G21), MP_ROM_PTR(&pin_GPIO21) }, + + // LCD & touchscreen + { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_LCD_SCK), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO48) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CTRL), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_CTP_INT), MP_ROM_PTR(&pin_GPIO3) }, + + // Audio + { MP_ROM_QSTR(MP_QSTR_I2S_ADC_SDOUT), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_I2S_MCLK), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCLK), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_I2S_LRCK), MP_ROM_PTR(&pin_GPIO47) }, + { MP_ROM_QSTR(MP_QSTR_I2S_CODEC_DSDIN), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_PA_CTRL), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_MUTE_STATUS), MP_ROM_PTR(&pin_GPIO1) }, + + // Internal I2C bus + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + + // boot button, also usable as a software button + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig b/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig new file mode 100644 index 0000000000..7fcf8ef297 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=-1 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP From d83720f6595c16df580acb67918f73bc2df8e721 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 5 Jul 2022 17:02:52 -0700 Subject: [PATCH 038/108] Tweak display init --- ports/espressif/boards/espressif_esp32s3_box_lite/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/board.c b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c index 1f439e52fb..dbd3c17313 100644 --- a/ports/espressif/boards/espressif_esp32s3_box_lite/board.c +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c @@ -37,8 +37,9 @@ uint8_t display_init_sequence[] = { 0x01, 0x80, 0x96, // _SWRESET and Delay 150ms 0x11, 0x80, 0xFF, // _SLPOUT and Delay 500ms 0x3A, 0x81, 0x55, 0x0A, // _COLMOD and Delay 10ms + 0x21, 0x80, 10, // _INVON 0x13, 0x80, 0x0A, // _NORON and Delay 10ms - 0x36, 0x01, 0xC8, // _MADCTL + 0x36, 0x01, 0x80, // _MADCTL 0x29, 0x80, 0xFF, // _DISPON and Delay 500ms }; From 591390ad850d8d04535211c75e15a778b1d3ea8c Mon Sep 17 00:00:00 2001 From: Maxime Leroy Date: Tue, 5 Jul 2022 05:00:51 +0000 Subject: [PATCH 039/108] Translated using Weblate (French) Currently translated at 99.5% (981 of 985 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index f553567e50..7e282a026c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-07-03 00:22+0000\n" +"PO-Revision-Date: 2022-07-06 05:15+0000\n" "Last-Translator: Maxime Leroy \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -1074,8 +1074,9 @@ msgstr "Groupe déjà utilisé" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c #: ports/raspberrypi/common-hal/busio/SPI.c +#, fuzzy msgid "Half duplex SPI is not implemented" -msgstr "" +msgstr "Le half duplex du SPI n'est pas implémenté" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c @@ -1212,8 +1213,9 @@ msgid "Internal error #%d" msgstr "Erreur interne #%d" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "Internal watchdog timer expired." -msgstr "" +msgstr "Le minuteur du watchdog interne a expiré." #: py/argcheck.c msgid "Invalid %q" @@ -1307,8 +1309,9 @@ msgid "MAC address was invalid" msgstr "Adresse physique (MAC) invalide" #: shared-bindings/is31fl3741/IS31FL3741.c +#, fuzzy msgid "Mapping must be a tuple" -msgstr "" +msgstr "Le mapping doit être un tuple" #: shared-module/displayio/Shape.c #, c-format @@ -1403,8 +1406,9 @@ msgid "New bitmap must be same size as old bitmap" msgstr "La taille du nouveau bitmap doit être la même que l'ancien" #: ports/espressif/common-hal/_bleio/__init__.c +#, fuzzy msgid "Nimble out of memory" -msgstr "" +msgstr "Nimble n'a plus de mémoire" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c @@ -1912,7 +1916,7 @@ msgstr "Périphérique SPI utilisé" #: ports/stm/common-hal/busio/SPI.c msgid "SPI re-init" -msgstr "" +msgstr "Ré-initialisation du SPI" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2118,7 +2122,7 @@ msgstr "Paramètre de type tuple ou struct_time requis" #: ports/stm/common-hal/busio/UART.c msgid "UART de-init" -msgstr "" +msgstr "Dé-initialisation du UART" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c @@ -2127,7 +2131,7 @@ msgstr "Initialisation UART" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" -msgstr "" +msgstr "Ré-initialisation du UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write" @@ -2745,7 +2749,7 @@ msgstr "typage" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "channel re-init" -msgstr "" +msgstr "Ré-initialisation du canal" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -3834,7 +3838,7 @@ msgstr "" #: extmod/vfs_posix_file.c msgid "poll on file not available on win32" -msgstr "" +msgstr "le polling sur un fichier n'est pas disponible sous win32" #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" @@ -4128,7 +4132,7 @@ msgstr "Délai d’expiration dépassé en attendant une carte v2" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "timer re-init" -msgstr "" +msgstr "Ré-initialisation du miniteur" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" From a4035aa1f73ea1033743d918948d80a71b88dab5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 6 Jul 2022 17:05:14 -0700 Subject: [PATCH 040/108] websocket serial kinda works --- .../shared/web_workflow/static/serial.js | 10 +++--- supervisor/shared/web_workflow/web_workflow.c | 3 +- supervisor/shared/web_workflow/websocket.c | 34 ++++++++++++++----- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js index 36c980dc08..5fb80b59fa 100644 --- a/supervisor/shared/web_workflow/static/serial.js +++ b/supervisor/shared/web_workflow/static/serial.js @@ -5,7 +5,7 @@ function onSubmit() { var input = document.getElementById("input"); // You can send message to the Web Socket using ws.send. ws.send(input.value); - output("send: " + input.value); + // output("send: " + input.value); input.value = ""; input.focus(); } @@ -25,19 +25,19 @@ ws = new WebSocket("ws://cpy-f57ce8.local/cp/serial/"); // Set event handlers. ws.onopen = function() { - output("onopen"); + console.log("onopen"); }; ws.onmessage = function(e) { // e.data contains received string. - output("onmessage: " + e.data); + output(e.data); }; ws.onclose = function() { - output("onclose"); + console.log("onclose"); }; ws.onerror = function(e) { - output("onerror"); + // output("onerror"); console.log(e) }; diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 07298c17e9..c7bf673fdc 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -1059,6 +1059,7 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } static void _reset_request(_request *request) { + ESP_LOGI(TAG, "reset request"); request->state = STATE_METHOD; request->origin[0] = '\0'; request->content_length = 0; @@ -1244,7 +1245,7 @@ void supervisor_web_workflow_background(void) { // If we have a request in progress, continue working on it. if (common_hal_socketpool_socket_get_connected(&active)) { - ESP_LOGI(TAG, "active connected"); + // ESP_LOGI(TAG, "active connected %d", active_request.in_progress); _process_request(&active, &active_request); } } diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 8aec9d206c..446f2073c3 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -32,8 +32,8 @@ typedef struct { uint8_t frame_len; uint8_t payload_len_size; bool masked; - uint32_t mask; - size_t frame_index; + uint8_t mask[4]; + int frame_index; size_t payload_remaining; } _websocket; @@ -96,27 +96,38 @@ static void _read_next_frame_header(void) { ESP_LOGI(TAG, "mask %d length %x", cp_serial.masked, len); } - while (cp_serial.frame_index > 1 && + while (cp_serial.frame_index >= 2 && cp_serial.frame_index < (cp_serial.payload_len_size + 2) && _read_byte(&h)) { cp_serial.frame_index++; - cp_serial.payload_remaining = cp_serial.payload_remaining << 8 | c; + cp_serial.payload_remaining = cp_serial.payload_remaining << 8 | h; } - while (cp_serial.frame_index > (cp_serial.payload_len_size + 2) && + int mask_start = cp_serial.payload_len_size + 2; + while (cp_serial.frame_index >= mask_start && cp_serial.frame_index < cp_serial.frame_len && _read_byte(&h)) { + size_t mask_offset = cp_serial.frame_index - mask_start; + cp_serial.mask[mask_offset] = h; cp_serial.frame_index++; - cp_serial.mask = cp_serial.mask << 8 | c; + ESP_LOGI(TAG, "mask %08x", (uint32_t)*cp_serial.mask); } } static bool _read_next_payload_byte(uint8_t *c) { _read_next_frame_header(); - if (cp_serial.frame_index > cp_serial.frame_len && + if (cp_serial.frame_index >= cp_serial.frame_len && cp_serial.payload_remaining > 0) { if (_read_byte(c)) { + uint8_t mask_offset = (cp_serial.frame_index - cp_serial.frame_len) % 4; + ESP_LOGI(TAG, "payload byte read %02x mask offset %d", *c, mask_offset); + *c ^= cp_serial.mask[mask_offset]; + ESP_LOGI(TAG, "byte unmasked %02x", *c); cp_serial.frame_index++; cp_serial.payload_remaining--; + ESP_LOGI(TAG, "payload remaining %d", cp_serial.payload_remaining); + if (cp_serial.payload_remaining == 0) { + cp_serial.frame_index = 0; + } return true; } } @@ -132,7 +143,9 @@ bool websocket_available(void) { } char websocket_read_char(void) { - return _read_next_payload_byte(); + uint8_t c; + _read_next_payload_byte(&c); + return c; } static void _send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { @@ -171,7 +184,10 @@ static void _websocket_send(_websocket *ws, const char *text, size_t len) { _send_raw(&ws->socket, (const uint8_t *)&len, 4); } _send_raw(&ws->socket, (const uint8_t *)text, len); - ESP_LOGI(TAG, "sent over websocket: %s", text); + char copy[len]; + memcpy(copy, text, len); + copy[len] = '\0'; + ESP_LOGI(TAG, "sent over websocket: %s", copy); } void websocket_write(const char *text, size_t len) { From 4e88d795e17b183aedb698a891f8feb14d2342f6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 6 Jul 2022 23:01:19 -0400 Subject: [PATCH 041/108] Thonny causing crash emitglue.c:199: --- .../adafruit_feather_esp32_v2/sdkconfig | 269 +++++++++++++++++- ports/espressif/common-hal/busio/UART.c | 6 +- ports/espressif/supervisor/port.c | 11 + py/circuitpy_mpconfig.h | 4 + supervisor/shared/workflow.c | 22 +- 5 files changed, 295 insertions(+), 17 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index 94333b1591..0b2491f3b3 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -1,4 +1,4 @@ - +# Automatically generated file. DO NOT EDIT. # Espressif IoT Development Framework (ESP-IDF) Project Configuration # # Bootloader config @@ -12,6 +12,9 @@ CONFIG_BOOTLOADER_LOG_LEVEL=0 # Serial flasher config # # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set # end of Serial flasher config # @@ -24,23 +27,283 @@ CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # # Compiler options # -# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 # end of Compiler options # # Component config # +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set +# end of Bluetooth + +# +# Driver configurations +# +# +# TWAI configuration +# +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set +# end of TWAI configuration + +# +# UART configuration +# +CONFIG_UART_ISR_IN_IRAM=y +# end of UART configuration + +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + +# end of Driver configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# end of ESP-TLS + # # ESP32-specific # +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y CONFIG_ESP32_SPIRAM_SUPPORT=y -CONFIG_UART_ISR_IN_IRAM=y +# +# SPI RAM config +# +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=-1 +CONFIG_SPIRAM_SPEED_40M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y +# +# SPIRAM cache workaround debugging +# +CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set +# end of SPIRAM cache workaround debugging + +# +# SPIRAM workaround libraries placement +# +CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y +# end of SPIRAM workaround libraries placement + +CONFIG_SPIRAM_BANKSWITCH_ENABLE=y +CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set +# +# PSRAM clock and cs IO for ESP32-DOWD +# +CONFIG_D0WD_PSRAM_CLK_IO=17 +CONFIG_D0WD_PSRAM_CS_IO=16 +# end of PSRAM clock and cs IO for ESP32-DOWD + +# +# PSRAM clock and cs IO for ESP32-D2WD +# +CONFIG_D2WD_PSRAM_CLK_IO=9 +CONFIG_D2WD_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-D2WD + +# +# PSRAM clock and cs IO for ESP32-PICO +# +CONFIG_PICO_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-PICO + +# CONFIG_SPIRAM_CUSTOM_SPIWP_SD3_PIN is not set +CONFIG_SPIRAM_SPIWP_SD3_PIN=7 +# CONFIG_SPIRAM_2T_MODE is not set +# end of SPI RAM config + # end of ESP32-specific +# +# ADC-Calibration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# end of ADC-Calibration + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# Ethernet +# +# CONFIG_ETH_USE_ESP32_EMAC is not set +# end of Ethernet + +# +# PHY +# +CONFIG_ESP_PHY_REDUCE_TX_POWER=y +# end of PHY + +# +# ESP System Settings +# +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +CONFIG_ESP_CONSOLE_UART_CUSTOM=y +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_TX_GPIO=8 +CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +# end of ESP System Settings + +# +# High resolution timer (esp_timer) +# +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of High resolution timer (esp_timer) + +# +# Wi-Fi +# +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set +# end of Wi-Fi + +# +# FreeRTOS +# +# CONFIG_FREERTOS_FPU_IN_ISR is not set +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" # end of LWIP +# +# mbedTLS +# +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# end of mbedTLS + +# +# Supplicant +# +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# end of Supplicant + # end of Component config + +# +# Deprecated options for backward compatibility +# +CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +CONFIG_LOG_BOOTLOADER_LEVEL=0 +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +CONFIG_SPIRAM_SUPPORT=y +# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +CONFIG_ESP32S2_PANIC_PRINT_HALT=y +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +CONFIG_CONSOLE_UART_CUSTOM=y +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_CUSTOM_NUM_0=y +# CONFIG_CONSOLE_UART_CUSTOM_NUM_1 is not set +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_TX_GPIO=8 +CONFIG_CONSOLE_UART_RX_GPIO=7 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +# end of Deprecated options for backward compatibility diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 740a327a47..cdaf25250f 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -41,7 +41,7 @@ #include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" -uint8_t never_reset_uart_mask = 0; +static uint8_t never_reset_uart_mask = 0; static void uart_event_task(void *param) { busio_uart_obj_t *self = param; @@ -74,13 +74,13 @@ static void uart_event_task(void *param) { void uart_reset(void) { for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { - // Ignore the UART used by the IDF. #ifdef CONFIG_ESP_CONSOLE_UART_NUM + // Do not reset the UART used by the IDF for logging. if (num == CONFIG_ESP_CONSOLE_UART_NUM) { continue; } #endif - if (uart_is_driver_installed(num) && !(never_reset_uart_mask & 1 << num)) { + if (uart_is_driver_installed(num) && !(never_reset_uart_mask & (1 << num))) { uart_driver_delete(num); } } diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 38ca3573e6..57f34a6430 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -166,6 +166,17 @@ safe_mode_t port_init(void) { #define DEBUG (0) #endif + #define pin_GPIOn(n) pin_GPIO##n + #define pin_GPIOn_EXPAND(x) pin_GPIOn(x) + + #ifdef CONFIG_CONSOLE_UART_TX_GPIO + common_hal_never_reset_pin(&pin_GPIOn_EXPAND(CONFIG_CONSOLE_UART_TX_GPIO)); + #endif + + #ifdef CONFIG_CONSOLE_UART_RX_GPIO + common_hal_never_reset_pin(&pin_GPIOn_EXPAND(CONFIG_CONSOLE_UART_RX_GPIO)); + #endif + #if DEBUG // debug UART #ifdef CONFIG_IDF_TARGET_ESP32C3 diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index c26e34aab9..1ef6bcbfb8 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -297,6 +297,10 @@ typedef long mp_off_t; #define BOARD_UART_ROOT_POINTER mp_obj_t board_uart_bus; #endif +#if MICROPY_PY_ASYNC_AWAIT && !CIRCUITPY_TRACEBACK +#error CIRCUITPY_ASYNCIO requires CIRCUITPY_TRACEBACK +#endif + #if defined(CIRCUITPY_CONSOLE_UART_RX) || defined(CIRCUITPY_CONSOLE_UART_TX) #if !(defined(CIRCUITPY_CONSOLE_UART_RX) && defined(CIRCUITPY_CONSOLE_UART_TX)) #error Both CIRCUITPY_CONSOLE_UART_RX and CIRCUITPY_CONSOLE_UART_TX must be defined if one is defined. diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 335f0f3b97..202b11ec71 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -47,17 +47,17 @@ static background_callback_t workflow_background_cb; static void supervisor_workflow_update_status_bar(void) { - // Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code - // doesn't get terminated after two following characters and the value is invalid. - // This is the OSC command to set the title and the icon text. It can be up to 255 characters - // but some may be cut off. - serial_write("\x1b" "]0;"); - serial_write("🐍 "); - #if CIRCUITPY_WEB_WORKFLOW - supervisor_web_workflow_status(); - #endif - // Send string terminator - serial_write("\x1b" "\\"); + // // Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code + // // doesn't get terminated after two following characters and the value is invalid. + // // This is the OSC command to set the title and the icon text. It can be up to 255 characters + // // but some may be cut off. + // serial_write("\x1b" "]0;"); + // serial_write("🐍 "); + // #if CIRCUITPY_WEB_WORKFLOW + // supervisor_web_workflow_status(); + // #endif + // // Send string terminator + // serial_write("\x1b" "\\"); } static void workflow_background(void *data) { From 432ea886e737c956fb83e7b7155ea45f64792b8f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 13:26:10 -0500 Subject: [PATCH 042/108] update ulab to 5.0.9 --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 5d01882c41..308627c9aa 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 5d01882c41dbc4115bc94f0b61c093d5a6b812b6 +Subproject commit 308627c9aa862698725b2ba22fa2e8b2300e6803 From 1c3655c07b2e2345c8095be490f1cec00753f77a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 13:28:54 -0500 Subject: [PATCH 043/108] update translations --- locale/circuitpython.pot | 55 ++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5740e1e288..465eabe0e4 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2352,6 +2352,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2719,6 +2723,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2810,6 +2818,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2913,7 +2925,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3061,7 +3073,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3128,6 +3140,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3136,11 +3152,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3341,7 +3353,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3590,7 +3602,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3740,6 +3752,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4175,6 +4188,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4216,7 +4237,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4224,6 +4255,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" From 8d816db108892ffe592ff83adbe4c86caaf0de86 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 13:42:03 -0500 Subject: [PATCH 044/108] update expected results of help(modules) --- tests/unix/extra_coverage.py.exp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 98e56439ef..582d90e1bc 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -38,12 +38,12 @@ hashlib json math qrio rainbowio re sys termios traceback ubinascii uctypes uerrno uheapq uio ujson ulab -ulab.fft ulab.linalg ulab.numpy ulab.scipy -ulab.scipy.linalg ulab.scipy.optimize -ulab.scipy.signal ulab.scipy.special -ulab.utils uos urandom ure -uselect ustruct utime utimeq -uzlib zlib +ulab.numpy ulab.numpy.fft ulab.numpy.linalg +ulab.scipy ulab.scipy.linalg +ulab.scipy.optimize ulab.scipy.signal +ulab.scipy.special ulab.utils uos +urandom ure uselect ustruct +utime utimeq uzlib zlib ime utime utimeq From 601eb91b89b33806e1af78ed3ff7bb83a29cf1d3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 17:00:00 -0500 Subject: [PATCH 045/108] Disable gifio on matrixportal to reclaim flash space --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk index 8fccfa8f29..6db1a3c93a 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_LTO_PARTITION = one CIRCUITPY_AESIO = 0 +CIRCUITPY_GIFIO = 0 CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_SDCARDIO = 0 From 989acab11ab904d822f6c1c49f897941e77e18bc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 17:16:48 -0500 Subject: [PATCH 046/108] Pull in a fix for ulab on REPR_A builds (some broadcom builds) --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 308627c9aa..346c936e14 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 308627c9aa862698725b2ba22fa2e8b2300e6803 +Subproject commit 346c936e14c6ea3a8d3d65cb1fa46202dc92999d From c4dfd8e30a50063db43a004c2cd6f2d0eba366a5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 17:17:15 -0500 Subject: [PATCH 047/108] Fix default BOARD setting & messages It's important that these lines NOT be indented with tabs, because that provokes Make to say that commands appear before a target. --- ports/broadcom/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 9731f819eb..757e7f3450 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -1,12 +1,12 @@ # Select the board to build for. -BOARD=raspberrypi_pi4 +BOARD?=raspberrypi_pi4b ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(error You must provide a BOARD parameter) else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) - endif + ifeq ($(wildcard boards/$(BOARD)/.),) + $(error Invalid BOARD "$(BOARD)" specified) + endif endif # If the build directory is not given, make it reflect the board name. From 9c2633820cbd22054666ff88a2c6752a064fd924 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Fri, 8 Jul 2022 00:18:36 +0200 Subject: [PATCH 048/108] Upgrade the pewpew-lcd frozen library to tag 1.0.1 --- frozen/pew-pewpew-lcd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/pew-pewpew-lcd b/frozen/pew-pewpew-lcd index 837f3e5f16..6452f2a78f 160000 --- a/frozen/pew-pewpew-lcd +++ b/frozen/pew-pewpew-lcd @@ -1 +1 @@ -Subproject commit 837f3e5f16accae5b3677954921b5ddd517f0799 +Subproject commit 6452f2a78f32cf3b5d07e699f26d25e9c4d10d09 From 8d9c9952981d5c8eb10f7db2da587a8aabc360bd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 7 Jul 2022 16:55:04 -0700 Subject: [PATCH 049/108] Support ping & close. Refine html and js for serial --- .../shared/web_workflow/static/serial.html | 8 +-- .../shared/web_workflow/static/serial.js | 36 +++++++++- supervisor/shared/web_workflow/websocket.c | 68 +++++++++++++++---- 3 files changed, 89 insertions(+), 23 deletions(-) diff --git a/supervisor/shared/web_workflow/static/serial.html b/supervisor/shared/web_workflow/static/serial.html index 766a7a23e2..d8ab86a7c8 100644 --- a/supervisor/shared/web_workflow/static/serial.html +++ b/supervisor/shared/web_workflow/static/serial.html @@ -7,10 +7,8 @@

-  
- - - -
+ + + diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js index 5fb80b59fa..ab0893ad08 100644 --- a/supervisor/shared/web_workflow/static/serial.js +++ b/supervisor/shared/web_workflow/static/serial.js @@ -1,8 +1,20 @@ var ws; +var input = document.getElementById("input"); +var title = document.querySelector("title"); + +function set_enabled(enabled) { + input.disabled = !enabled; + var buttons = document.querySelectorAll("button"); + for (button of buttons) { + button.disabled = !enabled; + } +} + +set_enabled(false); function onSubmit() { - var input = document.getElementById("input"); + console.log("submit"); // You can send message to the Web Socket using ws.send. ws.send(input.value); // output("send: " + input.value); @@ -11,6 +23,7 @@ function onSubmit() { } function onCloseClick() { + console.log("close clicked"); ws.close(); } @@ -26,18 +39,35 @@ ws = new WebSocket("ws://cpy-f57ce8.local/cp/serial/"); // Set event handlers. ws.onopen = function() { console.log("onopen"); + set_enabled(true); }; +var setting_title = false; ws.onmessage = function(e) { // e.data contains received string. - output(e.data); + if (e.data == "\x1b]0;") { + setting_title = true; + title.textContent = ""; + } else if (e.data == "\x1b\\") { + setting_title = false; + } else if (setting_title) { + title.textContent += e.data; + } else { + output(e.data); + } }; ws.onclose = function() { console.log("onclose"); + set_enabled(false); }; ws.onerror = function(e) { // output("onerror"); - console.log(e) + console.log(e); + set_enabled(false); }; + +input.onbeforeinput = function(e) { + console.log(e); +} diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 446f2073c3..0f4c4fc84c 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -32,6 +32,7 @@ typedef struct { uint8_t frame_len; uint8_t payload_len_size; bool masked; + bool closed; uint8_t mask[4]; int frame_index; size_t payload_remaining; @@ -49,6 +50,10 @@ void websocket_init(void) { void websocket_handoff(socketpool_socket_obj_t *socket) { ESP_LOGI(TAG, "socket handed off"); cp_serial.socket = *socket; + cp_serial.closed = false; + cp_serial.opcode = 0; + cp_serial.frame_index = 0; + cp_serial.frame_len = 2; // Mark the original socket object as closed without telling the lower level. socket->connected = false; socket->num = -1; @@ -56,7 +61,7 @@ void websocket_handoff(socketpool_socket_obj_t *socket) { } bool websocket_connected(void) { - return common_hal_socketpool_socket_get_connected(&cp_serial.socket); + return !cp_serial.closed && common_hal_socketpool_socket_get_connected(&cp_serial.socket); } static bool _read_byte(uint8_t *c) { @@ -70,6 +75,16 @@ static bool _read_byte(uint8_t *c) { return true; } +static void _send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { + int sent = -EAGAIN; + while (sent == -EAGAIN) { + sent = socketpool_socket_send(socket, buf, len); + } + if (sent < len) { + ESP_LOGE(TAG, "short send on %d err %d len %d", socket->num, sent, len); + } +} + static void _read_next_frame_header(void) { uint8_t h; if (cp_serial.frame_index == 0 && _read_byte(&h)) { @@ -111,20 +126,53 @@ static void _read_next_frame_header(void) { cp_serial.frame_index++; ESP_LOGI(TAG, "mask %08x", (uint32_t)*cp_serial.mask); } + // Reply to PINGs and CLOSE. + while ((cp_serial.opcode == 0x8 || + cp_serial.opcode == 0x9) && + cp_serial.frame_index >= cp_serial.frame_len) { + + if (cp_serial.frame_index == cp_serial.frame_len) { + uint8_t opcode = 0x8; // CLOSE + if (cp_serial.opcode == 0x9) { + ESP_LOGI(TAG, "websocket ping"); + opcode = 0xA; // PONG + } + uint8_t frame_header[2]; + frame_header[0] = 1 << 7 | opcode; + if (cp_serial.payload_remaining > 125) { + ESP_LOGE(TAG, "CLOSE or PING has long payload"); + } + frame_header[1] = cp_serial.payload_remaining; + _send_raw(&cp_serial.socket, (const uint8_t *)frame_header, 2); + } + + if (cp_serial.payload_remaining > 0 && _read_byte(&h)) { + // Send the payload back to the client. + cp_serial.frame_index++; + cp_serial.payload_remaining--; + _send_raw(&cp_serial.socket, &h, 1); + } + + if (cp_serial.payload_remaining == 0) { + cp_serial.frame_index = 0; + if (cp_serial.opcode == 0x8) { + ESP_LOGI(TAG, "websocket closed"); + cp_serial.closed = true; + } + } + } } static bool _read_next_payload_byte(uint8_t *c) { _read_next_frame_header(); - if (cp_serial.frame_index >= cp_serial.frame_len && + if (cp_serial.opcode == 0x1 && + cp_serial.frame_index >= cp_serial.frame_len && cp_serial.payload_remaining > 0) { if (_read_byte(c)) { uint8_t mask_offset = (cp_serial.frame_index - cp_serial.frame_len) % 4; - ESP_LOGI(TAG, "payload byte read %02x mask offset %d", *c, mask_offset); *c ^= cp_serial.mask[mask_offset]; - ESP_LOGI(TAG, "byte unmasked %02x", *c); cp_serial.frame_index++; cp_serial.payload_remaining--; - ESP_LOGI(TAG, "payload remaining %d", cp_serial.payload_remaining); if (cp_serial.payload_remaining == 0) { cp_serial.frame_index = 0; } @@ -148,16 +196,6 @@ char websocket_read_char(void) { return c; } -static void _send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { - int sent = -EAGAIN; - while (sent == -EAGAIN) { - sent = socketpool_socket_send(socket, buf, len); - } - if (sent < len) { - ESP_LOGE(TAG, "short send %d %d", sent, len); - } -} - static void _websocket_send(_websocket *ws, const char *text, size_t len) { if (!websocket_connected()) { return; From ab3e78661157c08b68d3290b5d84a3b1a2bc8c07 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jul 2022 20:00:12 -0500 Subject: [PATCH 050/108] disable additional module on matrixportal_m4 --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk index 6db1a3c93a..e502f6b569 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_LTO_PARTITION = one CIRCUITPY_AESIO = 0 +CIRCUITPY_FLOPPYIO = 0 CIRCUITPY_GIFIO = 0 CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PARALLELDISPLAY = 0 From d3e1d1b10406f096608191758de7bebfefdade44 Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Thu, 7 Jul 2022 19:42:11 -0700 Subject: [PATCH 051/108] Fix #6559 --- ports/espressif/common-hal/wifi/Radio.c | 8 ++++---- shared-bindings/wifi/Radio.c | 6 +++--- shared-bindings/wifi/Radio.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 698da291e7..9715894f78 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -139,14 +139,14 @@ void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t esp_wifi_set_mac(ESP_IF_WIFI_STA, mac); } -uint8_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { +float common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { int8_t tx_power; esp_wifi_get_max_tx_power(&tx_power); - return tx_power / 4; + return tx_power / 4.0; } -void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const uint8_t tx_power) { - esp_wifi_set_max_tx_power(tx_power * 4); +void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const float tx_power) { + esp_wifi_set_max_tx_power(tx_power * 4.0); } mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self) { diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index a0a4df2548..bcd998d806 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -138,17 +138,17 @@ MP_PROPERTY_GETSET(wifi_radio_mac_address_obj, (mp_obj_t)&wifi_radio_get_mac_address_obj, (mp_obj_t)&wifi_radio_set_mac_address_obj); -//| tx_power: int +//| tx_power: float //| """Wifi transmission power, in dBm.""" //| STATIC mp_obj_t wifi_radio_get_tx_power(mp_obj_t self_in) { wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_int(common_hal_wifi_radio_get_tx_power(self)); + return mp_obj_new_float(common_hal_wifi_radio_get_tx_power(self)); } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_tx_power_obj, wifi_radio_get_tx_power); STATIC mp_obj_t wifi_radio_set_tx_power(mp_obj_t self_in, mp_obj_t tx_power_in) { - mp_int_t tx_power = mp_obj_get_int(tx_power_in); + mp_float_t tx_power = mp_obj_get_float(tx_power_in); wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_wifi_radio_set_tx_power(self, tx_power); return mp_const_none; diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index e89e22ebe9..1e389b6c56 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -82,8 +82,8 @@ extern void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const extern mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_mac_address_ap(wifi_radio_obj_t *self, const uint8_t *mac); -extern uint8_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self); -extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const uint8_t power); +extern float common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const float power); extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); From 75208573f41b01a3eba3f86ecfc8238059967b43 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 09:53:29 -0400 Subject: [PATCH 052/108] tweak sdkconfig; add temp logging to mp_make_function_from_raw_code --- .../boards/adafruit_feather_esp32_v2/sdkconfig | 16 +++------------- py/emitglue.c | 3 +++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index 0b2491f3b3..7209675d27 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -106,13 +106,10 @@ CONFIG_SPIRAM_SPEED_40M=y CONFIG_SPIRAM=y CONFIG_SPIRAM_BOOT_INIT=y # CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -# CONFIG_SPIRAM_USE_MEMMAP is not set +CONFIG_SPIRAM_USE_MEMMAP=y # CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -CONFIG_SPIRAM_USE_MALLOC=y +# CONFIG_SPIRAM_USE_MALLOC is not set CONFIG_SPIRAM_MEMTEST=y -CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 -# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set -CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set CONFIG_SPIRAM_CACHE_WORKAROUND=y @@ -143,7 +140,6 @@ CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y CONFIG_SPIRAM_BANKSWITCH_ENABLE=y CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 -# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set # # PSRAM clock and cs IO for ESP32-DOWD # @@ -225,6 +221,7 @@ CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # Wi-Fi # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 @@ -250,12 +247,6 @@ CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" # end of LWIP -# -# mbedTLS -# -# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set -# end of mbedTLS - # # Supplicant # @@ -275,7 +266,6 @@ CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y # CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 CONFIG_SPIRAM_SUPPORT=y -# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set CONFIG_TRACEMEM_RESERVE_DRAM=0x0 # CONFIG_ULP_COPROC_ENABLED is not set CONFIG_ULP_COPROC_RESERVE_MEM=0 diff --git a/py/emitglue.c b/py/emitglue.c index e701d0808f..47d2821bae 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -26,6 +26,8 @@ // This code glues the code emitters to the runtime. +#include "esp_log.h" + #include #include #include @@ -195,6 +197,7 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar break; #endif default: + ESP_LOGI("mp_make_function_from_raw_code", "kind: %d, scope_flags: 0x%x, n_pos_args: %d, fun_data: %p, const_table: %p", rc->kind, rc->scope_flags, rc->n_pos_args, rc->fun_data, rc->const_table); // rc->kind should always be set and BYTECODE is the only remaining case assert(rc->kind == MP_CODE_BYTECODE); fun = mp_obj_new_fun_bc(def_args, def_kw_args, rc->fun_data, rc->const_table); From c3cd32e7737e6c038510521072ed3c996828587d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 10:50:00 -0400 Subject: [PATCH 053/108] CPU freq to 240 MHz, redo sdkconfigs --- .../adafruit_feather_esp32_v2/sdkconfig | 277 +---- .../esp-idf-config/sdkconfig-esp32.defaults | 1063 ++++++++++++++++- 2 files changed, 1051 insertions(+), 289 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index 7209675d27..ad957c841f 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -1,22 +1,3 @@ -# Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) Project Configuration -# -# Bootloader config -# -CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set -CONFIG_BOOTLOADER_LOG_LEVEL=0 -# end of Bootloader config - -# -# Serial flasher config -# -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -# end of Serial flasher config - # # Partition Table # @@ -24,175 +5,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # end of Partition Table -# -# Compiler options -# -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y -# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 -# end of Compiler options - -# -# Component config -# -# -# Bluetooth -# -# CONFIG_BT_ENABLED is not set -# end of Bluetooth - -# -# Driver configurations -# -# -# TWAI configuration -# -# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set -# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set -# end of TWAI configuration - -# -# UART configuration -# -CONFIG_UART_ISR_IN_IRAM=y -# end of UART configuration - -# -# RTCIO configuration -# -# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set -# end of RTCIO configuration - -# -# GPIO Configuration -# -# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set -# end of GPIO Configuration - -# end of Driver configurations - -# -# eFuse Bit Manager -# -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set -CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y -# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set -CONFIG_EFUSE_MAX_BLK_LEN=192 -# end of eFuse Bit Manager - -# -# ESP-TLS -# -# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set -# end of ESP-TLS - -# -# ESP32-specific -# -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y -CONFIG_ESP32_SPIRAM_SUPPORT=y -# -# SPI RAM config -# -CONFIG_SPIRAM_TYPE_AUTO=y -# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_SIZE=-1 -CONFIG_SPIRAM_SPEED_40M=y -CONFIG_SPIRAM=y -CONFIG_SPIRAM_BOOT_INIT=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -CONFIG_SPIRAM_USE_MEMMAP=y -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -# CONFIG_SPIRAM_USE_MALLOC is not set -CONFIG_SPIRAM_MEMTEST=y -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -CONFIG_SPIRAM_CACHE_WORKAROUND=y -# -# SPIRAM cache workaround debugging -# -CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y -# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set -# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set -# end of SPIRAM cache workaround debugging - -# -# SPIRAM workaround libraries placement -# -CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y -CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y -# end of SPIRAM workaround libraries placement - -CONFIG_SPIRAM_BANKSWITCH_ENABLE=y -CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 -# -# PSRAM clock and cs IO for ESP32-DOWD -# -CONFIG_D0WD_PSRAM_CLK_IO=17 -CONFIG_D0WD_PSRAM_CS_IO=16 -# end of PSRAM clock and cs IO for ESP32-DOWD - -# -# PSRAM clock and cs IO for ESP32-D2WD -# -CONFIG_D2WD_PSRAM_CLK_IO=9 -CONFIG_D2WD_PSRAM_CS_IO=10 -# end of PSRAM clock and cs IO for ESP32-D2WD - -# -# PSRAM clock and cs IO for ESP32-PICO -# -CONFIG_PICO_PSRAM_CS_IO=10 -# end of PSRAM clock and cs IO for ESP32-PICO - -# CONFIG_SPIRAM_CUSTOM_SPIWP_SD3_PIN is not set -CONFIG_SPIRAM_SPIWP_SD3_PIN=7 -# CONFIG_SPIRAM_2T_MODE is not set -# end of SPI RAM config - -# end of ESP32-specific - -# -# ADC-Calibration -# -CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y -CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y -CONFIG_ADC_CAL_LUT_ENABLE=y -# end of ADC-Calibration - -# -# Common ESP-related -# -CONFIG_ESP_ERR_TO_NAME_LOOKUP=y -# end of Common ESP-related - -# -# Ethernet -# -# CONFIG_ETH_USE_ESP32_EMAC is not set -# end of Ethernet - -# -# PHY -# -CONFIG_ESP_PHY_REDUCE_TX_POWER=y -# end of PHY - +# *** temporary custom CONSOLE_UART settings, to send log output to TX/RX pins on Feather ESP32V2 # # ESP System Settings # @@ -209,91 +22,3 @@ CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set # end of ESP System Settings - -# -# High resolution timer (esp_timer) -# -# CONFIG_ESP_TIMER_IMPL_FRC2 is not set -CONFIG_ESP_TIMER_IMPL_TG0_LAC=y -# end of High resolution timer (esp_timer) - -# -# Wi-Fi -# -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y -# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 -CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 -# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set -# end of Wi-Fi - -# -# FreeRTOS -# -# CONFIG_FREERTOS_FPU_IN_ISR is not set -# end of FreeRTOS - -# -# Hardware Abstraction Layer (HAL) and Low Level (LL) -# -# CONFIG_HAL_ASSERTION_ENABLE is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 -# end of Hardware Abstraction Layer (HAL) and Low Level (LL) - -# -# LWIP -# -CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" -# end of LWIP - -# -# Supplicant -# -# CONFIG_WPA_MBO_SUPPORT is not set -# CONFIG_WPA_DPP_SUPPORT is not set -# end of Supplicant - -# end of Component config - -# -# Deprecated options for backward compatibility -# -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -CONFIG_SPIRAM_SUPPORT=y -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ULP_COPROC_ENABLED is not set -CONFIG_ULP_COPROC_RESERVE_MEM=0 -CONFIG_BROWNOUT_DET=y -CONFIG_BROWNOUT_DET_LVL_SEL_0=y -# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set -CONFIG_BROWNOUT_DET_LVL=0 -# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set -# CONFIG_NO_BLOBS is not set -# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set -# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set -CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y -CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 -CONFIG_ESP32S2_PANIC_PRINT_HALT=y -# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set -CONFIG_CONSOLE_UART_CUSTOM=y -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_CUSTOM_NUM_0=y -# CONFIG_CONSOLE_UART_CUSTOM_NUM_1 is not set -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_TX_GPIO=8 -CONFIG_CONSOLE_UART_RX_GPIO=7 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -# end of Deprecated options for backward compatibility diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults index 6d949c2898..ff691341cc 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults @@ -2,24 +2,261 @@ CONFIG_IDF_TARGET_ARCH_XTENSA=y CONFIG_IDF_TARGET="esp32" CONFIG_IDF_TARGET_ESP32=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 + # # SDK tool configuration # CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" +# CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# end of Build type + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + # # Bootloader config # CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=0 +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config +# +# Security features +# +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Serial flasher config +# +CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="40m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +# CONFIG_ESPTOOLPY_MONITOR_BAUD_CONSOLE is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +CONFIG_PARTITION_TABLE_CUSTOM=y +# CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +# CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Compiler options +# +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +# end of Compiler options + # # Component config # + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set +# end of Bluetooth + +# +# Driver configurations +# + +# +# ADC configuration +# +# CONFIG_ADC_FORCE_XPD_FSM is not set +CONFIG_ADC_DISABLE_DAC=y +# end of ADC configuration + +# +# MCPWM configuration +# +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# end of MCPWM configuration + +# +# SPI configuration +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of SPI configuration + +# +# TWAI configuration +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set +# end of TWAI configuration + +# +# UART configuration +# +CONFIG_UART_ISR_IN_IRAM=y +# end of UART configuration + +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + +# +# GDMA Configuration +# +# CONFIG_GDMA_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GDMA_ISR_IRAM_SAFE is not set +# end of GDMA Configuration +# end of Driver configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + # # ESP32-specific # +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y CONFIG_ESP32_REV_MIN_0=y # CONFIG_ESP32_REV_MIN_1 is not set # CONFIG_ESP32_REV_MIN_2 is not set @@ -27,9 +264,84 @@ CONFIG_ESP32_REV_MIN_0=y CONFIG_ESP32_REV_MIN=0 CONFIG_ESP32_DPORT_WORKAROUND=y # CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y -# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_ESP32_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=-1 +CONFIG_SPIRAM_SPEED_40M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y + +# +# SPIRAM cache workaround debugging +# +CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set +# end of SPIRAM cache workaround debugging + +# +# SPIRAM workaround libraries placement +# +CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y +# end of SPIRAM workaround libraries placement + +CONFIG_SPIRAM_BANKSWITCH_ENABLE=y +CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 + +# +# PSRAM clock and cs IO for ESP32-DOWD +# +CONFIG_D0WD_PSRAM_CLK_IO=17 +CONFIG_D0WD_PSRAM_CS_IO=16 +# end of PSRAM clock and cs IO for ESP32-DOWD + +# +# PSRAM clock and cs IO for ESP32-D2WD +# +CONFIG_D2WD_PSRAM_CLK_IO=9 +CONFIG_D2WD_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-D2WD + +# +# PSRAM clock and cs IO for ESP32-PICO +# +CONFIG_PICO_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-PICO + +# CONFIG_SPIRAM_CUSTOM_SPIWP_SD3_PIN is not set +CONFIG_SPIRAM_SPIWP_SD3_PIN=7 +# CONFIG_SPIRAM_2T_MODE is not set +# end of SPI RAM config + # CONFIG_ESP32_TRAX is not set CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 # CONFIG_ESP32_ULP_COPROC_ENABLED is not set @@ -67,12 +379,52 @@ CONFIG_ESP32_XTAL_FREQ=40 CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 # end of ESP32-specific +# +# ADC-Calibration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# end of ADC-Calibration + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# Ethernet +# +# CONFIG_ETH_USE_ESP32_EMAC is not set +# CONFIG_ETH_USE_SPI_ETHERNET is not set +# CONFIG_ETH_USE_OPENETH is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +# end of GDB Stub + # # Hardware Settings # + # # MAC Config # +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y # CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 @@ -81,25 +433,106 @@ CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 # # Sleep Config # -CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y # CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set +# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set # end of Sleep Config +# +# RTC Clock Config +# +# end of RTC Clock Config # end of Hardware Settings +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +# CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER is not set +# end of ESP NETIF Adapter + +# +# PHY +# +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_REDUCE_TX_POWER=y +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +# end of Power Management + # # ESP System Settings # +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y # CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set +CONFIG_ESP_CONSOLE_UART_CUSTOM=y +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y +CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_TX_GPIO=8 +CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +# CONFIG_ESP_TASK_WDT is not set +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y # end of ESP System Settings # -# Ethernet +# High resolution timer (esp_timer) # -CONFIG_ETH_USE_ESP32_EMAC=n +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of High resolution timer (esp_timer) # # Wi-Fi @@ -107,15 +540,17 @@ CONFIG_ETH_USE_ESP32_EMAC=n CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 -# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 +# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set @@ -124,42 +559,637 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_IRAM_OPT=y CONFIG_ESP32_WIFI_RX_IRAM_OPT=y CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # end of Wi-Fi +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + # # FreeRTOS # # CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y CONFIG_FREERTOS_CORETIMER_0=y # CONFIG_FREERTOS_CORETIMER_1 is not set CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y +# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set +# CONFIG_FREERTOS_ASSERT_DISABLE is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +# CONFIG_FREERTOS_LEGACY_HOOKS is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# end of Heap memory debugging + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=3 +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" +# CONFIG_LWIP_NETIF_API is not set +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_MAX_SOCKETS=8 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +CONFIG_LWIP_SO_RCVBUF=y +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=4 +CONFIG_LWIP_MAX_LISTENING_TCP=4 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=6 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=2880 +CONFIG_LWIP_TCP_WND_DEFAULT=2880 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +# CONFIG_LWIP_TCP_SACK_OUT is not set +# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=3000 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +# end of SNTP + +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v2.28.x related +# +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y + +# +# DTLS-based configurations +# +# CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID is not set +# CONFIG_MBEDTLS_SSL_DTLS_SRTP is not set +# end of DTLS-based configurations +# end of mbedTLS v2.28.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE=y +CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="certificates/nina-fw/data/roots.pem" +# end of Certificate Bundle + +CONFIG_MBEDTLS_ECP_RESTARTABLE=y +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +CONFIG_MBEDTLS_PSK_MODES=y +CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set +# CONFIG_MBEDTLS_SSL_PROTO_TLS1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 is not set +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +CONFIG_MBEDTLS_SSL_PROTO_DTLS=y +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_X509_CHECK_KEY_USAGE=y +CONFIG_MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +CONFIG_MBEDTLS_RC4_DISABLED=y +# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set +# CONFIG_MBEDTLS_RC4_ENABLED is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +# CONFIG_MBEDTLS_SECURITY_RISKS is not set +# end of mbedTLS + +# +# mDNS +# +CONFIG_MDNS_MAX_SERVICES=10 +CONFIG_MDNS_TASK_PRIORITY=1 +CONFIG_MDNS_TASK_STACK_SIZE=4096 +# CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_MDNS_TASK_AFFINITY_CPU0=y +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set +CONFIG_MDNS_TASK_AFFINITY=0x0 +CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 +# CONFIG_MDNS_STRICT_MODE is not set +CONFIG_MDNS_TIMER_PERIOD_MS=100 +# CONFIG_MDNS_NETWORKING_SOCKET is not set +CONFIG_MDNS_MULTIPLE_INSTANCE=y +# end of mDNS + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +# end of Newlib + +# +# NVS +# +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set +# end of OpenThread + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +# CONFIG_SPI_FLASH_YIELD_DURING_ERASE is not set +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_VFS_SUPPORT_TERMIOS=y + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Supplicant +# +CONFIG_WPA_MBEDTLS_CRYPTO=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# end of Supplicant # end of Component config # -# Deprecated options for backward compatibility +# Compatibility options # +# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set +# end of Compatibility options + +# Deprecated options for backward compatibility CONFIG_TOOLPREFIX="xtensa-esp32-elf-" +CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=0 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +CONFIG_SPIRAM_SUPPORT=y +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y # CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set # CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set # CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set -CONFIG_ESP_SYSTEM_PD_FLASH=y +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 # CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_IPC_TASK_STACK_SIZE=1536 CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 CONFIG_ESP32_REDUCE_PHY_TX_POWER=y +CONFIG_ESP32S2_PANIC_PRINT_HALT=y +# CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=8192 +# CONFIG_CONSOLE_UART_DEFAULT is not set +CONFIG_CONSOLE_UART_CUSTOM=y +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_CUSTOM_NUM_0=y +# CONFIG_CONSOLE_UART_CUSTOM_NUM_1 is not set +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_TX_GPIO=8 +CONFIG_CONSOLE_UART_RX_GPIO=7 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +# CONFIG_TASK_WDT is not set # CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_TIMER_TASK_STACK_SIZE=3584 # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=6 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=2880 +CONFIG_TCP_WND_DEFAULT=2880 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_ESP32_PTHREAD_STACK_MIN=768 @@ -168,4 +1198,11 @@ CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y # CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -# end of Deprecated options for backward compatibility +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 +# End of deprecated options From afbf4de071a81a752b03272da975244788b5f0dd Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 12:53:25 -0400 Subject: [PATCH 054/108] Uncomment or remove debugging changes --- .../adafruit_feather_esp32_v2/sdkconfig | 34 +++++++++---------- py/emitglue.c | 3 -- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index ad957c841f..7921ca6eff 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -5,20 +5,20 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # end of Partition Table -# *** temporary custom CONSOLE_UART settings, to send log output to TX/RX pins on Feather ESP32V2 -# -# ESP System Settings -# -CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y -# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set -CONFIG_ESP_CONSOLE_UART_CUSTOM=y -# CONFIG_ESP_CONSOLE_NONE is not set -CONFIG_ESP_CONSOLE_UART=y -CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y -# CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set -CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_CONSOLE_UART_TX_GPIO=8 -CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 -CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 -# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set -# end of ESP System Settings +### # Uncomment to send log output to TX/RX pins on Feather ESP32V2 +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### # CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=8 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings diff --git a/py/emitglue.c b/py/emitglue.c index 47d2821bae..e701d0808f 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -26,8 +26,6 @@ // This code glues the code emitters to the runtime. -#include "esp_log.h" - #include #include #include @@ -197,7 +195,6 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar break; #endif default: - ESP_LOGI("mp_make_function_from_raw_code", "kind: %d, scope_flags: 0x%x, n_pos_args: %d, fun_data: %p, const_table: %p", rc->kind, rc->scope_flags, rc->n_pos_args, rc->fun_data, rc->const_table); // rc->kind should always be set and BYTECODE is the only remaining case assert(rc->kind == MP_CODE_BYTECODE); fun = mp_obj_new_fun_bc(def_args, def_kw_args, rc->fun_data, rc->const_table); From 76e32dcf93a562210c027dd8a8714da44741a3fb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 14:54:55 -0400 Subject: [PATCH 055/108] remove need for CIRCUITPY_ESP_PSRAM --- .../boards/adafruit_esp32s2_camera/mpconfigboard.mk | 2 -- .../boards/adafruit_feather_esp32_v2/mpconfigboard.mk | 2 -- .../espressif/boards/adafruit_feather_esp32_v2/sdkconfig | 9 +++++++++ .../boards/adafruit_feather_esp32s2/mpconfigboard.mk | 2 -- .../boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk | 2 -- .../mpconfigboard.mk | 2 -- .../mpconfigboard.mk | 2 -- .../boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk | 2 -- .../espressif/boards/adafruit_funhouse/mpconfigboard.mk | 2 -- .../adafruit_magtag_2.9_grayscale/mpconfigboard.mk | 2 -- .../boards/adafruit_metro_esp32s2/mpconfigboard.mk | 2 -- .../boards/adafruit_qtpy_esp32s2/mpconfigboard.mk | 2 -- .../boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk | 2 -- ports/espressif/boards/artisense_rd00/mpconfigboard.mk | 2 -- .../espressif/boards/crumpspace_crumps2/mpconfigboard.mk | 2 -- .../boards/electroniccats_bastwifi/mpconfigboard.mk | 2 -- .../boards/espressif_hmi_devkit_1/mpconfigboard.mk | 2 -- .../boards/espressif_kaluga_1.3/mpconfigboard.mk | 2 -- .../espressif/boards/espressif_kaluga_1/mpconfigboard.mk | 2 -- .../boards/espressif_saola_1_wroom/mpconfigboard.mk | 2 -- .../boards/espressif_saola_1_wrover/mpconfigboard.mk | 2 -- .../boards/franzininho_wifi_wroom/mpconfigboard.mk | 2 -- .../boards/franzininho_wifi_wrover/mpconfigboard.mk | 2 -- .../boards/gravitech_cucumber_m/mpconfigboard.mk | 2 -- .../boards/gravitech_cucumber_ms/mpconfigboard.mk | 2 -- .../boards/gravitech_cucumber_r/mpconfigboard.mk | 2 -- .../boards/gravitech_cucumber_rs/mpconfigboard.mk | 2 -- .../lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk | 2 -- .../espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk | 2 -- .../boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk | 2 -- ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk | 2 -- ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk | 2 -- .../boards/morpheans_morphesp-240/mpconfigboard.mk | 2 -- .../boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk | 2 -- .../boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk | 2 -- .../boards/odt_pixelwing_esp32_s2/mpconfigboard.mk | 2 -- .../boards/targett_module_clip_wroom/mpconfigboard.mk | 2 -- .../boards/targett_module_clip_wrover/mpconfigboard.mk | 2 -- ports/espressif/common-hal/microcontroller/Pin.c | 3 ++- ports/espressif/esp-idf-config/sdkconfig-esp32.defaults | 4 ++-- ports/espressif/mpconfigport.mk | 5 ----- 41 files changed, 13 insertions(+), 82 deletions(-) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk index 7a352fc83c..6b351c772b 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk index a83269f3ac..21a87a9456 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk @@ -13,5 +13,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 8MB - -CIRCUITPY_ESP_PSRAM = 1 diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index 7921ca6eff..b8b4a9690d 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -5,6 +5,15 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # end of Partition Table +# +# SPI RAM config +# +CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set + ### # Uncomment to send log output to TX/RX pins on Feather ESP32V2 ### # ### # ESP System Settings diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk index 407844ed4b..6af258b3d0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk index d939630dfd..870c2aa3d0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk @@ -16,5 +16,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk index 7a2f3d3691..43c286ae3b 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk @@ -16,8 +16,6 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_ESP_PSRAM = 0 - FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk index 6e4c716fe0..e1e9be782c 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = qio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index 0412fabed3..81b6eb1edc 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -16,5 +16,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk index 961e3371bc..531627d5a6 100644 --- a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk @@ -16,8 +16,6 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_ESP_PSRAM = 0 - # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_FakeRequests diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk index beccc8275e..e1bd4997b7 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk @@ -16,8 +16,6 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_ESP_PSRAM = 0 - # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_FakeRequests diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk index d293096e4b..a0e7bfe6fc 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk index 64cf3630bb..44c33310cc 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk @@ -16,5 +16,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk index 8c81c7bc6c..de0fc66b9d 100644 --- a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk index 621b714156..b617b33fac 100644 --- a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk +++ b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk index 4d4ae5de60..5cd7682090 100644 --- a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk @@ -18,7 +18,5 @@ CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_APA102 = 1 -CIRCUITPY_ESP_PSRAM = 0 - # Include these Python libraries in firmware. # FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk index 99a75f1db4..df377b2b6c 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk +++ b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -17,5 +17,3 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk index aedb03801b..bd8e6c6e31 100644 --- a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk index 5c0d16346d..0ff4eab64f 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk index 5c0d16346d..0ff4eab64f 100644 --- a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 80m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk index 56b5a65eb8..5e09be7b2e 100644 --- a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk index 4442a577b6..6185e40809 100644 --- a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk index 53d1a4a846..dc777ecd95 100644 --- a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk index 5f5bd893cb..4d5081dd7f 100644 --- a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk index 04f713043f..04f23bf4bb 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk index b3421d59a1..77861c0228 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk index c4b76ff756..5e4f6c4b98 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk index d15530b48c..96b9dddf8b 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk index 68521578a7..1d5e3ec719 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk index 5de3534e39..781818f53e 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk index dc311d0558..4d6a586ff8 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk index 30ca08c176..31955af81f 100644 --- a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -16,8 +16,6 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_ESP_PSRAM = 0 - FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk index 3148b3ece7..4b8fe6846c 100644 --- a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -16,8 +16,6 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_ESP_PSRAM = 0 - FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib diff --git a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk index 4b4b69a347..79dd73f58a 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk index f4a3560716..d1b4b1b453 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk index 800c55d57c..80557e1575 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk index f00e1082ba..d02872f445 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk index 08cce69957..2345469304 100644 --- a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk index a668d5ae9c..80014bdf98 100644 --- a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_ESP_PSRAM = 0 diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index d2ccc897d4..d3bec8c37b 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -77,7 +77,8 @@ static const uint64_t pin_mask_reset_forbidden = // Never ever reset pins used to communicate with SPI flash and PSRAM. GPIO_SEL_19 | // USB D- GPIO_SEL_20 | // USB D+ - #if CIRCUITPY_ESP_PSRAM + #if defined (CONFIG_ESP32_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S2_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S3_SPIRAM_SUPPORT) + // Note ESP32-C3 does not have SPIRAM support. // Board uses PSRAM, and needs another chip select. GPIO_SEL_26 | // SPICS1 #endif diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults index ff691341cc..b08d088ed2 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults @@ -267,12 +267,12 @@ CONFIG_ESP32_DPORT_WORKAROUND=y # CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 -CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_ESP32_SPIRAM_SUPPORT is not set # # SPI RAM config # -CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_AUTO is not set # CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set # CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 04bfd7e4c5..53f57dc895 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -80,8 +80,3 @@ endif # only if something else is turned off, such as HID. USB_NUM_ENDPOINT_PAIRS = 7 USB_NUM_IN_ENDPOINTS = 5 - -#ifndef CIRCUITPY_ESP_PSRAM -#error CIRCUITPY_ESP_PSRAM must be specified in mpconfigboard.mk as 0 or 1. Use 1 if the board has PSRAM. -#endif -CFLAGS += -DCIRCUITPY_ESP_PSRAM=$(CIRCUITPY_ESP_PSRAM) From d869b441f4cf060dac214209527307161f89ba71 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 15:27:00 -0400 Subject: [PATCH 056/108] further ESP32 sdkconfig fixes; add CIRCUITPY_STATUS_BAR --- .../mpconfigboard.mk | 3 +++ .../adafruit_feather_esp32_v2/sdkconfig | 21 ++++++++++++++- .../esp-idf-config/sdkconfig-esp32.defaults | 20 -------------- py/circuitpy_mpconfig.mk | 3 +++ supervisor/shared/workflow.c | 26 +++++++++++-------- 5 files changed, 41 insertions(+), 32 deletions(-) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk index 21a87a9456..f25eda463f 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk @@ -10,6 +10,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 +CIRCUITPY_STATUS_BAR = 0 +CIRCUITPY_WEB_WORKFLOW = 0 + CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig index b8b4a9690d..f2e8085d3e 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -8,11 +8,30 @@ CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" # # SPI RAM config # -CONFIG_ESP32_SPIRAM_SUPPORT=y # CONFIG_SPIRAM_TYPE_AUTO is not set CONFIG_SPIRAM_TYPE_ESPPSRAM16=y # CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +CONFIG_SPIRAM_SPEED_40M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y + +# +# SPI RAM config +# +CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set ### # Uncomment to send log output to TX/RX pins on Feather ESP32V2 ### # diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults index b08d088ed2..ed573c303e 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults @@ -269,26 +269,6 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 # CONFIG_ESP32_SPIRAM_SUPPORT is not set -# -# SPI RAM config -# -# CONFIG_SPIRAM_TYPE_AUTO is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_SIZE=-1 -CONFIG_SPIRAM_SPEED_40M=y -CONFIG_SPIRAM=y -CONFIG_SPIRAM_BOOT_INIT=y -CONFIG_SPIRAM_IGNORE_NOTFOUND=y -CONFIG_SPIRAM_USE_MEMMAP=y -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -# CONFIG_SPIRAM_USE_MALLOC is not set -CONFIG_SPIRAM_MEMTEST=y -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set -CONFIG_SPIRAM_CACHE_WORKAROUND=y - # # SPIRAM cache workaround debugging # diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 4b1ff9cb67..a9740ab8d8 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -366,6 +366,9 @@ CFLAGS += -DCIRCUITPY_SSL=$(CIRCUITPY_SSL) CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) +CIRCUITPY_STATUS_BAR ?= $(CIRCUITPY_WEB_WORKFLOW) +CFLAGS += -DCIRCUITPY_STATUS_BAR=$(CIRCUITPY_STATUS_BAR) + CIRCUITPY_STORAGE ?= 1 CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE) diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 202b11ec71..775087bda7 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -46,22 +46,26 @@ #endif static background_callback_t workflow_background_cb; +#if CIRCUITPY_STATUS_BAR static void supervisor_workflow_update_status_bar(void) { - // // Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code - // // doesn't get terminated after two following characters and the value is invalid. - // // This is the OSC command to set the title and the icon text. It can be up to 255 characters - // // but some may be cut off. - // serial_write("\x1b" "]0;"); - // serial_write("🐍 "); - // #if CIRCUITPY_WEB_WORKFLOW - // supervisor_web_workflow_status(); - // #endif - // // Send string terminator - // serial_write("\x1b" "\\"); + // Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code + // doesn't get terminated after two following characters and the value is invalid. + // This is the OSC command to set the title and the icon text. It can be up to 255 characters + // but some may be cut off. + serial_write("\x1b" "]0;"); + serial_write("🐍 "); + #if CIRCUITPY_WEB_WORKFLOW + supervisor_web_workflow_status(); + #endif + // Send string terminator + serial_write("\x1b" "\\"); } +#endif static void workflow_background(void *data) { +#if CIRCUITPY_STATUS_BAR supervisor_workflow_update_status_bar(); +#endif } // Called during a VM reset. Doesn't actually reset things. From a9d4f09360eafc90f9ccf22064d3a617c48951c5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 16:11:01 -0400 Subject: [PATCH 057/108] Update ci_check_duplicate_usb_vid_pid.py for ESP32 --- tools/ci_check_duplicate_usb_vid_pid.py | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index d9e7d99687..4cbb7e4567 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -79,7 +79,7 @@ def check_vid_pid(files, clusterlist): vid_pattern = re.compile(r"^USB_VID\s*=\s*(.*)", flags=re.M) pid_pattern = re.compile(r"^USB_PID\s*=\s*(.*)", flags=re.M) - usb_pattern = re.compile(r"^CIRCUITPY_USB\s*=\s*0$|^IDF_TARGET = esp32c3$", flags=re.M) + usb_pattern = re.compile(r"^CIRCUITPY_USB\s*=\s*0$|^IDF_TARGET = (esp32|esp32c3)$", flags=re.M) usb_ids = defaultdict(set) for board_config in files: @@ -95,7 +95,7 @@ def check_vid_pid(files, clusterlist): elif non_usb: continue else: - raise SystemExit(f"Could not parse {board_config}") + raise SystemExit(f"Could not find expected settings in {board_config}") usb_ids[id_group].add(board_name) @@ -120,6 +120,29 @@ def check_vid_pid(files, clusterlist): f"Otherwise, companies should pay the USB-IF for a vendor ID: https://www.usb.org/getting-vendor-id" ) sys.exit(duplicate_message) + + + + + + + + + + + + + + + + + + + + + + + else: print("No USB PID duplicates found.") From 2c7ad7a39f62e1fe76f8ecb3d59c842754144cd9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 16:53:53 -0400 Subject: [PATCH 058/108] make translate and pre-commit formatting fixes --- locale/circuitpython.pot | 5 +++++ .../espressif/common-hal/analogio/AnalogOut.c | 3 +-- .../common-hal/microcontroller/Pin.c | 2 +- .../common-hal/microcontroller/__init__.c | 4 ++-- py/circuitpy_mpconfig.h | 6 ++--- supervisor/shared/workflow.c | 4 ++-- tools/ci_check_duplicate_usb_vid_pid.py | 22 ------------------- 7 files changed, 14 insertions(+), 32 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5740e1e288..c5f7a895d5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3739,7 +3739,12 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" diff --git a/ports/espressif/common-hal/analogio/AnalogOut.c b/ports/espressif/common-hal/analogio/AnalogOut.c index 8720dcf8bb..1a1e74391b 100644 --- a/ports/espressif/common-hal/analogio/AnalogOut.c +++ b/ports/espressif/common-hal/analogio/AnalogOut.c @@ -56,8 +56,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, self->channel = DAC_CHANNEL_1; } else if (pin == &pin_CHANNEL_2) { self->channel = DAC_CHANNEL_2; - } - else { + } else { raise_ValueError_invalid_pin(); } dac_output_enable(self->channel); diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index d3bec8c37b..201fa0ac2b 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -77,7 +77,7 @@ static const uint64_t pin_mask_reset_forbidden = // Never ever reset pins used to communicate with SPI flash and PSRAM. GPIO_SEL_19 | // USB D- GPIO_SEL_20 | // USB D+ - #if defined (CONFIG_ESP32_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S2_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S3_SPIRAM_SUPPORT) + #if defined(CONFIG_ESP32_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S2_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S3_SPIRAM_SUPPORT) // Note ESP32-C3 does not have SPIRAM support. // Board uses PSRAM, and needs another chip select. GPIO_SEL_26 | // SPICS1 diff --git a/ports/espressif/common-hal/microcontroller/__init__.c b/ports/espressif/common-hal/microcontroller/__init__.c index 27943eab32..1014ce9532 100644 --- a/ports/espressif/common-hal/microcontroller/__init__.c +++ b/ports/espressif/common-hal/microcontroller/__init__.c @@ -89,7 +89,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { switch (runmode) { case RUNMODE_UF2: - #if defined(CONFIG_IDF_TARGET_ESP32) ||defined(CONFIG_IDF_TARGET_ESP32C3) + #if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C3) mp_arg_error_invalid(MP_QSTR_run_mode); #else // 0x11F2 is APP_REQUEST_UF2_RESET_HINT & is defined by TinyUF2 @@ -112,7 +112,7 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { break; case RUNMODE_BOOTLOADER: // DFU download - #if defined(CONFIG_IDF_TARGET_ESP32) ||defined(CONFIG_IDF_TARGET_ESP32C3) + #if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C3) mp_arg_error_invalid(MP_QSTR_run_mode); #else chip_usb_set_persist_flags(USBDC_BOOT_DFU); diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 1ef6bcbfb8..950cf91e2e 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -200,9 +200,9 @@ typedef long mp_off_t; // extra built in names to add to the global namespace // Not indented so as not to confused the editor. #define MICROPY_PORT_BUILTINS \ -{ MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ -{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ -{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, \ ////////////////////////////////////////////////////////////////////////////////////////////////// // board-specific definitions, which control and may override definitions below. diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 775087bda7..a7bddca84d 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -63,9 +63,9 @@ static void supervisor_workflow_update_status_bar(void) { #endif static void workflow_background(void *data) { -#if CIRCUITPY_STATUS_BAR + #if CIRCUITPY_STATUS_BAR supervisor_workflow_update_status_bar(); -#endif + #endif } // Called during a VM reset. Doesn't actually reset things. diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index 4cbb7e4567..060bc8ea17 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -121,28 +121,6 @@ def check_vid_pid(files, clusterlist): ) sys.exit(duplicate_message) - - - - - - - - - - - - - - - - - - - - - - else: print("No USB PID duplicates found.") From bc14b7ad47ccc1a32727f163d529ab271709ed1c Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 8 Jul 2022 15:40:59 -0700 Subject: [PATCH 059/108] Fix the display on the esp box lite --- ports/espressif/boards/espressif_esp32s3_box_lite/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/board.c b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c index dbd3c17313..71659f4b0e 100644 --- a/ports/espressif/boards/espressif_esp32s3_box_lite/board.c +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c @@ -37,9 +37,9 @@ uint8_t display_init_sequence[] = { 0x01, 0x80, 0x96, // _SWRESET and Delay 150ms 0x11, 0x80, 0xFF, // _SLPOUT and Delay 500ms 0x3A, 0x81, 0x55, 0x0A, // _COLMOD and Delay 10ms - 0x21, 0x80, 10, // _INVON + 0x21, 0x80, 0x0A, // _INVON 0x13, 0x80, 0x0A, // _NORON and Delay 10ms - 0x36, 0x01, 0x80, // _MADCTL + 0x36, 0x01, 0xA0, // _MADCTL 0x29, 0x80, 0xFF, // _DISPON and Delay 500ms }; From 557e35469f7bece08c68a65a29dca82126c4b242 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 8 Jul 2022 16:57:19 -0700 Subject: [PATCH 060/108] Make serial page work ok including on mobile --- .../shared/web_workflow/static/serial.html | 22 +++++-- .../shared/web_workflow/static/serial.js | 60 +++++++++++-------- supervisor/shared/web_workflow/websocket.c | 9 ++- 3 files changed, 59 insertions(+), 32 deletions(-) diff --git a/supervisor/shared/web_workflow/static/serial.html b/supervisor/shared/web_workflow/static/serial.html index d8ab86a7c8..aaf416b8b3 100644 --- a/supervisor/shared/web_workflow/static/serial.html +++ b/supervisor/shared/web_workflow/static/serial.html @@ -1,14 +1,24 @@ - + + Simple client - -

-  
-  
-  
+
+  
+

+     
+  
+
+
+ Ctrl + + +
+ + +
diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js index ab0893ad08..595bbe6653 100644 --- a/supervisor/shared/web_workflow/static/serial.js +++ b/supervisor/shared/web_workflow/static/serial.js @@ -1,7 +1,9 @@ var ws; var input = document.getElementById("input"); +input.value = ""; var title = document.querySelector("title"); +var log = document.getElementById("log"); function set_enabled(enabled) { input.disabled = !enabled; @@ -14,35 +16,21 @@ function set_enabled(enabled) { set_enabled(false); function onSubmit() { - console.log("submit"); - // You can send message to the Web Socket using ws.send. - ws.send(input.value); - // output("send: " + input.value); - input.value = ""; - input.focus(); -} - -function onCloseClick() { - console.log("close clicked"); - ws.close(); -} - -function output(str) { - var log = document.getElementById("log"); - log.innerHTML += str; + ws.send("\r"); + input.value = ""; + input.focus(); } // Connect to Web Socket -ws = new WebSocket("ws://cpy-f57ce8.local/cp/serial/"); -// ws = new WebSocket("ws://127.0.0.1:9001") +ws = new WebSocket("ws://" + window.location.host + "/cp/serial/"); -// Set event handlers. ws.onopen = function() { - console.log("onopen"); set_enabled(true); }; var setting_title = false; +var encoder = new TextEncoder(); +var left_count = 0; ws.onmessage = function(e) { // e.data contains received string. if (e.data == "\x1b]0;") { @@ -52,22 +40,44 @@ ws.onmessage = function(e) { setting_title = false; } else if (setting_title) { title.textContent += e.data; + } else if (e.data == "\b") { + left_count += 1; + } else if (e.data == "\x1b[K") { // Clear line + log.textContent = log.textContent.slice(0, -left_count); + left_count = 0; } else { - output(e.data); + log.textContent += e.data; } + document.querySelector("span").scrollIntoView(); }; ws.onclose = function() { - console.log("onclose"); set_enabled(false); }; ws.onerror = function(e) { - // output("onerror"); - console.log(e); set_enabled(false); }; input.onbeforeinput = function(e) { - console.log(e); + if (e.inputType == "insertLineBreak") { + ws.send("\r"); + input.value = ""; + input.focus(); + e.preventDefault(); + } else if (e.inputType == "insertText") { + ws.send(e.data); + } else if (e.inputType == "deleteContentBackward") { + ws.send("\b"); + } +} + +let ctrl_c = document.querySelector("#c"); +ctrl_c.onclick = function() { + ws.send("\x03"); +} + +let ctrl_d = document.querySelector("#d"); +ctrl_d.onclick = function() { + ws.send("\x04"); } diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 0f4c4fc84c..7a2f37b168 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -124,7 +124,6 @@ static void _read_next_frame_header(void) { size_t mask_offset = cp_serial.frame_index - mask_start; cp_serial.mask[mask_offset] = h; cp_serial.frame_index++; - ESP_LOGI(TAG, "mask %08x", (uint32_t)*cp_serial.mask); } // Reply to PINGs and CLOSE. while ((cp_serial.opcode == 0x8 || @@ -136,6 +135,11 @@ static void _read_next_frame_header(void) { if (cp_serial.opcode == 0x9) { ESP_LOGI(TAG, "websocket ping"); opcode = 0xA; // PONG + } else { + // Set the TCP socket to send immediately so that we send the payload back before + // closing the connection. + int nodelay = 1; + lwip_setsockopt(cp_serial.socket.num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); } uint8_t frame_header[2]; frame_header[0] = 1 << 7 | opcode; @@ -158,6 +162,8 @@ static void _read_next_frame_header(void) { if (cp_serial.opcode == 0x8) { ESP_LOGI(TAG, "websocket closed"); cp_serial.closed = true; + + common_hal_socketpool_socket_close(&cp_serial.socket); } } } @@ -193,6 +199,7 @@ bool websocket_available(void) { char websocket_read_char(void) { uint8_t c; _read_next_payload_byte(&c); + ESP_LOGI(TAG, "read %c", c); return c; } From fa62c875361b0370f2e94bd13eb058e7ae146c1b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 20:37:47 -0400 Subject: [PATCH 061/108] ESP32 .bin only; update nvm.toml --- data/nvm.toml | 2 +- tools/build_board_info.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/nvm.toml b/data/nvm.toml index 266ea20ed8..2d292ad4e6 160000 --- a/data/nvm.toml +++ b/data/nvm.toml @@ -1 +1 @@ -Subproject commit 266ea20ed80104c315dcb124b482fa5f9f48cdec +Subproject commit 2d292ad4e67890d4b85b027431ba9fef7bf561fd diff --git a/tools/build_board_info.py b/tools/build_board_info.py index d73f0e3f1c..c58dc42a9d 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -71,6 +71,8 @@ extension_by_board = { "meowbit_v121": UF2, "sparkfun_stm32_thing_plus": BIN_UF2, "swan_r5": BIN_UF2, + # esp32 + "adafruit_feather_esp32_v2": BIN, # esp32c3 "adafruit_qtpy_esp32c3": BIN, "ai_thinker_esp32-c3s": BIN, From 3f8b8d4b2f68df29288a3e7d4a945f5a1c428b92 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 22:42:13 -0400 Subject: [PATCH 062/108] update frozen libraries --- frozen/Adafruit_CircuitPython_APDS9960 | 2 +- frozen/Adafruit_CircuitPython_BLE | 2 +- frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DRV2605 | 2 +- frozen/Adafruit_CircuitPython_DS3231 | 2 +- frozen/Adafruit_CircuitPython_Display_Shapes | 2 +- frozen/Adafruit_CircuitPython_Display_Text | 2 +- frozen/Adafruit_CircuitPython_DotStar | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_FakeRequests | 2 +- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LC709203F | 2 +- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_MIDI | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_PortalBase | 2 +- frozen/Adafruit_CircuitPython_ProgressBar | 2 +- frozen/Adafruit_CircuitPython_RFM69 | 2 +- frozen/Adafruit_CircuitPython_RFM9x | 2 +- frozen/Adafruit_CircuitPython_Register | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_SD | 2 +- frozen/Adafruit_CircuitPython_ST7789 | 2 +- frozen/Adafruit_CircuitPython_SimpleIO | 2 +- frozen/Adafruit_CircuitPython_SimpleMath | 2 +- frozen/Adafruit_CircuitPython_Thermistor | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- frozen/mixgo_cp_lib | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_APDS9960 b/frozen/Adafruit_CircuitPython_APDS9960 index 9bd4882092..13856be616 160000 --- a/frozen/Adafruit_CircuitPython_APDS9960 +++ b/frozen/Adafruit_CircuitPython_APDS9960 @@ -1 +1 @@ -Subproject commit 9bd48820928afad549832fe9b4ae497b224007f0 +Subproject commit 13856be616eee2eb84280b7c4914951c1ddbfd36 diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 13c529288e..7d9635ba1d 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 13c529288e9431541fe58cf7992d4f53f7ca3b76 +Subproject commit 7d9635ba1dda31ce45b84519c4da76ff86d0debe diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 258bb62c58..e5cf8206c0 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 258bb62c58e545c38749b8a66f5872035b2384cb +Subproject commit e5cf8206c0173228252ae74367cab85b0531488e diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index b96f0d2794..9addf6a26f 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit b96f0d279481446017ca1cc1ff4abf1f5a10346f +Subproject commit 9addf6a26fef3a32c78d574c66452b6210eca5c5 diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index 54b2fa03d8..843def7dae 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit 54b2fa03d8af80562b77460841e63d47f12eee43 +Subproject commit 843def7daee741c8fb04fe21c3c7b98f22862471 diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 938f6bb335..0a045871d3 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 938f6bb335ba5e4c56a8062c591ff9f3c18c4297 +Subproject commit 0a045871d3da681d1c9c9578f09174bfc6d84f1d diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 index 8e7e111a9f..6a429bcd0e 160000 --- a/frozen/Adafruit_CircuitPython_DRV2605 +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -1 +1 @@ -Subproject commit 8e7e111a9ff39d3f4311caa7babeb451422c759f +Subproject commit 6a429bcd0e6b22ee181197ce0477ae70f5adb80d diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 index df24498154..22931594bc 160000 --- a/frozen/Adafruit_CircuitPython_DS3231 +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -1 +1 @@ -Subproject commit df2449815433e05ea0f89c19518ccde7a10a2faa +Subproject commit 22931594bc52ab259eaf313d26219a507703c315 diff --git a/frozen/Adafruit_CircuitPython_Display_Shapes b/frozen/Adafruit_CircuitPython_Display_Shapes index 2fad6f2f98..cdef09114d 160000 --- a/frozen/Adafruit_CircuitPython_Display_Shapes +++ b/frozen/Adafruit_CircuitPython_Display_Shapes @@ -1 +1 @@ -Subproject commit 2fad6f2f98c0df135e2306d32af18bb2796b852c +Subproject commit cdef09114d2b43d2e461d066a5b56697ab567abc diff --git a/frozen/Adafruit_CircuitPython_Display_Text b/frozen/Adafruit_CircuitPython_Display_Text index de3276cc08..bb9cb75e15 160000 --- a/frozen/Adafruit_CircuitPython_Display_Text +++ b/frozen/Adafruit_CircuitPython_Display_Text @@ -1 +1 @@ -Subproject commit de3276cc08ba13901d1f69060ff7501c1699bc4d +Subproject commit bb9cb75e15b4bfce3063a94b40dfad2375d5605e diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index a90579e1e1..f9469d26ed 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit a90579e1e1e1c973e6ba8f6cf8e914d77fc8f0f2 +Subproject commit f9469d26ed9eb95d43982de88c035ac3862dd258 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index ddd26eb4ab..f3d504be1d 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit ddd26eb4abcd3c10ae5dd33b1345d10d58707995 +Subproject commit f3d504be1dc82cc4a8e4ea9b38bd5c2ce74d59ba diff --git a/frozen/Adafruit_CircuitPython_FakeRequests b/frozen/Adafruit_CircuitPython_FakeRequests index f6cdec74b6..2ea025b1b6 160000 --- a/frozen/Adafruit_CircuitPython_FakeRequests +++ b/frozen/Adafruit_CircuitPython_FakeRequests @@ -1 +1 @@ -Subproject commit f6cdec74b64112016c459abe4a5d31a3b34caeb3 +Subproject commit 2ea025b1b68b0be95a0514732d4bc623f313fd75 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index a77f0f9c2e..b637c47423 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit a77f0f9c2e8f64568bbb68254d0134fbc7b5a8af +Subproject commit b637c47423eb85233ba614424aadadace37fcfb1 diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 2fddabcaf0..47cc914748 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 2fddabcaf0df1763111ed9dbf9e2d4cdb5b0434e +Subproject commit 47cc91474823677218239b5b37901590755cac4c diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index 1e478b1530..a2491a806b 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit 1e478b1530b3be81bd84f13620d0a23502d377f1 +Subproject commit a2491a806b636f66caf670527c49b864923f125c diff --git a/frozen/Adafruit_CircuitPython_LC709203F b/frozen/Adafruit_CircuitPython_LC709203F index a9cf0cde77..72367f37cd 160000 --- a/frozen/Adafruit_CircuitPython_LC709203F +++ b/frozen/Adafruit_CircuitPython_LC709203F @@ -1 +1 @@ -Subproject commit a9cf0cde77c185c6bbc79a3b6d77dd024a9683d2 +Subproject commit 72367f37cd221c7af7822ba3a9cd21cd3cd70292 diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index acc4bdd73f..a06c8a116e 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit acc4bdd73fdceb74d75cd5a1f261ae157ee32613 +Subproject commit a06c8a116e5767a8481b9018239fe729e01760a6 diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 3d1aab0daf..5acf8a850d 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 3d1aab0daf63c3b4476f73cba39cf5da49e1e4aa +Subproject commit 5acf8a850d98789a79fe37836b2ac7b623d95913 diff --git a/frozen/Adafruit_CircuitPython_MIDI b/frozen/Adafruit_CircuitPython_MIDI index 3d871907f0..d3f9adce6e 160000 --- a/frozen/Adafruit_CircuitPython_MIDI +++ b/frozen/Adafruit_CircuitPython_MIDI @@ -1 +1 @@ -Subproject commit 3d871907f0187c627277382f184209f5520703a6 +Subproject commit d3f9adce6e48d37222ef171a280cfa3122faf15b diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index 207953aac0..df61e7b0be 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit 207953aac033d40728b5f8dd7fd73d90facbca5c +Subproject commit df61e7b0be9dc0c6a1bbe60f526fbdc01b6c2819 diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index 36d4a31010..015eb1ccd5 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit 36d4a31010461e47f265553ebd764c69d38a254c +Subproject commit 015eb1ccd5eb5364d8e1cf20358e7dcda9f12efc diff --git a/frozen/Adafruit_CircuitPython_PortalBase b/frozen/Adafruit_CircuitPython_PortalBase index bcfaae874f..217af2bc7d 160000 --- a/frozen/Adafruit_CircuitPython_PortalBase +++ b/frozen/Adafruit_CircuitPython_PortalBase @@ -1 +1 @@ -Subproject commit bcfaae874fbae294ce04549d55b96d6b41603944 +Subproject commit 217af2bc7de658ff2f6380a066d99a149e69693e diff --git a/frozen/Adafruit_CircuitPython_ProgressBar b/frozen/Adafruit_CircuitPython_ProgressBar index 011acd627f..1c39469bac 160000 --- a/frozen/Adafruit_CircuitPython_ProgressBar +++ b/frozen/Adafruit_CircuitPython_ProgressBar @@ -1 +1 @@ -Subproject commit 011acd627fc24342c397fc640b204a798f7b69dd +Subproject commit 1c39469bac98eea022af695ac42e5096dae6130c diff --git a/frozen/Adafruit_CircuitPython_RFM69 b/frozen/Adafruit_CircuitPython_RFM69 index c58defd709..74ea48f7a5 160000 --- a/frozen/Adafruit_CircuitPython_RFM69 +++ b/frozen/Adafruit_CircuitPython_RFM69 @@ -1 +1 @@ -Subproject commit c58defd70947531c5a9c37ddcb569f240567a78b +Subproject commit 74ea48f7a5d85591f5af804cacb57e9cfaab46c6 diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x index 2d8310f19d..13cdb9912b 160000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -1 +1 @@ -Subproject commit 2d8310f19d1bdce817df13e807b409b5b057fc21 +Subproject commit 13cdb9912ba31f6e267f1afb9f71fddf5b1c139c diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index 49ab415d6b..d1e8ac7ad9 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit 49ab415d6b601c99979262f9e91c21dcb3a927a7 +Subproject commit d1e8ac7ad9dcd65ab83749db3e5c96ffee80ebb7 diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 2e6b3f9fee..b168b28fc5 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 2e6b3f9feeacc678402454f7d3416b04a9a93e17 +Subproject commit b168b28fc58973cf20269cc87a655d7812659fd0 diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index da02c76d4c..332143d4ca 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit da02c76d4c802cd5abac73a5f274243b05e8cb35 +Subproject commit 332143d4ca5762d2d351ceb170c0b4e37dd42793 diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 850c3dc512..995959d5dc 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 850c3dc512f7feae1eaad20bdc1c5e4c63c92f08 +Subproject commit 995959d5dca23fbe49590700d1aa26a96dca1df7 diff --git a/frozen/Adafruit_CircuitPython_SimpleIO b/frozen/Adafruit_CircuitPython_SimpleIO index 272d225365..d238fe99e2 160000 --- a/frozen/Adafruit_CircuitPython_SimpleIO +++ b/frozen/Adafruit_CircuitPython_SimpleIO @@ -1 +1 @@ -Subproject commit 272d225365eed46916390cf1f393dd08bc00b7d4 +Subproject commit d238fe99e24ea4cdb472f1d8a9c99dd189b0aeca diff --git a/frozen/Adafruit_CircuitPython_SimpleMath b/frozen/Adafruit_CircuitPython_SimpleMath index fad0f89e76..632655b8f5 160000 --- a/frozen/Adafruit_CircuitPython_SimpleMath +++ b/frozen/Adafruit_CircuitPython_SimpleMath @@ -1 +1 @@ -Subproject commit fad0f89e760829a76f553ef8459f61001597a846 +Subproject commit 632655b8f5f6f62e3b4d0b6161213634e0ae74e9 diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index e86f258e43..3816a4f4c9 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit e86f258e43591ce4a04661277e77e9fdf6fec27e +Subproject commit 3816a4f4c997b03d4a7ebfe35a617d1e50124b04 diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index 3aaf72165b..148345d232 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit 3aaf72165bc6ba10bf5219716c8654651649f87b +Subproject commit 148345d232c83133de3649fb70b471f11501b3d2 diff --git a/frozen/mixgo_cp_lib b/frozen/mixgo_cp_lib index 8b6cd888b2..4ba6956d49 160000 --- a/frozen/mixgo_cp_lib +++ b/frozen/mixgo_cp_lib @@ -1 +1 @@ -Subproject commit 8b6cd888b264abaf8f9b1904b09b01313b273bb2 +Subproject commit 4ba6956d49752f2d0cdc73903b86a34c225934ef From 9d77a36fbfd5888c90ccf6a991c8e7b8d3e04ff2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jul 2022 22:47:36 -0400 Subject: [PATCH 063/108] update samd-peripherals submodule --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index d3b20192cf..57133eefeb 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit d3b20192cf94fdea68a412596e082108ba5ebbf0 +Subproject commit 57133eefeb077f73b5ac17ee044d9feaf566da8e From f464ec3047401de12748d811745a4a4f252a0f1f Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Sat, 9 Jul 2022 22:17:02 -0700 Subject: [PATCH 064/108] Update ports/espressif/common-hal/wifi/Radio.c Co-authored-by: Dan Halbert --- ports/espressif/common-hal/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 9715894f78..ac997cc0b7 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -139,7 +139,7 @@ void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t esp_wifi_set_mac(ESP_IF_WIFI_STA, mac); } -float common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { +mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { int8_t tx_power; esp_wifi_get_max_tx_power(&tx_power); return tx_power / 4.0; From 98692150ac890582b989bba2499f3ce330d35b53 Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Sat, 9 Jul 2022 22:17:12 -0700 Subject: [PATCH 065/108] Update ports/espressif/common-hal/wifi/Radio.c Co-authored-by: Dan Halbert --- ports/espressif/common-hal/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index ac997cc0b7..9503d5ab36 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -142,7 +142,7 @@ void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { int8_t tx_power; esp_wifi_get_max_tx_power(&tx_power); - return tx_power / 4.0; + return tx_power / 4.0f; } void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const float tx_power) { From 22e061ba357282c6cd5f57926a3fc9edf4e8bd36 Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Sat, 9 Jul 2022 22:17:18 -0700 Subject: [PATCH 066/108] Update ports/espressif/common-hal/wifi/Radio.c Co-authored-by: Dan Halbert --- ports/espressif/common-hal/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 9503d5ab36..c464ea21d8 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -145,7 +145,7 @@ mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { return tx_power / 4.0f; } -void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const float tx_power) { +void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t tx_power) { esp_wifi_set_max_tx_power(tx_power * 4.0); } From a6580076733d02017c90a23deccbe9ba34daa880 Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Sat, 9 Jul 2022 22:17:26 -0700 Subject: [PATCH 067/108] Update ports/espressif/common-hal/wifi/Radio.c Co-authored-by: Dan Halbert --- ports/espressif/common-hal/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index c464ea21d8..545af1d6cb 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -146,7 +146,7 @@ mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { } void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t tx_power) { - esp_wifi_set_max_tx_power(tx_power * 4.0); + esp_wifi_set_max_tx_power(tx_power * 4.0f); } mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self) { From 5bf07d966210e809909066f12d8ef818920d57d3 Mon Sep 17 00:00:00 2001 From: Tod Kurt Date: Sat, 9 Jul 2022 22:17:35 -0700 Subject: [PATCH 068/108] Update shared-bindings/wifi/Radio.h Co-authored-by: Dan Halbert --- shared-bindings/wifi/Radio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 1e389b6c56..312e9e5395 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -82,8 +82,8 @@ extern void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const extern mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_mac_address_ap(wifi_radio_obj_t *self, const uint8_t *mac); -extern float common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self); -extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const float power); +extern mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t power); extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); From f22f4f896a461b2b6190ba48bffe79e374f17cea Mon Sep 17 00:00:00 2001 From: Nathan Young <77929198+NathanY3G@users.noreply.github.com> Date: Sun, 10 Jul 2022 21:34:07 +0200 Subject: [PATCH 069/108] stm: Make family IDs consistent with TinyUF2 This should allow UF2 images for STM32F405 boards to be flashed by TinyUF2. --- ports/stm/mpconfigport.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 4f18637f13..dd83e0d7bc 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -8,6 +8,9 @@ ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F405xx STM32F407xx)) CIRCUITPY_SDIOIO ?= 1 # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 4 +endif + +ifeq ($(MCU_VARIANT),STM32F407xx) UF2_FAMILY_ID ?= 0x6d0922fa endif From be3482ff05f9f50507dbba7a79732cff0070a7df Mon Sep 17 00:00:00 2001 From: Xu Hao Date: Mon, 11 Jul 2022 16:51:06 +0800 Subject: [PATCH 070/108] Set MICROPY_HW_LED_STATUS pin to the elecfreaks_picoed --- ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h index 0a73b3d73b..03d892091e 100644 --- a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h +++ b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h @@ -1,2 +1,4 @@ #define MICROPY_HW_BOARD_NAME "ELECFREAKS PICO:ED" #define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO25) From 6b474b9e6e3bde394d4fdea10535f7bd207313d3 Mon Sep 17 00:00:00 2001 From: Xu Hao Date: Mon, 11 Jul 2022 21:33:58 +0800 Subject: [PATCH 071/108] Update circuitpython_picoed submodule --- frozen/circuitpython_picoed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/circuitpython_picoed b/frozen/circuitpython_picoed index d890d23f42..53f1560246 160000 --- a/frozen/circuitpython_picoed +++ b/frozen/circuitpython_picoed @@ -1 +1 @@ -Subproject commit d890d23f4261722338280f284cc1640e22e50e14 +Subproject commit 53f15602460329f69fef95498e6b8293aebb513a From 08b4a64bd20ae2413cc55e04a283fc93d68c4b74 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Mon, 11 Jul 2022 08:39:10 -0700 Subject: [PATCH 072/108] Update the PID --- .../boards/espressif_esp32s3_box_lite/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk index 647ad3440a..de3d4cd0ed 100644 --- a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x303A -USB_PID = 0x7005 +USB_PID = 0x700D USB_PRODUCT = "ESP32-S3-Box-Lite" USB_MANUFACTURER = "Espressif" From e92ac0caf4c7e92ba8e51c1dfd510eed9d7827cd Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 11 Jul 2022 11:04:06 -0500 Subject: [PATCH 073/108] adding links in docs --- shared-bindings/keypad/__init__.c | 3 +++ shared-bindings/msgpack/__init__.c | 3 +++ shared-bindings/sharpdisplay/__init__.c | 7 +++++-- shared-bindings/touchio/__init__.c | 5 ++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/shared-bindings/keypad/__init__.c b/shared-bindings/keypad/__init__.c index 97db750af7..3822b8ea53 100644 --- a/shared-bindings/keypad/__init__.c +++ b/shared-bindings/keypad/__init__.c @@ -86,6 +86,9 @@ const mp_obj_property_t keypad_generic_events_obj = { //| connected independently to individual pins, //| connected to a shift register, //| or connected in a row-and-column matrix. +//| +//| For more information about working with the `keypad` module in CircuitPython, +//| see `this Learn guide `_. //| """ //| diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 65374fb443..e13fb28819 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -41,6 +41,9 @@ //| //| Not implemented: 64-bit int, uint, float. //| +//| For more information about working with msgpack, +//| see `the CPython Library Documentation `_. +//| //| Example 1:: //| //| import msgpack diff --git a/shared-bindings/sharpdisplay/__init__.c b/shared-bindings/sharpdisplay/__init__.c index 8c01c8c98c..a7e0bff77d 100644 --- a/shared-bindings/sharpdisplay/__init__.c +++ b/shared-bindings/sharpdisplay/__init__.c @@ -31,9 +31,12 @@ #include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" -//| """Support for Sharp Memory Display framebuffers""" +//| """Support for Sharp Memory Display framebuffers +//| +//| For more information about working with Sharp Memory Displays, +//| see `this Learn guide `_. +//| """ //| - STATIC const mp_rom_map_elem_t sharpdisplay_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sharpdisplay) }, { MP_ROM_QSTR(MP_QSTR_SharpMemoryFramebuffer), MP_ROM_PTR(&sharpdisplay_framebuffer_type) }, diff --git a/shared-bindings/touchio/__init__.c b/shared-bindings/touchio/__init__.c index e2a6ad9317..2d6bf5f31c 100644 --- a/shared-bindings/touchio/__init__.c +++ b/shared-bindings/touchio/__init__.c @@ -45,7 +45,10 @@ //| call :py:meth:`!deinit` or use a context manager. See //| :ref:`lifetime-and-contextmanagers` for more info. //| -//| For example:: +//| For more information about working with the `touchio` module in CircuitPython, +//| see `this Learn guide page `_. +//| +//| Example:: //| //| import touchio //| from board import * From 69b84e0c8e752969a5f1f49b836c3e90ed76ff8f Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 11 Jul 2022 22:05:49 +0200 Subject: [PATCH 074/108] 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/ --- locale/ID.po | 55 +++++++++++++++++++++++++++------ locale/cs.po | 55 +++++++++++++++++++++++++++------ locale/de_DE.po | 66 +++++++++++++++++++++++++++++++--------- locale/el.po | 55 +++++++++++++++++++++++++++------ locale/en_GB.po | 63 +++++++++++++++++++++++++++++++------- locale/es.po | 66 +++++++++++++++++++++++++++++++--------- locale/fil.po | 55 +++++++++++++++++++++++++++------ locale/fr.po | 66 +++++++++++++++++++++++++++++++--------- locale/hi.po | 55 +++++++++++++++++++++++++++------ locale/it_IT.po | 55 +++++++++++++++++++++++++++------ locale/ja.po | 58 +++++++++++++++++++++++++++-------- locale/ko.po | 55 +++++++++++++++++++++++++++------ locale/nl.po | 66 +++++++++++++++++++++++++++++++--------- locale/pl.po | 58 +++++++++++++++++++++++++++-------- locale/pt_BR.po | 66 +++++++++++++++++++++++++++++++--------- locale/ru.po | 55 +++++++++++++++++++++++++++------ locale/sv.po | 66 +++++++++++++++++++++++++++++++--------- locale/tr.po | 55 +++++++++++++++++++++++++++------ locale/zh_Latn_pinyin.po | 66 +++++++++++++++++++++++++++++++--------- 19 files changed, 911 insertions(+), 225 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 16ba43395a..06ec3d9769 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -2383,6 +2383,10 @@ msgstr "argumen harus berupa ndarrays" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2750,6 +2754,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2841,6 +2849,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap kosong" @@ -2944,7 +2956,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3092,7 +3104,7 @@ msgstr "" msgid "incorrect padding" msgstr "lapisan (padding) tidak benar" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3159,6 +3171,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3167,11 +3183,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3372,7 +3384,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3621,7 +3633,7 @@ msgstr "panjang data string memiliki keganjilan (odd-length)" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3772,6 +3784,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4207,6 +4220,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4248,7 +4269,17 @@ msgstr "indeks sumbu salah" msgid "wrong axis specified" msgstr "sumbu yang ditentukan salah" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "tipe input salah" @@ -4256,6 +4287,10 @@ msgstr "tipe input salah" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "jumlah argumen salah" diff --git a/locale/cs.po b/locale/cs.po index ee6688f185..cd5167bd28 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -2370,6 +2370,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2737,6 +2741,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2828,6 +2836,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2931,7 +2943,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3079,7 +3091,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3146,6 +3158,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3154,11 +3170,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3359,7 +3371,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3608,7 +3620,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3758,6 +3770,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4193,6 +4206,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4234,7 +4255,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4242,6 +4273,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 2f31a32f02..faa220b622 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2422,6 +2422,10 @@ msgstr "Argumente müssen ndarrays sein" msgid "array and index length must be equal" msgstr "Array- und Indexlänge müssen gleich sein" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2799,6 +2803,10 @@ msgstr "Convolve-Argumente müssen ndarrays sein" msgid "convolve arguments must not be empty" msgstr "Convolve Argumente dürfen nicht leer sein" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" @@ -2892,6 +2900,10 @@ msgstr "dtype muss Float oder komplex sein" msgid "empty" msgstr "leer" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "leerer heap" @@ -2995,7 +3007,7 @@ msgstr "das erste Argument muss eine Funktion sein" msgid "first argument must be a tuple of ndarrays" msgstr "das erste Argument muss ein Tupel von ndarrays sein" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "Das erste Argument muss ein Ndarray sein" @@ -3145,7 +3157,7 @@ msgstr "unvollständiger Formatschlüssel" msgid "incorrect padding" msgstr "padding ist inkorrekt" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" @@ -3212,6 +3224,10 @@ msgstr "Eingabematrix ist asymmetrisch" msgid "input matrix is singular" msgstr "Eingabematrix ist singulär" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "Eingabe muss ein 1D ndarray sein" @@ -3220,11 +3236,7 @@ msgstr "Eingabe muss ein 1D ndarray sein" msgid "input must be a dense ndarray" msgstr "Eingabe muss ein dichtes ndarray sein" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "Eingabe muss ein Tensor von Rang 2 sein" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "Eingabe muss ein ndarray sein" @@ -3431,8 +3443,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length muss 0-%d sein, wenn fixed_length %s ist" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "die maximale Anzahl der Dimensionen beträgt 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3681,7 +3693,7 @@ msgstr "String mit ungerader Länge" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "Offset ist zu groß" @@ -3835,6 +3847,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() mit 3 Argumenten erfordert Integer" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "Drücken der Boot-Taste beim Start.\n" @@ -4275,6 +4288,14 @@ msgstr "nicht unterstützter Typ für Operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "nicht unterstützte Typen für %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4316,7 +4337,17 @@ msgstr "falscher Achsenindex" msgid "wrong axis specified" msgstr "falsche Achse gewählt" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "falscher Indextyp" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "falscher Eingabetyp" @@ -4324,6 +4355,10 @@ msgstr "falscher Eingabetyp" msgid "wrong length of condition array" msgstr "falsche Länge des Array von Bedingungen" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -4368,6 +4403,12 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "Eingabe muss ein Tensor von Rang 2 sein" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "die maximale Anzahl der Dimensionen beträgt 4" + #~ msgid "Watchdog timer expired." #~ msgstr "Watchdog timer abgelaufen." @@ -5131,9 +5172,6 @@ msgstr "zi muss die Form (n_section, 2) haben" #~ msgid "wrong argument type" #~ msgstr "falscher Argumenttyp" -#~ msgid "wrong index type" -#~ msgstr "falscher Indextyp" - #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/el.po b/locale/el.po index 454be46f59..540dde009c 100644 --- a/locale/el.po +++ b/locale/el.po @@ -2352,6 +2352,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2719,6 +2723,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2810,6 +2818,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2913,7 +2925,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3061,7 +3073,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3128,6 +3140,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3136,11 +3152,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3341,7 +3353,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3590,7 +3602,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3740,6 +3752,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4175,6 +4188,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4216,7 +4237,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4224,6 +4255,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 951b573b3b..9243e0c73b 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -2386,6 +2386,10 @@ msgstr "arguments must be ndarrays" msgid "array and index length must be equal" msgstr "array and index length must be equal" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2755,6 +2759,10 @@ msgstr "convolve arguments must be ndarrays" msgid "convolve arguments must not be empty" msgstr "convolve arguments must not be empty" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "could not invert Vandermonde matrix" @@ -2847,6 +2855,10 @@ msgstr "" msgid "empty" msgstr "empty" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "empty heap" @@ -2950,7 +2962,7 @@ msgstr "first argument must be a function" msgid "first argument must be a tuple of ndarrays" msgstr "first argument must be a tuple of ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "first argument must be an ndarray" @@ -3098,7 +3110,7 @@ msgstr "incomplete format key" msgid "incorrect padding" msgstr "incorrect padding" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "index is out of bounds" @@ -3165,6 +3177,10 @@ msgstr "input matrix is asymmetric" msgid "input matrix is singular" msgstr "input matrix is singular" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3173,11 +3189,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "input must be a dense ndarray" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "input must be a tensor of rank 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "input must be an ndarray" @@ -3378,8 +3390,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length must be 0-%d when fixed_length is %s" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3627,7 +3639,7 @@ msgstr "odd-length string" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset is too large" @@ -3777,6 +3789,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() with 3 arguments requires integers" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "pressing boot button at start up.\n" @@ -4214,6 +4227,14 @@ msgstr "unsupported type for operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "unsupported types for %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4255,7 +4276,17 @@ msgstr "wrong axis index" msgid "wrong axis specified" msgstr "wrong axis specified" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "wrong input type" @@ -4263,6 +4294,10 @@ msgstr "wrong input type" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "wrong number of arguments" @@ -4307,6 +4342,12 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "input must be a tensor of rank 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "maximum number of dimensions is 4" + #~ msgid "Watchdog timer expired." #~ msgstr "WatchDog timer expired." diff --git a/locale/es.po b/locale/es.po index 608f59ca29..05e913ae03 100644 --- a/locale/es.po +++ b/locale/es.po @@ -2419,6 +2419,10 @@ msgstr "argumentos deben ser ndarrays" msgid "array and index length must be equal" msgstr "Longitud del array e índice tienen que ser iguales" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2791,6 +2795,10 @@ msgstr "los argumentos para convolve deben ser ndarrays" msgid "convolve arguments must not be empty" msgstr "los argumentos para convolve no deben estar vacíos" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "no se pudo invertir la matriz de Vandermonde" @@ -2884,6 +2892,10 @@ msgstr "" msgid "empty" msgstr "vacío" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vacío" @@ -2987,7 +2999,7 @@ msgstr "el primer argumento debe ser una función" msgid "first argument must be a tuple of ndarrays" msgstr "Primer argumento tiene que ser una tupla de ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "el primer argumento debe ser ndarray" @@ -3135,7 +3147,7 @@ msgstr "formato de llave incompleto" msgid "incorrect padding" msgstr "relleno (padding) incorrecto" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "el índice está fuera de límites" @@ -3202,6 +3214,10 @@ msgstr "la matriz de entrada es asimétrica" msgid "input matrix is singular" msgstr "la matriz de entrada es singular" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3210,11 +3226,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "Entrada tiene que ser un ndarray denso" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "Entrada tiene que ser un tensor de rango 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "Entrada tiene que ser un ndarray" @@ -3418,8 +3430,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length debe ser 0-%d cuando fixed_length es %s" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "Máximo número de dimensiones es 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3671,7 +3683,7 @@ msgstr "string de longitud impar" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset es demasiado grande" @@ -3821,6 +3833,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "presionando botón de arranque al inicio.\n" @@ -4259,6 +4272,14 @@ msgstr "tipo de operador no soportado" msgid "unsupported types for %q: '%q', '%q'" msgstr "tipos no soportados para %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4300,7 +4321,17 @@ msgstr "indice de eje erróneo" msgid "wrong axis specified" msgstr "eje especificado erróneo" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "tipo de índice incorrecto" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "tipo de entrada incorrecta" @@ -4308,6 +4339,10 @@ msgstr "tipo de entrada incorrecta" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -4352,6 +4387,12 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "Entrada tiene que ser un tensor de rango 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "Máximo número de dimensiones es 4" + #~ msgid "Watchdog timer expired." #~ msgstr "Temporizador de perro guardián expirado." @@ -5210,9 +5251,6 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "wrong argument type" #~ msgstr "tipo de argumento incorrecto" -#~ msgid "wrong index type" -#~ msgstr "tipo de índice incorrecto" - #~ msgid "specify size or data, but not both" #~ msgstr "especifique o tamaño o datos, pero no ambos" diff --git a/locale/fil.po b/locale/fil.po index 821bf45dbf..d2509b761f 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2372,6 +2372,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2746,6 +2750,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2841,6 +2849,10 @@ msgstr "" msgid "empty" msgstr "walang laman" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "walang laman ang heap" @@ -2945,7 +2957,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3094,7 +3106,7 @@ msgstr "hindi kumpleto ang format key" msgid "incorrect padding" msgstr "mali ang padding" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3161,6 +3173,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3169,11 +3185,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3378,7 +3390,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3627,7 +3639,7 @@ msgstr "odd-length string" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3779,6 +3791,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4217,6 +4230,14 @@ msgstr "hindi sinusuportahang type para sa operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4258,7 +4279,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4266,6 +4297,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" diff --git a/locale/fr.po b/locale/fr.po index 7e282a026c..9c892a7f11 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2453,6 +2453,10 @@ msgstr "les paramètres doivent être des ndarrays" msgid "array and index length must be equal" msgstr "la taille de la matrice et de l'index doivent être égaux" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2830,6 +2834,10 @@ msgstr "les paramêtres pour convolve doivent être des ndarrays" msgid "convolve arguments must not be empty" msgstr "les arguments convolve ne doivent pas être vides" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" @@ -2924,6 +2932,10 @@ msgstr "le dtype doit être un flottant, ou un complexe" msgid "empty" msgstr "vide" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tas vide" @@ -3027,7 +3039,7 @@ msgstr "le premier argument doit être une fonction" msgid "first argument must be a tuple of ndarrays" msgstr "le premier paramêtre doit être un tuple de ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "le premier paramêtre doit être un ndarray" @@ -3175,7 +3187,7 @@ msgstr "clé de format incomplète" msgid "incorrect padding" msgstr "espacement incorrect" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "l'index est hors limites" @@ -3243,6 +3255,10 @@ msgstr "la matrice d'entrée est asymétrique" msgid "input matrix is singular" msgstr "la matrice d'entrée est singulière" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "l'entrée doit être un ndarray 1D" @@ -3251,11 +3267,7 @@ msgstr "l'entrée doit être un ndarray 1D" msgid "input must be a dense ndarray" msgstr "l'entrée doit être un ndarray dense" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "l'entrée doit être un tenseur de rang 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "l'entrée doit être un ndarray" @@ -3462,8 +3474,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length doit être 0-%d lorsque fixed_length est %s" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "nombre maximal de dimensions est 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3713,7 +3725,7 @@ msgstr "chaîne de longueur impaire" msgid "off" msgstr "inactif" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset est trop large" @@ -3866,6 +3878,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "bouton boot appuyé lors du démarrage.\n" @@ -4304,6 +4317,14 @@ msgstr "type non supporté pour l'opérateur" msgid "unsupported types for %q: '%q', '%q'" msgstr "types non supportés pour %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4345,7 +4366,17 @@ msgstr "index d'axe incorrecte" msgid "wrong axis specified" msgstr "axe incorrecte spécifiée" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "type d'index incorrect" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "type d'entrée incorrect" @@ -4353,6 +4384,10 @@ msgstr "type d'entrée incorrect" msgid "wrong length of condition array" msgstr "mauvaise taille du tableau de condition" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -4397,6 +4432,12 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "l'entrée doit être un tenseur de rang 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "nombre maximal de dimensions est 4" + #~ msgid "Watchdog timer expired." #~ msgstr "Le minuteur Watchdog a expiré." @@ -5270,9 +5311,6 @@ msgstr "zi doit être de forme (n_section, 2)" #~ msgid "wrong argument type" #~ msgstr "type d'argument incorrect" -#~ msgid "wrong index type" -#~ msgstr "type d'index incorrect" - #~ msgid "Must provide SCK pin" #~ msgstr "Vous devez fournir un code PIN SCK" diff --git a/locale/hi.po b/locale/hi.po index db817163af..1cd3603ccb 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -2352,6 +2352,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2719,6 +2723,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2810,6 +2818,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2913,7 +2925,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3061,7 +3073,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3128,6 +3140,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3136,11 +3152,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3341,7 +3353,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3590,7 +3602,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3740,6 +3752,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4175,6 +4188,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4216,7 +4237,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4224,6 +4255,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index b58f3c963f..8c8ac6e551 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -2382,6 +2382,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2755,6 +2759,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2849,6 +2857,10 @@ msgstr "" msgid "empty" msgstr "vuoto" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vuoto" @@ -2953,7 +2965,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3102,7 +3114,7 @@ msgstr "" msgid "incorrect padding" msgstr "padding incorretto" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3169,6 +3181,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3177,11 +3193,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3387,7 +3399,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3638,7 +3650,7 @@ msgstr "stringa di lunghezza dispari" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3792,6 +3804,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4230,6 +4243,14 @@ msgstr "tipo non supportato per l'operando" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4271,7 +4292,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4279,6 +4310,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" diff --git a/locale/ja.po b/locale/ja.po index 466fbdd362..e45ac2ff0f 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -2366,6 +2366,10 @@ msgstr "引数はndarrayでなければなりません" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2735,6 +2739,10 @@ msgstr "convolve引数はndarrayでなければなりません" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "ヴァンデルモンド行列の逆行列を求められません" @@ -2828,6 +2836,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2931,7 +2943,7 @@ msgstr "1つ目の引数は関数でなければなりません" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "1つ目の引数はndarrayでなければなりません" @@ -3079,7 +3091,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3147,6 +3159,10 @@ msgstr "入力行列が非対称" msgid "input matrix is singular" msgstr "入力が非正則行列" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3155,11 +3171,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3360,7 +3372,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3609,7 +3621,7 @@ msgstr "奇数長の文字列" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3761,6 +3773,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4197,6 +4210,14 @@ msgstr "演算子が対応していない型" msgid "unsupported types for %q: '%q', '%q'" msgstr "%q が対応していない型: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4238,7 +4259,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "インデクスの型が不正" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4246,6 +4277,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -4832,9 +4867,6 @@ msgstr "" #~ msgid "wrong argument type" #~ msgstr "引数の型が不正" -#~ msgid "wrong index type" -#~ msgstr "インデクスの型が不正" - #~ msgid "Must provide SCK pin" #~ msgstr "SCKピンが必要" diff --git a/locale/ko.po b/locale/ko.po index f01d690729..ec1f2371fc 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -2356,6 +2356,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2723,6 +2727,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2814,6 +2822,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2917,7 +2929,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3065,7 +3077,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3132,6 +3144,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3140,11 +3156,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3345,7 +3357,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3594,7 +3606,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3744,6 +3756,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4179,6 +4192,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4220,7 +4241,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4228,6 +4259,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 7db50b2eea..4a1f3ab520 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -2382,6 +2382,10 @@ msgstr "argumenten moeten ndarrays zijn" msgid "array and index length must be equal" msgstr "array en indexlengte moeten gelijk zijn" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2750,6 +2754,10 @@ msgstr "convolutie argumenten moeten ndarrays zijn" msgid "convolve arguments must not be empty" msgstr "convolutie argumenten mogen niet leeg zijn" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" @@ -2843,6 +2851,10 @@ msgstr "" msgid "empty" msgstr "leeg" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "lege heap" @@ -2946,7 +2958,7 @@ msgstr "eerste argument moet een functie zijn" msgid "first argument must be a tuple of ndarrays" msgstr "eerste argument moet een tupel van ndarrays zijn" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "eerst argument moet een ndarray zijn" @@ -3095,7 +3107,7 @@ msgstr "incomplete formaatsleutel" msgid "incorrect padding" msgstr "vulling (padding) is onjuist" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "index is buiten bereik" @@ -3162,6 +3174,10 @@ msgstr "invoermatrix is asymmetrisch" msgid "input matrix is singular" msgstr "invoermatrix is singulier" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3170,11 +3186,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "invoer moet een gesloten ndarray zijn" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "invoer moet een tensor van rang 2 zijn" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "invoer moet een ndarray zijn" @@ -3378,8 +3390,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length moet 0-%d zijn als fixed_length %s is" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "maximaal aantal dimensies is 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3627,7 +3639,7 @@ msgstr "string met oneven lengte" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "compensatie is te groot" @@ -3777,6 +3789,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "druk bootknop in bij opstarten.\n" @@ -4214,6 +4227,14 @@ msgstr "niet ondersteund type voor operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "niet ondersteunde types voor %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4255,7 +4276,17 @@ msgstr "foute index voor as" msgid "wrong axis specified" msgstr "onjuiste as gespecificeerd" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "onjuist indextype" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "onjuist invoertype" @@ -4263,6 +4294,10 @@ msgstr "onjuist invoertype" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "onjuist aantal argumenten" @@ -4307,6 +4342,12 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "invoer moet een tensor van rang 2 zijn" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "maximaal aantal dimensies is 4" + #~ msgid "Watchdog timer expired." #~ msgstr "Watchdog-timer verstreken." @@ -5037,9 +5078,6 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "wrong argument type" #~ msgstr "onjuist argumenttype" -#~ msgid "wrong index type" -#~ msgstr "onjuist indextype" - #~ msgid "Must provide SCK pin" #~ msgstr "SCK pin moet opgegeven worden" diff --git a/locale/pl.po b/locale/pl.po index 0e6137203e..fbf2283bfa 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -2363,6 +2363,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2730,6 +2734,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2822,6 +2830,10 @@ msgstr "" msgid "empty" msgstr "puste" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "pusta sterta" @@ -2925,7 +2937,7 @@ msgstr "pierwszy argument musi być funkcją" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3073,7 +3085,7 @@ msgstr "niepełny klucz formatu" msgid "incorrect padding" msgstr "złe wypełnienie" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "indeks jest poza zakresem" @@ -3140,6 +3152,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3148,11 +3164,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3353,7 +3365,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3602,7 +3614,7 @@ msgstr "łańcuch o nieparzystej długości" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3753,6 +3765,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4189,6 +4202,14 @@ msgstr "zły typ dla operatora" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4230,7 +4251,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "zły typ indeksu" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "nieprawidłowy typ wejścia" @@ -4238,6 +4269,10 @@ msgstr "nieprawidłowy typ wejścia" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -4747,9 +4782,6 @@ msgstr "" #~ msgid "wrong argument type" #~ msgstr "zły typ argumentu" -#~ msgid "wrong index type" -#~ msgstr "zły typ indeksu" - #~ msgid "Must provide SCK pin" #~ msgstr "Należy podać pin SCK" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b89963bf8f..b447e8e7c7 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2435,6 +2435,10 @@ msgstr "os argumentos devem ser ndarrays" msgid "array and index length must be equal" msgstr "a matriz e comprimento do índice devem ser iguais" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2808,6 +2812,10 @@ msgstr "os argumentos convolutivos devem ser ndarrays" msgid "convolve arguments must not be empty" msgstr "os argumentos convolutivos não devem estar vazios" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" @@ -2902,6 +2910,10 @@ msgstr "dtype deve ser flutuante ou complexo" msgid "empty" msgstr "vazio" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "a área de alocação dinâmica de variáveis (heap) está vazia" @@ -3005,7 +3017,7 @@ msgstr "o primeiro argumento deve ser uma função" msgid "first argument must be a tuple of ndarrays" msgstr "o primeiro argumento deve ser um tuple de ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "o primeiro argumento deve ser um ndarray" @@ -3153,7 +3165,7 @@ msgstr "a chave do formato está incompleto" msgid "incorrect padding" msgstr "preenchimento incorreto" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "o índice está fora dos limites" @@ -3221,6 +3233,10 @@ msgstr "a matriz da entrada é assimétrica" msgid "input matrix is singular" msgstr "a matriz da entrada é singular" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "a entrada deve ser um 1D ndarray" @@ -3229,11 +3245,7 @@ msgstr "a entrada deve ser um 1D ndarray" msgid "input must be a dense ndarray" msgstr "a entrada deve ser um ndarray denso" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "a entrada dos dados deve ser um tensor de nível 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "a entrada deve ser um ndarray" @@ -3437,8 +3449,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "O número máximo de dimensões são 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3688,7 +3700,7 @@ msgstr "sequência com comprimento ímpar" msgid "off" msgstr "desligado" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "o offset é muito grande" @@ -3843,6 +3855,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "pressionando o botão de boot na inicialização.\n" @@ -4280,6 +4293,14 @@ msgstr "tipo não compatível para o operador" msgid "unsupported types for %q: '%q', '%q'" msgstr "tipo sem suporte para %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4321,7 +4342,17 @@ msgstr "índice do eixo errado" msgid "wrong axis specified" msgstr "um eixo errado foi definido" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "tipo do índice errado" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "tipo da entrada incorreta" @@ -4329,6 +4360,10 @@ msgstr "tipo da entrada incorreta" msgid "wrong length of condition array" msgstr "comprimento errado na condição da matriz" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "quantidade errada dos argumentos" @@ -4373,6 +4408,12 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "a entrada dos dados deve ser um tensor de nível 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "O número máximo de dimensões são 4" + #~ msgid "Watchdog timer expired." #~ msgstr "O temporizador Watchdog expirou." @@ -5295,9 +5336,6 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "wrong argument type" #~ msgstr "tipo do argumento errado" -#~ msgid "wrong index type" -#~ msgstr "tipo do índice errado" - #~ msgid "specify size or data, but not both" #~ msgstr "defina o tamanho ou os dados, porém não ambos" diff --git a/locale/ru.po b/locale/ru.po index bac9e97b7b..9625bd470c 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -2401,6 +2401,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2768,6 +2772,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2859,6 +2867,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2962,7 +2974,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3110,7 +3122,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3177,6 +3189,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3185,11 +3201,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3390,7 +3402,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3639,7 +3651,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3789,6 +3801,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4224,6 +4237,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4265,7 +4286,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4273,6 +4304,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 683d5b380f..23f6013a74 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2405,6 +2405,10 @@ msgstr "argumenten måste vara ndarray" msgid "array and index length must be equal" msgstr "array och indexlängd måste vara lika" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2774,6 +2778,10 @@ msgstr "Argumenten convolve måste vara ndarray:er" msgid "convolve arguments must not be empty" msgstr "Argumenten convolve kan inte vara tomma" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" @@ -2868,6 +2876,10 @@ msgstr "dtype måste vara float eller complex" msgid "empty" msgstr "tom" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tom heap" @@ -2971,7 +2983,7 @@ msgstr "första argumentet måste vara en funktion" msgid "first argument must be a tuple of ndarrays" msgstr "första argumentet måste vara en tupel av ndarray" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "första argumentet måste vara en ndarray" @@ -3119,7 +3131,7 @@ msgstr "ofullständig formatnyckel" msgid "incorrect padding" msgstr "felaktig utfyllnad" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "index är utanför gränserna" @@ -3186,6 +3198,10 @@ msgstr "indatamatrisen är asymmetrisk" msgid "input matrix is singular" msgstr "indatamatrisen är singulär" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "indata måste vara en 1D ndarray" @@ -3194,11 +3210,7 @@ msgstr "indata måste vara en 1D ndarray" msgid "input must be a dense ndarray" msgstr "indata måste vara en dense ndarray" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "indata måste vara en tensor av rank 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "indata måste vara en ndarray" @@ -3402,8 +3414,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length måste vara 0-%d när fixed_length är %s" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "maximalt antal dimensioner är 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3651,7 +3663,7 @@ msgstr "sträng har udda längd" msgid "off" msgstr "av" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset är för stor" @@ -3802,6 +3814,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() med 3 argument kräver heltal" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "trycka på startknappen vid start.\n" @@ -4239,6 +4252,14 @@ msgstr "typ stöds inte för operatören" msgid "unsupported types for %q: '%q', '%q'" msgstr "typen %q stöder inte '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4280,7 +4301,17 @@ msgstr "fel axelindex" msgid "wrong axis specified" msgstr "fel axel angiven" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "fel indextyp" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "fel indatatyp" @@ -4288,6 +4319,10 @@ msgstr "fel indatatyp" msgid "wrong length of condition array" msgstr "fel längd på villkorsmatrisen" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "fel antal argument" @@ -4332,6 +4367,12 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "indata måste vara en tensor av rank 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "maximalt antal dimensioner är 4" + #~ msgid "Watchdog timer expired." #~ msgstr "Watchdog-timern har löpt ut." @@ -5236,9 +5277,6 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "wrong argument type" #~ msgstr "fel typ av argument" -#~ msgid "wrong index type" -#~ msgstr "fel indextyp" - #~ msgid "specify size or data, but not both" #~ msgstr "ange storlek eller data, men inte båda" diff --git a/locale/tr.po b/locale/tr.po index b303e6419a..529ecdbee9 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -2372,6 +2372,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2739,6 +2743,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2830,6 +2838,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2933,7 +2945,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3081,7 +3093,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3148,6 +3160,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3156,11 +3172,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3361,7 +3373,7 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3610,7 +3622,7 @@ msgstr "" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -3760,6 +3772,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4195,6 +4208,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4236,7 +4257,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4244,6 +4275,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index c6e7e7b364..186c640e3d 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -2416,6 +2416,10 @@ msgstr "cānshù bìxū shì ndarrays" msgid "array and index length must be equal" msgstr "shù zǔ hé suǒ yǐn cháng dù bì xū xiāng děng" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2787,6 +2791,10 @@ msgstr "juàn jī cānshù bìxū shì ndarrays" msgid "convolve arguments must not be empty" msgstr "juàn jī cān shǔ bùnéng wéi kōng" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "wúfǎ fǎn zhuǎn fàndéméng dé jǔzhèn" @@ -2880,6 +2888,10 @@ msgstr "dtype bì xū shì fú diǎn xíng huò fù shù" msgid "empty" msgstr "kòngxián" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "kōng yīn yīnxiào" @@ -2983,7 +2995,7 @@ msgstr "dì yīgè cānshù bìxū shì yī gè hánshù" msgid "first argument must be a tuple of ndarrays" msgstr "dì yī gè cān shù bì xū shì yí gè yuán zǔ ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "dì yī gè cānshù bìxū shì ndarray" @@ -3131,7 +3143,7 @@ msgstr "géshì bù wánzhěng de mì yào" msgid "incorrect padding" msgstr "bù zhèngquè de tiánchōng" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" @@ -3198,6 +3210,10 @@ msgstr "shūrù jǔzhèn bù duìchèn" msgid "input matrix is singular" msgstr "shūrù jǔzhèn shì qíyì de" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "shū rù bì xū shì 1D ndarray" @@ -3206,11 +3222,7 @@ msgstr "shū rù bì xū shì 1D ndarray" msgid "input must be a dense ndarray" msgstr "shū rù bì xū shì mì jí de ndarray" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "shū rù bì xū shì děng jí 2 de zhāng liàng" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "shū rù bì xū shì ndarray" @@ -3412,8 +3424,8 @@ msgid "max_length must be 0-%d when fixed_length is %s" msgstr "dāng fixed_length de zhí wéi %s shí, max_length bì xū wéi 0-%d" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "zuì dà chǐ cùn shù wéi 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3661,7 +3673,7 @@ msgstr "jīshù zìfú chuàn" msgid "off" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "piān yí tài dà" @@ -3811,6 +3823,7 @@ msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" @@ -4251,6 +4264,14 @@ msgstr "bù zhīchí de cāozuò zhě lèixíng" msgid "unsupported types for %q: '%q', '%q'" msgstr "%q bù zhīchí de lèixíng: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4292,7 +4313,17 @@ msgstr "cuò wù de zhóu suǒ yǐn" msgid "wrong axis specified" msgstr "zhǐ dìng de zhóu cuò wù" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "cuòwù de suǒyǐn lèixíng" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "shūrù lèixíng cuòwù" @@ -4300,6 +4331,10 @@ msgstr "shūrù lèixíng cuòwù" msgid "wrong length of condition array" msgstr "tiáo jiàn shù zǔ de cháng dù cuò wù" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -4344,6 +4379,12 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "shū rù bì xū shì děng jí 2 de zhāng liàng" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "zuì dà chǐ cùn shù wéi 4" + #~ msgid "Watchdog timer expired." #~ msgstr "Kān mén gǒu dìngshí qì yǐ guòqí." @@ -5214,9 +5255,6 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "wrong argument type" #~ msgstr "cuòwù de cānshù lèixíng" -#~ msgid "wrong index type" -#~ msgstr "cuòwù de suǒyǐn lèixíng" - #~ msgid "Must provide SCK pin" #~ msgstr "bì xū tí gòng SCK yǐn jiǎo" From d9f6e999422a1deedcc5c6f82d87171056e646d6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 11 Jul 2022 13:36:44 -0700 Subject: [PATCH 075/108] Fix RP2040 UART It couldn't receive more than 32 bytes in while checking in_waiting because in_waiting didn't turn interrupts back on correctly. Fixes #6579 --- ports/raspberrypi/common-hal/busio/UART.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index d1ed3ea27a..c06bb21903 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -311,7 +311,7 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { // The UART only interrupts after a threshold so make sure to copy anything // out of its FIFO before measuring how many bytes we've received. _copy_into_ringbuf(&self->ringbuf, self->uart); - irq_set_enabled(self->uart_irq_id, false); + irq_set_enabled(self->uart_irq_id, true); return ringbuf_num_filled(&self->ringbuf); } From 8cfdfb95f78a8f5082fbdefcd0c8adbf5cb49cc6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 11 Jul 2022 14:32:28 -0700 Subject: [PATCH 076/108] Remove extra logging, auth /cp/serial and add doc --- docs/workflows.md | 78 +++++++++++-------- .../shared/web_workflow/static/welcome.html | 3 +- supervisor/shared/web_workflow/web_workflow.c | 4 +- supervisor/shared/web_workflow/websocket.c | 9 --- 4 files changed, 50 insertions(+), 44 deletions(-) diff --git a/docs/workflows.md b/docs/workflows.md index 1b262011b2..b011acd01c 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -286,6 +286,44 @@ not protected by basic auth in case the device is someone elses. Only `GET` requests are supported and will return `405 Method Not Allowed` otherwise. +#### `/cp/devices.json` + +Returns information about other devices found on the network using MDNS. + +* `total`: Total MDNS response count. May be more than in `devices` if internal limits were hit. +* `devices`: List of discovered devices. + * `hostname`: MDNS hostname + * `instance_name`: MDNS instance name. Defaults to human readable board name. + * `port`: Port of CircuitPython Web API + * `ip`: IP address + +Example: +```sh +curl -v -L http://circuitpython.local/cp/devices.json +``` + +```json +{ + "total": 1, + "devices": [ + { + "hostname": "cpy-951032", + "instance_name": "Adafruit Feather ESP32-S2 TFT", + "port": 80, + "ip": "192.168.1.235" + } + ] +} +``` + +#### `/cp/serial/` + + +Serves a basic serial terminal program when a `GET` request is received without the +`Upgrade: websocket` header. Otherwise the socket is upgraded to a WebSocket. See WebSockets below for more detail. + +This is an authenticated endpoint in both modes. + #### `/cp/version.json` Returns information about the device. @@ -323,36 +361,6 @@ curl -v -L http://circuitpython.local/cp/version.json } ``` -#### `/cp/devices.json` - -Returns information about other devices found on the network using MDNS. - -* `total`: Total MDNS response count. May be more than in `devices` if internal limits were hit. -* `devices`: List of discovered devices. - * `hostname`: MDNS hostname - * `instance_name`: MDNS instance name. Defaults to human readable board name. - * `port`: Port of CircuitPython Web API - * `ip`: IP address - -Example: -```sh -curl -v -L http://circuitpython.local/cp/devices.json -``` - -```json -{ - "total": 1, - "devices": [ - { - "hostname": "cpy-951032", - "instance_name": "Adafruit Feather ESP32-S2 TFT", - "port": 80, - "ip": "192.168.1.235" - } - ] -} -``` - ### Static files * `/favicon.ico` - Blinka @@ -361,4 +369,12 @@ curl -v -L http://circuitpython.local/cp/devices.json ### WebSocket -Coming soon! +The CircuitPython serial interactions are available over a WebSocket. A WebSocket begins as a +special HTTP request that gets upgraded to a WebSocket. Authentication happens before upgrading. + +WebSockets are *not* bare sockets once upgraded. Instead they have their own framing format for data. +CircuitPython can handle PING and CLOSE opcodes. All others are treated as TEXT. Data to +CircuitPython is expected to be masked UTF-8, as the spec requires. Data from CircuitPython to the +client is unmasked. It is also unbuffered so the client will get a variety of frame sizes. + +Only one WebSocket at a time is supported. diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index 6ef1ccd767..139e9eba39 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -3,11 +3,12 @@ CircuitPython +

 Welcome!

- Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank. + Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank.

Device Info

Board:
Version:
diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index c7bf673fdc..3f9920d1c7 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -1019,14 +1019,13 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (strcmp(path, "/version.json") == 0) { _reply_with_version_json(socket, request); } else if (strcmp(path, "/serial/") == 0) { - if (false && !request->authenticated) { + if (!request->authenticated) { if (_api_password[0] != '\0') { _reply_unauthorized(socket, request); } else { _reply_forbidden(socket, request); } } else if (request->websocket) { - ESP_LOGI(TAG, "websocket!"); _reply_websocket_upgrade(socket, request); } else { _REPLY_STATIC(socket, request, serial_html); @@ -1059,7 +1058,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } static void _reset_request(_request *request) { - ESP_LOGI(TAG, "reset request"); request->state = STATE_METHOD; request->origin[0] = '\0'; request->content_length = 0; diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 7a2f37b168..8d3941b434 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -48,7 +48,6 @@ void websocket_init(void) { } void websocket_handoff(socketpool_socket_obj_t *socket) { - ESP_LOGI(TAG, "socket handed off"); cp_serial.socket = *socket; cp_serial.closed = false; cp_serial.opcode = 0; @@ -57,7 +56,6 @@ void websocket_handoff(socketpool_socket_obj_t *socket) { // Mark the original socket object as closed without telling the lower level. socket->connected = false; socket->num = -1; - ESP_LOGI(TAG, "socket hand off done"); } bool websocket_connected(void) { @@ -90,7 +88,6 @@ static void _read_next_frame_header(void) { if (cp_serial.frame_index == 0 && _read_byte(&h)) { cp_serial.frame_index++; cp_serial.opcode = h & 0xf; - ESP_LOGI(TAG, "fin %d opcode %x", h >> 7, cp_serial.opcode); } if (cp_serial.frame_index == 1 && _read_byte(&h)) { cp_serial.frame_index++; @@ -108,8 +105,6 @@ static void _read_next_frame_header(void) { if (cp_serial.masked) { cp_serial.frame_len += 4; } - - ESP_LOGI(TAG, "mask %d length %x", cp_serial.masked, len); } while (cp_serial.frame_index >= 2 && cp_serial.frame_index < (cp_serial.payload_len_size + 2) && @@ -133,7 +128,6 @@ static void _read_next_frame_header(void) { if (cp_serial.frame_index == cp_serial.frame_len) { uint8_t opcode = 0x8; // CLOSE if (cp_serial.opcode == 0x9) { - ESP_LOGI(TAG, "websocket ping"); opcode = 0xA; // PONG } else { // Set the TCP socket to send immediately so that we send the payload back before @@ -160,7 +154,6 @@ static void _read_next_frame_header(void) { if (cp_serial.payload_remaining == 0) { cp_serial.frame_index = 0; if (cp_serial.opcode == 0x8) { - ESP_LOGI(TAG, "websocket closed"); cp_serial.closed = true; common_hal_socketpool_socket_close(&cp_serial.socket); @@ -199,7 +192,6 @@ bool websocket_available(void) { char websocket_read_char(void) { uint8_t c; _read_next_payload_byte(&c); - ESP_LOGI(TAG, "read %c", c); return c; } @@ -232,7 +224,6 @@ static void _websocket_send(_websocket *ws, const char *text, size_t len) { char copy[len]; memcpy(copy, text, len); copy[len] = '\0'; - ESP_LOGI(TAG, "sent over websocket: %s", copy); } void websocket_write(const char *text, size_t len) { From 425a0efeca5da563f981bc8dd271bf7f9421fb5d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 11 Jul 2022 14:53:20 -0700 Subject: [PATCH 077/108] A bit more cleanup --- shared-bindings/hashlib/Hash.c | 7 ------- .../shared/web_workflow/static/serial.js | 2 -- supervisor/shared/web_workflow/web_workflow.c | 21 ++++++++----------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/shared-bindings/hashlib/Hash.c b/shared-bindings/hashlib/Hash.c index 5dab05fa10..e27b71ef78 100644 --- a/shared-bindings/hashlib/Hash.c +++ b/shared-bindings/hashlib/Hash.c @@ -26,13 +26,6 @@ #include "shared-bindings/hashlib/Hash.h" -// #include "shared-bindings/util.h" - -// #include "shared/runtime/buffer_helper.h" -// #include "shared/runtime/interrupt_char.h" - -// #include "py/mperrno.h" -// #include "py/mphal.h" #include "py/obj.h" #include "py/objproperty.h" #include "py/objstr.h" diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js index 595bbe6653..6ecc2b1659 100644 --- a/supervisor/shared/web_workflow/static/serial.js +++ b/supervisor/shared/web_workflow/static/serial.js @@ -21,7 +21,6 @@ function onSubmit() { input.focus(); } -// Connect to Web Socket ws = new WebSocket("ws://" + window.location.host + "/cp/serial/"); ws.onopen = function() { @@ -32,7 +31,6 @@ var setting_title = false; var encoder = new TextEncoder(); var left_count = 0; ws.onmessage = function(e) { - // e.data contains received string. if (e.data == "\x1b]0;") { setting_title = true; title.textContent = ""; diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 3f9920d1c7..6cf765b8f9 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -522,10 +522,16 @@ static void _reply_redirect(socketpool_socket_obj_t *socket, _request *request, "HTTP/1.1 301 Moved Permanently\r\n", "Connection: close\r\n", "Content-Length: 0\r\n", - "Location: http://", hostname, ".local", path, "\r\n", NULL); + "Location: ", NULL); + if (request->websocket) { + _send_str(socket, "ws"); + } else { + _send_str(socket, "http"); + } + + _send_strs(socket, "://", hostname, ".local", path, "\r\n", NULL); _cors_header(socket, request); _send_str(socket, "\r\n"); - ESP_LOGI(TAG, "redirect"); } static void _reply_directory_json(socketpool_socket_obj_t *socket, _request *request, FF_DIR *dir, const char *request_path, const char *path) { @@ -853,10 +859,7 @@ static void _reply_static(socketpool_socket_obj_t *socket, _request *request, co #define _REPLY_STATIC(socket, request, filename) _reply_static(socket, request, filename, filename##_length, filename##_content_type) - - static void _reply_websocket_upgrade(socketpool_socket_obj_t *socket, _request *request) { - ESP_LOGI(TAG, "websocket!"); // Compute accept key hashlib_hash_obj_t hash; common_hal_hashlib_new(&hash, "sha1"); @@ -876,8 +879,6 @@ static void _reply_websocket_upgrade(socketpool_socket_obj_t *socket, _request * "Sec-WebSocket-Accept: ", encoded_accept, "\r\n", "\r\n", NULL); websocket_handoff(socket); - - ESP_LOGI(TAG, "socket upgrade done"); // socket is now closed and "disconnected". } @@ -885,7 +886,7 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { if (request->redirect) { _reply_redirect(socket, request, request->path); } else if (strlen(request->origin) > 0 && !_origin_ok(request->origin)) { - ESP_LOGI(TAG, "bad origin %s", request->origin); + ESP_LOGE(TAG, "bad origin %s", request->origin); _reply_forbidden(socket, request); } else if (memcmp(request->path, "/fs/", 4) == 0) { if (!request->authenticated) { @@ -1199,7 +1200,6 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) return; } bool reload = _reply(socket, request); - ESP_LOGI(TAG, "reply done"); _reset_request(request); autoreload_resume(AUTORELOAD_SUSPEND_WEB); if (reload) { @@ -1217,12 +1217,10 @@ void supervisor_web_workflow_background(void) { uint32_t port; int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port); if (newsoc == -EBADF) { - ESP_LOGI(TAG, "listen closed"); common_hal_socketpool_socket_close(&listening); return; } if (newsoc > 0) { - ESP_LOGI(TAG, "new socket %d", newsoc); // Close the active socket because we have another we accepted. if (!common_hal_socketpool_socket_get_closed(&active)) { common_hal_socketpool_socket_close(&active); @@ -1243,7 +1241,6 @@ void supervisor_web_workflow_background(void) { // If we have a request in progress, continue working on it. if (common_hal_socketpool_socket_get_connected(&active)) { - // ESP_LOGI(TAG, "active connected %d", active_request.in_progress); _process_request(&active, &active_request); } } From 83b62567d2f61fa747f8ba0abcdb03e606d7f5c7 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 12 Jul 2022 01:36:08 +0000 Subject: [PATCH 078/108] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (993 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b447e8e7c7..2f8c578292 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-07-03 00:22+0000\n" +"PO-Revision-Date: 2022-07-12 13:10+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.13.1-dev\n" +"X-Generator: Weblate 4.14-dev\n" #: main.c msgid "" @@ -2437,7 +2437,7 @@ msgstr "a matriz e comprimento do índice devem ser iguais" #: extmod/ulab/code/numpy/io/io.c msgid "array has too many dimensions" -msgstr "" +msgstr "a matriz possui muitas dimensões" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c @@ -2814,7 +2814,7 @@ msgstr "os argumentos convolutivos não devem estar vazios" #: extmod/ulab/code/numpy/io/io.c msgid "corrupted file" -msgstr "" +msgstr "arquivo corrompido" #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" @@ -2912,7 +2912,7 @@ msgstr "vazio" #: extmod/ulab/code/numpy/io/io.c msgid "empty file" -msgstr "" +msgstr "arquivo vazio" #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" @@ -3235,7 +3235,7 @@ msgstr "a matriz da entrada é singular" #: extmod/ulab/code/numpy/create.c msgid "input must be 1- or 2-d" -msgstr "" +msgstr "a entrada deve ser 1- ou 2-d" #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" @@ -3450,7 +3450,7 @@ msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is " -msgstr "" +msgstr "a quantidade máxima de dimensões é " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -4295,11 +4295,11 @@ msgstr "tipo sem suporte para %q: '%q', '%q'" #: extmod/ulab/code/numpy/io/io.c msgid "usecols is too high" -msgstr "" +msgstr "usecols é muito alto" #: extmod/ulab/code/numpy/io/io.c msgid "usecols keyword must be specified" -msgstr "" +msgstr "palavra-chave para o usecols deve ser definida" #: py/objint.c #, c-format @@ -4344,7 +4344,7 @@ msgstr "um eixo errado foi definido" #: extmod/ulab/code/numpy/io/io.c msgid "wrong dtype" -msgstr "" +msgstr "dtype errado" #: extmod/ulab/code/numpy/transform.c msgid "wrong index type" @@ -4362,7 +4362,7 @@ msgstr "comprimento errado na condição da matriz" #: extmod/ulab/code/numpy/transform.c msgid "wrong length of index array" -msgstr "" +msgstr "comprimento errado do índice da matriz" #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" From 636e22b05b3c59123f4bc642ded002d971d29a2b Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 11 Jul 2022 21:03:44 +0000 Subject: [PATCH 079/108] Translated using Weblate (Swedish) Currently translated at 100.0% (993 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 23f6013a74..78ebb6b6ab 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-07-01 17:46+0000\n" +"PO-Revision-Date: 2022-07-12 13:10+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.13.1-dev\n" +"X-Generator: Weblate 4.14-dev\n" #: main.c msgid "" @@ -2407,7 +2407,7 @@ msgstr "array och indexlängd måste vara lika" #: extmod/ulab/code/numpy/io/io.c msgid "array has too many dimensions" -msgstr "" +msgstr "array har för många dimensioner" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c @@ -2780,7 +2780,7 @@ msgstr "Argumenten convolve kan inte vara tomma" #: extmod/ulab/code/numpy/io/io.c msgid "corrupted file" -msgstr "" +msgstr "korrupt fil" #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" @@ -2878,7 +2878,7 @@ msgstr "tom" #: extmod/ulab/code/numpy/io/io.c msgid "empty file" -msgstr "" +msgstr "tom fil" #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" @@ -3200,7 +3200,7 @@ msgstr "indatamatrisen är singulär" #: extmod/ulab/code/numpy/create.c msgid "input must be 1- or 2-d" -msgstr "" +msgstr "input måste vara 1- eller 2-d" #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" @@ -3415,7 +3415,7 @@ msgstr "max_length måste vara 0-%d när fixed_length är %s" #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is " -msgstr "" +msgstr "maximalt antal dimensioner är " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -4254,11 +4254,11 @@ msgstr "typen %q stöder inte '%q', '%q'" #: extmod/ulab/code/numpy/io/io.c msgid "usecols is too high" -msgstr "" +msgstr "usecols är för hög" #: extmod/ulab/code/numpy/io/io.c msgid "usecols keyword must be specified" -msgstr "" +msgstr "nyckelordet usecols måste anges" #: py/objint.c #, c-format @@ -4303,7 +4303,7 @@ msgstr "fel axel angiven" #: extmod/ulab/code/numpy/io/io.c msgid "wrong dtype" -msgstr "" +msgstr "fel dtype" #: extmod/ulab/code/numpy/transform.c msgid "wrong index type" @@ -4321,7 +4321,7 @@ msgstr "fel längd på villkorsmatrisen" #: extmod/ulab/code/numpy/transform.c msgid "wrong length of index array" -msgstr "" +msgstr "fel längd av index array" #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" From 15fe3864574d0a92f8d9612f0ab1da976ffc3ee0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 Jul 2022 11:13:17 -0700 Subject: [PATCH 080/108] Fix build and minify html and js --- docs/library/hashlib.rst | 1 + requirements-dev.txt | 4 ++++ supervisor/shared/web_workflow/websocket.c | 3 +++ tools/gen_web_workflow_static.py | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/docs/library/hashlib.rst b/docs/library/hashlib.rst index 8e5ebc2d1a..061f9fd1e0 100644 --- a/docs/library/hashlib.rst +++ b/docs/library/hashlib.rst @@ -5,6 +5,7 @@ .. module:: hashlib :synopsis: hashing algorithms + :noindex: |see_cpython_module| :mod:`cpython:hashlib`. diff --git a/requirements-dev.txt b/requirements-dev.txt index 0b2e08163a..3b4411bd3a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -26,3 +26,7 @@ pyelftools # for stubs and annotations adafruit-circuitpython-typing + +# for web workflow minify +minify_html +jsmin diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 8d3941b434..313e18a86d 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -26,6 +26,9 @@ #include "supervisor/shared/web_workflow/websocket.h" +// TODO: Remove ESP specific stuff. For now, it is useful as we refine the server. +#include "esp_log.h" + typedef struct { socketpool_socket_obj_t socket; uint8_t opcode; diff --git a/tools/gen_web_workflow_static.py b/tools/gen_web_workflow_static.py index 5f0febd084..b8c5baf619 100644 --- a/tools/gen_web_workflow_static.py +++ b/tools/gen_web_workflow_static.py @@ -4,6 +4,8 @@ import argparse import gzip +import minify_html +import jsmin import mimetypes import pathlib @@ -24,6 +26,10 @@ for f in args.files: variable = path.name.replace(".", "_") uncompressed = f.read() ulen = len(uncompressed) + if f.name.endswith(".html"): + uncompressed = minify_html.minify(uncompressed.decode("utf-8")).encode("utf-8") + elif f.name.endswith(".js"): + uncompressed = jsmin.jsmin(uncompressed.decode("utf-8")).encode("utf-8") compressed = gzip.compress(uncompressed) clen = len(compressed) compressed = ", ".join([hex(x) for x in compressed]) From 8093f8e55521cccaaf273bb5f821e40f65432608 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 Jul 2022 14:12:25 -0700 Subject: [PATCH 081/108] Default gifio to camera setting --- py/circuitpy_mpconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index de88dcc727..5d6ef0ddf6 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -233,7 +233,7 @@ CIRCUITPY_GETPASS ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_GETPASS=$(CIRCUITPY_GETPASS) ifeq ($(CIRCUITPY_DISPLAYIO),1) -CIRCUITPY_GIFIO ?= $(CIRCUITPY_FULL_BUILD) +CIRCUITPY_GIFIO ?= $(CIRCUITPY_CAMERA) else CIRCUITPY_GIFIO ?= 0 endif From 031c124a81d6129f9bf8fa47cea1066788d481ba Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 Jul 2022 14:12:39 -0700 Subject: [PATCH 082/108] Tweak serial page to work better in Chrome --- supervisor/shared/web_workflow/static/serial.html | 8 ++++---- supervisor/shared/web_workflow/static/serial.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/supervisor/shared/web_workflow/static/serial.html b/supervisor/shared/web_workflow/static/serial.html index aaf416b8b3..0c13248904 100644 --- a/supervisor/shared/web_workflow/static/serial.html +++ b/supervisor/shared/web_workflow/static/serial.html @@ -1,15 +1,15 @@ - Simple client - + + -
+

-     
+    
   
diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js index 6ecc2b1659..86ec077e92 100644 --- a/supervisor/shared/web_workflow/static/serial.js +++ b/supervisor/shared/web_workflow/static/serial.js @@ -57,7 +57,7 @@ ws.onerror = function(e) { set_enabled(false); }; -input.onbeforeinput = function(e) { +input.addEventListener("beforeinput", function(e) { if (e.inputType == "insertLineBreak") { ws.send("\r"); input.value = ""; @@ -68,7 +68,7 @@ input.onbeforeinput = function(e) { } else if (e.inputType == "deleteContentBackward") { ws.send("\b"); } -} +}); let ctrl_c = document.querySelector("#c"); ctrl_c.onclick = function() { From afbaa2eb6c90990c5965913bd7070f997c83c21c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 12 Jul 2022 16:28:33 -0500 Subject: [PATCH 083/108] decode_backtrace: Show even more information addr2line can show information about how functions were inlined, including function names Typical new output: ``` 0x400dec57: mp_obj_get_type at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:68 (inlined by) mp_obj_print_helper at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:133 (inlined by) mp_obj_print_helper at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:114 0x400e1a25: fun_builtin_1_call at /home/jepler/src/circuitpython/ports/espressif/../../py/objfun.c:75 0x400dd016: mp_call_function_n_kw at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:665 0x400eac99: mp_execute_bytecode at /home/jepler/src/circuitpython/ports/espressif/../../py/vm.c:936 0x400e1ae9: fun_bc_call at /home/jepler/src/circuitpython/ports/espressif/../../py/objfun.c:297 (discriminator 4) 0x400dd016: mp_call_function_n_kw at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:665 0x400dd03a: mp_call_function_0 at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:638 0x40117c03: parse_compile_execute at /home/jepler/src/circuitpython/ports/espressif/../../shared/runtime/pyexec.c:146 0x4011800d: pyexec_friendly_repl at /home/jepler/src/circuitpython/ports/espressif/../../shared/runtime/pyexec.c:734 0x400eeded: run_repl at /home/jepler/src/circuitpython/ports/espressif/../../main.c:823 (inlined by) main at /home/jepler/src/circuitpython/ports/espressif/../../main.c:922 0x400ef5e3: app_main at /home/jepler/src/circuitpython/ports/espressif/supervisor/port.c:410 0x401bb461: main_task at /home/jepler/src/circuitpython/ports/espressif/build-adafruit_feather_esp32_v2/esp-idf/../../esp-idf/components/freertos/port/port_common.c:141 ``` --- ports/espressif/tools/decode_backtrace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/tools/decode_backtrace.py b/ports/espressif/tools/decode_backtrace.py index 523677baea..38b2c12b66 100644 --- a/ports/espressif/tools/decode_backtrace.py +++ b/ports/espressif/tools/decode_backtrace.py @@ -18,7 +18,7 @@ while True: addresses = addresses[len("Backtrace:") :] addresses = addresses.strip().split() addresses = [address.split(":")[0] for address in addresses] - print("got", addresses) subprocess.run( - ["xtensa-esp32s2-elf-addr2line", "-e", "build-{}/firmware.elf".format(board)] + addresses + ["xtensa-esp32s2-elf-addr2line", "-aipfe", "build-{}/firmware.elf".format(board)] + + addresses ) From 953f44b46e07b5efef3a63c1eea424d66608a0da Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 10:51:19 -0500 Subject: [PATCH 084/108] Fix spiram limit calculation on esp32 esp32 places the psram start at SOC_EXTRAM_DATA_LOW and it can extend up to SOC_EXTRAM_DATA_SIZE. This is different than esp32-s2 and later, which place the end at EXTRAM_DATA_HIGH and the limitation of SOC_EXTRAM_DATA_SIZE was not previously identified as important. Additionally, the esp32 has a reserved area within himem which was not being accounted for. With this change, the Feather ESP32 V2 feather can be used via thonny, and the other "quick memory corruption tests" I was performing also all succeed instead of failing. Before this change, the incorrect address being used for spiram was 0x3fa00000..0x3fc00000 (2MiB). Now, it's 0x3f800000..0x3f9c0000 (1.75MiB) due to the reserved area and the changed start address. This is intended to be a no-effect change for other espressif chips besides original esp32. --- ports/espressif/supervisor/port.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index f9d978c5b4..f2288ebcb0 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -89,6 +89,17 @@ #ifdef CONFIG_SPIRAM #include "esp32/spiram.h" +#ifdef CONFIG_IDF_TARGET_ESP32 +#include "esp32/himem.h" +#else +#define esp_himem_reserved_area_size() (0) +#endif + +static size_t spiram_size_usable_for_malloc(void) { + /* SPIRAM chip may be larger than the size we can map into address space */ + size_t s = MIN(esp_spiram_get_size(), SOC_EXTRAM_DATA_SIZE); + return s - esp_himem_reserved_area_size(); +} #endif // Heap sizes for when there is no external RAM for CircuitPython to use @@ -209,8 +220,12 @@ safe_mode_t port_init(void) { #ifdef CONFIG_SPIRAM if (esp_spiram_is_initialized()) { - size_t spiram_size = esp_spiram_get_size(); + size_t spiram_size = spiram_size_usable_for_malloc(); + #ifdef CONFIG_IDF_TARGET_ESP32 + heap = (uint32_t *)SOC_EXTRAM_DATA_LOW; + #else heap = (uint32_t *)(SOC_EXTRAM_DATA_HIGH - spiram_size); + #endif heap_size = spiram_size / sizeof(uint32_t); } #endif From ea52ca66dc7cb532066249fecb9873783034917e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 10:56:58 -0500 Subject: [PATCH 085/108] Disable SPIRAM bankswitch on esp32 We don't use this facility, which was reserving the last 256kiB of psram. --- ports/espressif/esp-idf-config/sdkconfig-esp32.defaults | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults index ed573c303e..6c244f3bbe 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults @@ -294,8 +294,7 @@ CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y # end of SPIRAM workaround libraries placement -CONFIG_SPIRAM_BANKSWITCH_ENABLE=y -CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 +CONFIG_SPIRAM_BANKSWITCH_ENABLE=n # # PSRAM clock and cs IO for ESP32-DOWD From f620c2901cdb71d09c1e5b973c1481364405565c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 11:10:00 -0500 Subject: [PATCH 086/108] Set a small but working heap size for esp32 without psram --- ports/espressif/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index f2288ebcb0..371c616f44 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -106,7 +106,7 @@ static size_t spiram_size_usable_for_malloc(void) { // exclusively. #ifdef CONFIG_IDF_TARGET_ESP32 // TODO: Determine better: 520kB of internal RAM; similar to 512kB for ESP32-S3. -#define HEAP_SIZE (176 * 1024) +#define HEAP_SIZE (48 * 1024) #endif #ifdef CONFIG_IDF_TARGET_ESP32S2 #define HEAP_SIZE (48 * 1024) From 5c6ee20ca5e7cf042b1d5507268ab78e9eb8ad4f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 11:55:04 -0500 Subject: [PATCH 087/108] on esp32 need to initialize nvs before starting wifi Also, change error handling so that the esp-idf error number is shown in the traceback in the case of an error. This allows scanning & connecting to work. I didn't try requests yet. --- ports/espressif/common-hal/wifi/__init__.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index e5d6980228..04612d745d 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "bindings/espidf/__init__.h" #include "common-hal/wifi/__init__.h" #include "shared-bindings/wifi/__init__.h" @@ -47,6 +48,10 @@ wifi_radio_obj_t common_hal_wifi_radio_obj; #include "esp_ipc.h" +#ifdef CONFIG_IDF_TARGET_ESP32 +#include "nvs_flash.h" +#endif + static const char *TAG = "CP wifi"; STATIC void schedule_background_on_cp_core(void *arg) { @@ -174,11 +179,21 @@ void common_hal_wifi_init(bool user_initiated) { &self->handler_instance_got_ip)); wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); + #ifdef CONFIG_IDF_TARGET_ESP32 + esp_err_t err = nvs_flash_init(); + if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { + // NVS partition was truncated and needs to be erased + // Retry nvs_flash_init + ESP_ERROR_CHECK(nvs_flash_erase()); + err = nvs_flash_init(); + } + ESP_ERROR_CHECK(err); + #endif esp_err_t result = esp_wifi_init(&config); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate Wifi memory")); } else if (result != ESP_OK) { - mp_raise_RuntimeError(translate("Failed to init wifi")); + raise_esp_error(result); } // set station mode to avoid the default SoftAP common_hal_wifi_radio_start_station(self); From 13be10ef1411459cd165df0d66697136a123c506 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 13:28:51 -0500 Subject: [PATCH 088/108] rename function to avoid confusion --- ports/espressif/supervisor/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 371c616f44..5990a60d7f 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -95,7 +95,7 @@ #define esp_himem_reserved_area_size() (0) #endif -static size_t spiram_size_usable_for_malloc(void) { +static size_t spiram_size_usable(void) { /* SPIRAM chip may be larger than the size we can map into address space */ size_t s = MIN(esp_spiram_get_size(), SOC_EXTRAM_DATA_SIZE); return s - esp_himem_reserved_area_size(); @@ -220,7 +220,7 @@ safe_mode_t port_init(void) { #ifdef CONFIG_SPIRAM if (esp_spiram_is_initialized()) { - size_t spiram_size = spiram_size_usable_for_malloc(); + size_t spiram_size = spiram_size_usable(); #ifdef CONFIG_IDF_TARGET_ESP32 heap = (uint32_t *)SOC_EXTRAM_DATA_LOW; #else From c1b6c367fffcff5cbc8169bda0344d2122181bac Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 13:53:08 -0500 Subject: [PATCH 089/108] esp32 can allocate 88kB successfully --- ports/espressif/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 5990a60d7f..0169f5ce16 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -106,7 +106,7 @@ static size_t spiram_size_usable(void) { // exclusively. #ifdef CONFIG_IDF_TARGET_ESP32 // TODO: Determine better: 520kB of internal RAM; similar to 512kB for ESP32-S3. -#define HEAP_SIZE (48 * 1024) +#define HEAP_SIZE (88 * 1024) #endif #ifdef CONFIG_IDF_TARGET_ESP32S2 #define HEAP_SIZE (48 * 1024) From 09d1c846c4a72c1e6a2d72657c58c2abe55984cf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 13:53:22 -0500 Subject: [PATCH 090/108] Set heap size to 0 when heap allocation fails --- ports/espressif/supervisor/port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 0169f5ce16..78c3508458 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -235,6 +235,7 @@ safe_mode_t port_init(void) { heap_size = HEAP_SIZE / sizeof(uint32_t); } if (heap == NULL) { + heap_size = 0; return NO_HEAP; } From afa8b2ea724f862fc0a23db303f7d0f937e181d7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 13:56:49 -0500 Subject: [PATCH 091/108] Don't hard fault trying to run boot.py if there's no heap --- main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index 952a17e8a8..5fcb2d61a6 100644 --- a/main.c +++ b/main.c @@ -704,6 +704,10 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re vstr_t *boot_output; STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { + if (safe_mode == NO_HEAP) { + return; + } + // If not in safe mode, run boot before initing USB and capture output in a file. // There is USB setup to do even if boot.py is not actually run. From 09b754ffa0431bca5c88b955bb2a1e7aaae0c0c5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 14:00:59 -0500 Subject: [PATCH 092/108] espressif: Set heap size automatically, like micropython rather than setting the heap size statically, micropython allocates the biggest contiguous chunk possible, but in no event more than half the total internal sram. On esp32 this gives 123728 bytes of `gc.mem_free` in the repl. --- ports/espressif/supervisor/port.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 78c3508458..8d10c1f7dc 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -102,22 +102,6 @@ static size_t spiram_size_usable(void) { } #endif -// Heap sizes for when there is no external RAM for CircuitPython to use -// exclusively. -#ifdef CONFIG_IDF_TARGET_ESP32 -// TODO: Determine better: 520kB of internal RAM; similar to 512kB for ESP32-S3. -#define HEAP_SIZE (88 * 1024) -#endif -#ifdef CONFIG_IDF_TARGET_ESP32S2 -#define HEAP_SIZE (48 * 1024) -#endif -#ifdef CONFIG_IDF_TARGET_ESP32S3 -#define HEAP_SIZE (176 * 1024) -#endif -#ifdef CONFIG_IDF_TARGET_ESP32C3 -#define HEAP_SIZE (88 * 1024) -#endif - uint32_t *heap; uint32_t heap_size; @@ -231,8 +215,10 @@ safe_mode_t port_init(void) { #endif if (heap == NULL) { - heap = malloc(HEAP_SIZE); - heap_size = HEAP_SIZE / sizeof(uint32_t); + size_t heap_total = heap_caps_get_total_size(MALLOC_CAP_8BIT); + heap_size = MIN(heap_caps_get_largest_free_block(MALLOC_CAP_8BIT), heap_total / 2); + heap = malloc(heap_size); + heap_size = heap_size / sizeof(uint32_t); } if (heap == NULL) { heap_size = 0; From 104ac5b9654c82450cd8290d4c663c3b2f4d4c85 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 Jul 2022 14:53:25 -0500 Subject: [PATCH 093/108] signal errors in ci_fetch_deps subprocesses A recent build failed. The original error seemed to be during ci_fetch_deps where a build message said ``` fatal: reference is not a tree: 346c936e14c6ea3a8d3d65cb1fa46202dc92999d fatal: Unable to checkout '346c936e14c6ea3a8d3d65cb1fa46202dc92999d' in submodule path 'extmod/ulab' ``` (along with other problems), but this step didn't signal failure to github actions. By adding the check= parameter, a failure of the subprocess will cause a CalledProcessError to be raised, which will make ci_fetch_deps exit with nonzero status. In turn, this should let Actions understand that something went wrong with this step, instead of waiting for some subsequent step(s) to go wrong. --- tools/ci_fetch_deps.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index 491d8da0e5..44295a06e9 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -47,9 +47,11 @@ def run(title, command): print("::group::" + title, flush=True) print(command, flush=True) start = time.monotonic() - subprocess.run(shlex.split(command), stderr=subprocess.STDOUT) - print("Duration:", time.monotonic() - start, flush=True) - print("::endgroup::", flush=True) + try: + subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=True) + finally: + print("Duration:", time.monotonic() - start, flush=True) + print("::endgroup::", flush=True) run( From 04004210f5676e1e3561e4d4e43ba88dc721689a Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 13 Jul 2022 23:16:06 +0200 Subject: [PATCH 094/108] 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/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/en_GB.po | 4 ++++ locale/es.po | 4 ++++ locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/ru.po | 4 ++++ locale/sv.po | 4 ++++ locale/tr.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 06ec3d9769..3b0586f5fe 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -2230,6 +2230,10 @@ msgstr "Tipe bus tampilan tidak didukung" msgid "Unsupported format" msgstr "Format tidak didukung" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index cd5167bd28..15656093d9 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -2217,6 +2217,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index faa220b622..6ed2f74d25 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2257,6 +2257,10 @@ msgstr "Nicht unterstützter display bus type" msgid "Unsupported format" msgstr "Nicht unterstütztes Format" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update fehlgeschlagen" diff --git a/locale/el.po b/locale/el.po index 540dde009c..f71d2dbb5d 100644 --- a/locale/el.po +++ b/locale/el.po @@ -2199,6 +2199,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 9243e0c73b..a0f87cca1c 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -2232,6 +2232,10 @@ msgstr "Unsupported display bus type" msgid "Unsupported format" msgstr "Unsupported format" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update failed" diff --git a/locale/es.po b/locale/es.po index 05e913ae03..862af5b014 100644 --- a/locale/es.po +++ b/locale/es.po @@ -2261,6 +2261,10 @@ msgstr "Sin capacidad de bus tipo display" msgid "Unsupported format" msgstr "Formato no soportado" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "La actualización fallo" diff --git a/locale/fil.po b/locale/fil.po index d2509b761f..447e26e9ea 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2219,6 +2219,10 @@ msgstr "Hindi supportadong tipo ng bitmap" msgid "Unsupported format" msgstr "Hindi supportadong format" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 9c892a7f11..9b84fef41e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2289,6 +2289,10 @@ msgstr "Type de bus d'affichage non supporté" msgid "Unsupported format" msgstr "Format non supporté" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Mise-à-jour échouée" diff --git a/locale/hi.po b/locale/hi.po index 1cd3603ccb..3ca50e056e 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -2199,6 +2199,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 8c8ac6e551..9f46fdc57b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -2229,6 +2229,10 @@ msgstr "tipo di bitmap non supportato" msgid "Unsupported format" msgstr "Formato non supportato" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index e45ac2ff0f..93584df996 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -2213,6 +2213,10 @@ msgstr "" msgid "Unsupported format" msgstr "非対応の形式" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index ec1f2371fc..042eccc72b 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -2203,6 +2203,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 4a1f3ab520..4eeaa5fcba 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -2225,6 +2225,10 @@ msgstr "Niet-ondersteund beeldscherm bus type" msgid "Unsupported format" msgstr "Niet-ondersteunde format" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update Mislukt" diff --git a/locale/pl.po b/locale/pl.po index fbf2283bfa..1e10bdf212 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -2210,6 +2210,10 @@ msgstr "Zły typ magistrali wyświetlaczy" msgid "Unsupported format" msgstr "Zły format" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 2f8c578292..36b89e4d95 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2271,6 +2271,10 @@ msgstr "Não há suporte para o tipo do display bus" msgid "Unsupported format" msgstr "Formato não suportado" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "A atualização falou" diff --git a/locale/ru.po b/locale/ru.po index 9625bd470c..b53fd7d02e 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -2248,6 +2248,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 78ebb6b6ab..fd0108c188 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2244,6 +2244,10 @@ msgstr "Busstyp för display stöds inte" msgid "Unsupported format" msgstr "Formatet stöds inte" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Uppdateringen misslyckades" diff --git a/locale/tr.po b/locale/tr.po index 529ecdbee9..8b7cfa5af7 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -2219,6 +2219,10 @@ msgstr "" msgid "Unsupported format" msgstr "" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 186c640e3d..64153212c3 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -2255,6 +2255,10 @@ msgstr "Bù zhīchí de gōnggòng qìchē lèixíng" msgid "Unsupported format" msgstr "Bù zhīchí de géshì" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" + #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "gēng xīn shī bài" From e9dd25412779106c018a9d4b6d00413bd4296257 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 Jul 2022 09:37:09 -0700 Subject: [PATCH 095/108] Add socket select task to wake CP This fixes the web workflow on boards without a display. Fixes #6552 --- ports/espressif/background.c | 8 - .../espressif/common-hal/socketpool/Socket.c | 217 ++++++++++++++++-- .../espressif/common-hal/socketpool/Socket.h | 1 - .../common-hal/socketpool/SocketPool.c | 56 +---- ports/espressif/supervisor/port.c | 5 + supervisor/shared/web_workflow/web_workflow.c | 43 ++-- supervisor/shared/workflow.c | 4 + 7 files changed, 234 insertions(+), 100 deletions(-) diff --git a/ports/espressif/background.c b/ports/espressif/background.c index 1bf44700be..0b5bb96a3b 100644 --- a/ports/espressif/background.c +++ b/ports/espressif/background.c @@ -40,20 +40,12 @@ #include "common-hal/pulseio/PulseIn.h" #endif -#if CIRCUITPY_WEB_WORKFLOW -#include "supervisor/shared/web_workflow/web_workflow.h" -#endif - void port_background_task(void) { // Zero delay in case FreeRTOS wants to switch to something else. vTaskDelay(0); #if CIRCUITPY_PULSEIO pulsein_background(); #endif - - #if CIRCUITPY_WEB_WORKFLOW - supervisor_web_workflow_background(); - #endif } void port_start_background_task(void) { diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index 0774204bad..45d5f1fea0 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -30,38 +30,213 @@ #include "shared/runtime/interrupt_char.h" #include "py/mperrno.h" #include "py/runtime.h" +#include "shared-bindings/socketpool/SocketPool.h" +#include "supervisor/port.h" #include "supervisor/shared/tick.h" +#include "supervisor/workflow.h" #include "components/lwip/lwip/src/include/lwip/err.h" #include "components/lwip/lwip/src/include/lwip/sockets.h" #include "components/lwip/lwip/src/include/lwip/sys.h" #include "components/lwip/lwip/src/include/lwip/netdb.h" +#include "components/vfs/include/esp_vfs_eventfd.h" -STATIC socketpool_socket_obj_t *open_socket_handles[CONFIG_LWIP_MAX_SOCKETS]; +StackType_t socket_select_stack[2 * configMINIMAL_STACK_SIZE]; + +STATIC int open_socket_fds[CONFIG_LWIP_MAX_SOCKETS]; +STATIC bool user_socket[CONFIG_LWIP_MAX_SOCKETS]; +StaticTask_t socket_select_task_handle; +STATIC int socket_change_fd = -1; + +STATIC void socket_select_task(void *arg) { + uint64_t signal; + + while (true) { + fd_set readfds; + fd_set errfds; + FD_ZERO(&readfds); + FD_ZERO(&errfds); + FD_SET(socket_change_fd, &readfds); + FD_SET(socket_change_fd, &errfds); + int max_fd = socket_change_fd; + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] < 0) { + continue; + } + max_fd = MAX(max_fd, open_socket_fds[i]); + FD_SET(open_socket_fds[i], &readfds); + FD_SET(open_socket_fds[i], &errfds); + } + + int num_triggered = select(max_fd + 1, &readfds, NULL, &errfds, NULL); + if (num_triggered < 0) { + // Maybe bad file descriptor + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + int sockfd = open_socket_fds[i]; + if (sockfd < 0) { + continue; + } + if (FD_ISSET(sockfd, &errfds)) { + int err; + int optlen = sizeof(int); + int ret = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &err, (socklen_t *)&optlen); + if (ret < 0) { + open_socket_fds[i] = -1; + // Try again. + continue; + } + } + } + } + assert(num_triggered >= 0); + + if (FD_ISSET(socket_change_fd, &readfds)) { + read(socket_change_fd, &signal, sizeof(signal)); + num_triggered -= 1; + } + if (num_triggered > 0) { + supervisor_workflow_request_background(); + + // Wake up CircuitPython. We know it is asleep because we are lower + // priority. + port_wake_main_task(); + } + + } + close(socket_change_fd); + vTaskDelete(NULL); +} void socket_user_reset(void) { - for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { - if (open_socket_handles[i]) { - if (open_socket_handles[i]->num > 0) { - // Close automatically clears socket handle - common_hal_socketpool_socket_close(open_socket_handles[i]); - } else { - open_socket_handles[i] = NULL; - } + if (socket_change_fd < 0) { + esp_vfs_eventfd_config_t config = ESP_VFS_EVENTD_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_vfs_eventfd_register(&config)); + + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + open_socket_fds[i] = -1; + user_socket[i] = false; + } + socket_change_fd = eventfd(0, 0); + // This task runs at a lower priority than CircuitPython and is used to wake CircuitPython + // up when any open sockets have data to read. It allows us to sleep otherwise. + (void)xTaskCreateStaticPinnedToCore(socket_select_task, + "socket_select", + 2 * configMINIMAL_STACK_SIZE, + NULL, + 0, // Run this at IDLE priority. We only need it when CP isn't running (at 1). + socket_select_stack, + &socket_select_task_handle, + xPortGetCoreID()); + } + + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] >= 0 && user_socket[i]) { + int num = open_socket_fds[i]; + // Close automatically clears socket handle + lwip_shutdown(num, SHUT_RDWR); + lwip_close(num); + open_socket_fds[i] = -1; + user_socket[i] = false; } } } -bool register_open_socket(socketpool_socket_obj_t *self) { - for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { - if (open_socket_handles[i] == NULL) { - open_socket_handles[i] = self; +// The writes below send an event to the socket select task so that it redoes the +// select with the new open socket set. + +STATIC bool register_open_socket(int fd) { + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] == -1) { + open_socket_fds[i] = fd; + user_socket[i] = false; + uint64_t signal = 1; + write(socket_change_fd, &signal, sizeof(signal)); return true; } } return false; } +STATIC void unregister_open_socket(int fd) { + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] == fd) { + open_socket_fds[i] = -1; + user_socket[i] = false; + write(socket_change_fd, &fd, sizeof(fd)); + return; + } + } +} + +STATIC void mark_user_socket(int fd) { + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] == fd) { + user_socket[i] = true; + return; + } + } +} + +bool socketpool_socket(socketpool_socketpool_obj_t *self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type, + socketpool_socket_obj_t *sock) { + int addr_family; + int ipproto; + if (family == SOCKETPOOL_AF_INET) { + addr_family = AF_INET; + ipproto = IPPROTO_IP; + } else { // INET6 + addr_family = AF_INET6; + ipproto = IPPROTO_IPV6; + } + + int socket_type; + if (type == SOCKETPOOL_SOCK_STREAM) { + socket_type = SOCK_STREAM; + } else if (type == SOCKETPOOL_SOCK_DGRAM) { + socket_type = SOCK_DGRAM; + } else { // SOCKETPOOL_SOCK_RAW + socket_type = SOCK_RAW; + } + sock->type = socket_type; + sock->family = addr_family; + sock->ipproto = ipproto; + sock->pool = self; + sock->timeout_ms = (uint)-1; + + // Create LWIP socket + int socknum = -1; + socknum = lwip_socket(sock->family, sock->type, sock->ipproto); + if (socknum < 0) { + return false; + } + // This shouldn't happen since we have room for the same number of sockets as LWIP. + if (!register_open_socket(socknum)) { + lwip_close(socknum); + return false; + } + sock->num = socknum; + // Sockets should be nonblocking in most cases + lwip_fcntl(socknum, F_SETFL, O_NONBLOCK); + return true; +} + +socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_t *self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type) { + if (family != SOCKETPOOL_AF_INET) { + mp_raise_NotImplementedError(translate("Only IPv4 sockets supported")); + } + + socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); + sock->base.type = &socketpool_socket_type; + + if (!socketpool_socket(self, family, type, sock)) { + mp_raise_RuntimeError(translate("Out of sockets")); + } + mark_user_socket(sock->num); + return sock; +} + int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port) { struct sockaddr_in accept_addr; socklen_t socklen = sizeof(accept_addr); @@ -92,6 +267,10 @@ int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_ if (newsoc < 0) { return -MP_EBADF; } + if (!register_open_socket(newsoc)) { + lwip_close(newsoc); + return -MP_EBADF; + } return newsoc; } @@ -100,6 +279,7 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o int newsoc = socketpool_socket_accept(self, ip, port); if (newsoc > 0) { + mark_user_socket(newsoc); // Create the socket socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); sock->base.type = &socketpool_socket_type; @@ -107,10 +287,6 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o sock->pool = self->pool; sock->connected = true; - if (!register_open_socket(sock)) { - mp_raise_OSError(MP_EBADF); - } - lwip_fcntl(newsoc, F_SETFL, O_NONBLOCK); return sock; } else { @@ -150,18 +326,13 @@ void socketpool_socket_close(socketpool_socket_obj_t *self) { if (self->num >= 0) { lwip_shutdown(self->num, SHUT_RDWR); lwip_close(self->num); + unregister_open_socket(self->num); self->num = -1; } } void common_hal_socketpool_socket_close(socketpool_socket_obj_t *self) { socketpool_socket_close(self); - // Remove socket record - for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { - if (open_socket_handles[i] == self) { - open_socket_handles[i] = NULL; - } - } } void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self, diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index 2b8ea9fcbf..b91419807c 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -46,6 +46,5 @@ typedef struct { } socketpool_socket_obj_t; void socket_user_reset(void); -bool register_open_socket(socketpool_socket_obj_t *self); #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H diff --git a/ports/espressif/common-hal/socketpool/SocketPool.c b/ports/espressif/common-hal/socketpool/SocketPool.c index f9bf62d253..1d1aafa638 100644 --- a/ports/espressif/common-hal/socketpool/SocketPool.c +++ b/ports/espressif/common-hal/socketpool/SocketPool.c @@ -40,61 +40,7 @@ void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *sel } } -bool socketpool_socket(socketpool_socketpool_obj_t *self, - socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type, - socketpool_socket_obj_t *sock) { - int addr_family; - int ipproto; - if (family == SOCKETPOOL_AF_INET) { - addr_family = AF_INET; - ipproto = IPPROTO_IP; - } else { // INET6 - addr_family = AF_INET6; - ipproto = IPPROTO_IPV6; - } - - int socket_type; - if (type == SOCKETPOOL_SOCK_STREAM) { - socket_type = SOCK_STREAM; - } else if (type == SOCKETPOOL_SOCK_DGRAM) { - socket_type = SOCK_DGRAM; - } else { // SOCKETPOOL_SOCK_RAW - socket_type = SOCK_RAW; - } - sock->type = socket_type; - sock->family = addr_family; - sock->ipproto = ipproto; - sock->pool = self; - sock->timeout_ms = (uint)-1; - - // Create LWIP socket - int socknum = -1; - socknum = lwip_socket(sock->family, sock->type, sock->ipproto); - if (socknum < 0) { - return false; - } - sock->num = socknum; - // Sockets should be nonblocking in most cases - lwip_fcntl(socknum, F_SETFL, O_NONBLOCK); - return true; -} - -socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_t *self, - socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type) { - if (family != SOCKETPOOL_AF_INET) { - mp_raise_NotImplementedError(translate("Only IPv4 sockets supported")); - } - - socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); - sock->base.type = &socketpool_socket_type; - - if (!socketpool_socket(self, family, type, sock) || - !register_open_socket(sock)) { - mp_raise_RuntimeError(translate("Out of sockets")); - } - return sock; -} - +// common_hal_socketpool_socket is in socketpool/Socket.c to centralize open socket tracking. mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, const char *host) { diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 8d10c1f7dc..adefff3f71 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -53,6 +53,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/RunMode.h" #include "shared-bindings/rtc/__init__.h" +#include "shared-bindings/socketpool/__init__.h" #include "peripherals/rmt.h" #include "peripherals/timer.h" @@ -296,6 +297,10 @@ void reset_port(void) { rtc_reset(); #endif + #if CIRCUITPY_SOCKETPOOL + socketpool_user_reset(); + #endif + #if CIRCUITPY_TOUCHIO_USE_NATIVE peripherals_touch_reset(); #endif diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 6cf765b8f9..81730c92d0 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -404,7 +404,7 @@ static const char *OK_JSON = "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nC static void _cors_header(socketpool_socket_obj_t *socket, _request *request) { _send_strs(socket, "Access-Control-Allow-Credentials: true\r\n", - "Vary: Origin\r\n", + "Vary: Origin, Accept, Upgrade\r\n", "Access-Control-Allow-Origin: ", request->origin, "\r\n", NULL); } @@ -440,10 +440,10 @@ static void _reply_access_control(socketpool_socket_obj_t *socket, _request *req "Access-Control-Allow-Methods:GET, OPTIONS", NULL); if (!_usb_active()) { _send_str(socket, ", PUT, DELETE"); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif } - #if CIRCUITPY_USB_MSC - usb_msc_unlock(); - #endif _send_str(socket, "\r\n"); _cors_header(socket, request); _send_str(socket, "\r\n"); @@ -740,14 +740,25 @@ STATIC uint64_t truncate_time(uint64_t input_time, DWORD *fattime) { return truncated_time; } +STATIC void _discard_incoming(socketpool_socket_obj_t *socket, size_t amount) { + size_t discarded = 0; + while (discarded < amount) { + uint8_t bytes[64]; + size_t read_len = MIN(sizeof(bytes), amount - discarded); + int len = socketpool_socket_recv_into(socket, bytes, read_len); + if (len < 0) { + break; + } + discarded += read_len; + } +} + static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *request, FATFS *fs, const TCHAR *path) { FIL active_file; if (_usb_active()) { + _discard_incoming(socket, request->content_length); _reply_conflict(socket, request); - #if CIRCUITPY_USB_MSC - usb_msc_unlock(); - #endif return; } if (request->timestamp_ms > 0) { @@ -765,12 +776,20 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req if (result == FR_NO_PATH) { override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + _discard_incoming(socket, request->content_length); _reply_missing(socket, request); return; } if (result != FR_OK) { ESP_LOGE(TAG, "file write error %d %s", result, path); override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + _discard_incoming(socket, request->content_length); _reply_server_error(socket, request); return; } else if (request->expect) { @@ -785,6 +804,7 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req #if CIRCUITPY_USB_MSC usb_msc_unlock(); #endif + _discard_incoming(socket, request->content_length); // Too large. if (request->expect) { _reply_expectation_failed(socket, request); @@ -915,9 +935,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (strcmp(request->method, "DELETE") == 0) { if (_usb_active()) { _reply_conflict(socket, request); - #if CIRCUITPY_USB_MSC - usb_msc_unlock(); - #endif return false; } @@ -932,6 +949,9 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } } + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif if (result == FR_NO_PATH || result == FR_NO_FILE) { _reply_missing(socket, request); } else if (result != FR_OK) { @@ -965,9 +985,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (strcmp(request->method, "PUT") == 0) { if (_usb_active()) { _reply_conflict(socket, request); - #if CIRCUITPY_USB_MSC - usb_msc_unlock(); - #endif return false; } diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index a7bddca84d..23532181c6 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -66,6 +66,10 @@ static void workflow_background(void *data) { #if CIRCUITPY_STATUS_BAR supervisor_workflow_update_status_bar(); #endif + + #if CIRCUITPY_WEB_WORKFLOW + supervisor_web_workflow_background(); + #endif } // Called during a VM reset. Doesn't actually reset things. From 3111d2dba98bced2a8c1f07115514d0d1b2aed3b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 14 Jul 2022 02:36:55 +0200 Subject: [PATCH 096/108] 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/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/en_GB.po | 4 ++++ locale/es.po | 4 ++++ locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/ru.po | 4 ++++ locale/sv.po | 4 ++++ locale/tr.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 3b0586f5fe..c3482857bc 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3787,6 +3787,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/cs.po b/locale/cs.po index 15656093d9..008d3e6203 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3773,6 +3773,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 6ed2f74d25..94769061c0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -3850,6 +3850,10 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow() mit 3 Argumenten erfordert Integer" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/el.po b/locale/el.po index f71d2dbb5d..c1054162a9 100644 --- a/locale/el.po +++ b/locale/el.po @@ -3755,6 +3755,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/en_GB.po b/locale/en_GB.po index a0f87cca1c..c474977fcc 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -3792,6 +3792,10 @@ msgstr "pow() 3rd argument cannot be 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() with 3 arguments requires integers" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/es.po b/locale/es.po index 862af5b014..e291b95406 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3836,6 +3836,10 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/fil.po b/locale/fil.po index 447e26e9ea..f612547e04 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -3794,6 +3794,10 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/fr.po b/locale/fr.po index 9b84fef41e..926aa94e6e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3881,6 +3881,10 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/hi.po b/locale/hi.po index 3ca50e056e..8037a1fc2b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -3755,6 +3755,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 9f46fdc57b..28c9c90ff6 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -3807,6 +3807,10 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/ja.po b/locale/ja.po index 93584df996..b19bd4d049 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -3776,6 +3776,10 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/ko.po b/locale/ko.po index 042eccc72b..74fb1a09b7 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -3759,6 +3759,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/nl.po b/locale/nl.po index 4eeaa5fcba..61a6a09dfe 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -3792,6 +3792,10 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/pl.po b/locale/pl.po index 1e10bdf212..ed311e97c4 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -3768,6 +3768,10 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 36b89e4d95..7e6fce911f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3858,6 +3858,10 @@ msgstr "O terceiro argumento pow() não pode ser 0" msgid "pow() with 3 arguments requires integers" msgstr "o pow() com 3 argumentos requer números inteiros" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/ru.po b/locale/ru.po index b53fd7d02e..1206fdbc20 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -3804,6 +3804,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/sv.po b/locale/sv.po index fd0108c188..8e0c363fc6 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3817,6 +3817,10 @@ msgstr "pow() 3: e argument kan inte vara 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() med 3 argument kräver heltal" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/tr.po b/locale/tr.po index 8b7cfa5af7..09c8cc9e18 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -3775,6 +3775,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 64153212c3..8f6a570e2d 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3826,6 +3826,10 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: supervisor/shared/safe_mode.c From 626296b6136f1a169522138bae00a1bf7b8b8f1e Mon Sep 17 00:00:00 2001 From: Neradoc Date: Thu, 14 Jul 2022 11:24:20 +0200 Subject: [PATCH 097/108] implement root_group in framebufferio.FramebufferDisplay --- shared-bindings/framebufferio/FramebufferDisplay.c | 14 ++++++++++++++ shared-bindings/framebufferio/FramebufferDisplay.h | 1 + shared-module/framebufferio/FramebufferDisplay.c | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 6af8f16ce8..c3eaced598 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -353,6 +353,19 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, con } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_fill_row_obj, 1, framebufferio_framebufferdisplay_obj_fill_row); +//| root_group: Group +//| """The root group on the display.""" +//| +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_root_group(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return common_hal_framebufferio_framebufferdisplay_get_root_group(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_root_group_obj, framebufferio_framebufferdisplay_obj_get_root_group); + +MP_PROPERTY_GETTER(framebufferio_framebufferdisplay_root_group_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_root_group_obj); + STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&framebufferio_framebufferdisplay_show_obj) }, { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&framebufferio_framebufferdisplay_refresh_obj) }, @@ -367,6 +380,7 @@ STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_tabl { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&framebufferio_framebufferdisplay_height_obj) }, { MP_ROM_QSTR(MP_QSTR_rotation), MP_ROM_PTR(&framebufferio_framebufferdisplay_rotation_obj) }, { MP_ROM_QSTR(MP_QSTR_framebuffer), MP_ROM_PTR(&framebufferio_framebufferframebuffer_obj) }, + { MP_ROM_QSTR(MP_QSTR_root_group), MP_ROM_PTR(&framebufferio_framebufferdisplay_root_group_obj) }, }; STATIC MP_DEFINE_CONST_DICT(framebufferio_framebufferdisplay_locals_dict, framebufferio_framebufferdisplay_locals_dict_table); diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index f96b47eb55..8b262cf727 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -63,5 +63,6 @@ bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_fr mp_obj_t common_hal_framebufferio_framebufferdisplay_framebuffer(framebufferio_framebufferdisplay_obj_t *self); +mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_FRAMEBUFFERDISPLAY_H diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index d184d3b8c2..6f9d9ec6ad 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -372,3 +372,7 @@ void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj release_framebufferdisplay(self); } } + +mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self) { + return self->core.current_group; +} From 50a9beda041e524cf65696e9fe77215cc317ef84 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 2 Jul 2022 21:47:14 +0200 Subject: [PATCH 098/108] Retrieve the BLE name from dotenv if available Format: CIRCUITPY_BLE_NAME = My BLE Board - the length is limited to 31 characters - for the NRF version it repeatedly truncates the name if it's too long - the ESP version defaults to "nimble" if the name is too long --- devices/ble_hci/common-hal/_bleio/Adapter.c | 30 +++++++++---- ports/espressif/common-hal/_bleio/Adapter.c | 17 ++++++++ ports/nrf/common-hal/_bleio/Adapter.c | 48 ++++++++++++++++----- 3 files changed, 76 insertions(+), 19 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 839519dc33..8c7b8f67eb 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -49,6 +49,10 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) #define SEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000000) / (RESOLUTION)) #define UNITS_TO_SEC(TIME, RESOLUTION) (((TIME)*(RESOLUTION)) / 1000000) @@ -278,17 +282,27 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 // Get various values and limits set by the adapter. // Set event mask. STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) { + mp_int_t name_len = 0; - const size_t len = sizeof(default_ble_name); + #if CIRCUITPY_DOTENV + char ble_name[32]; + name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); + if (name_len > 0) { + self->name = mp_obj_new_str(ble_name, (size_t)name_len); + } + #endif - bt_addr_t addr; - hci_check_error(hci_read_bd_addr(&addr)); + if (name_len <= 0) { + name_len = sizeof(default_ble_name); + bt_addr_t addr; + hci_check_error(hci_read_bd_addr(&addr)); - default_ble_name[len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf]; - default_ble_name[len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf]; - default_ble_name[len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf]; - default_ble_name[len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf]; - self->name = mp_obj_new_str(default_ble_name, len); + default_ble_name[name_len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf]; + default_ble_name[name_len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf]; + default_ble_name[name_len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf]; + default_ble_name[name_len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf]; + self->name = mp_obj_new_str(default_ble_name, (uint8_t)name_len); + } // Get version information. if (hci_read_local_version(&self->hci_version, &self->hci_revision, &self->lmp_version, diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 943e44e7cd..0515cc4ee4 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -59,6 +59,10 @@ #include "esp_bt.h" #include "esp_nimble_hci.h" +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; // static void bluetooth_adapter_background(void *data) { @@ -96,7 +100,20 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable // ble_hs_cfg.reset_cb = blecent_on_reset; ble_hs_cfg.sync_cb = _on_sync; // ble_hs_cfg.store_status_cb = ble_store_util_status_rr; + + #if CIRCUITPY_DOTENV + mp_int_t name_len = 0; + char ble_name[32]; + name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); + if (name_len > 0) { + ble_name[name_len] = '\0'; + ble_svc_gap_device_name_set(ble_name); + } else { + ble_svc_gap_device_name_set("CIRCUITPY"); + } + #else ble_svc_gap_device_name_set("CIRCUITPY"); + #endif // Clear all of the internal connection objects. for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 288cf2f217..98dda3c1c4 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -52,6 +52,10 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_SLAVE_LATENCY 0 @@ -329,18 +333,30 @@ STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0, 0}; STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { - uint8_t len = sizeof(default_ble_name) - 1; - - ble_gap_addr_t local_address; - get_address(self, &local_address); - - default_ble_name[len - 4] = nibble_to_hex_lower[local_address.addr[1] >> 4 & 0xf]; - default_ble_name[len - 3] = nibble_to_hex_lower[local_address.addr[1] & 0xf]; - default_ble_name[len - 2] = nibble_to_hex_lower[local_address.addr[0] >> 4 & 0xf]; - default_ble_name[len - 1] = nibble_to_hex_lower[local_address.addr[0] & 0xf]; + // setup the default name + ble_gap_addr_t addr; // local_address + get_address(self, &addr); + mp_int_t len = sizeof(default_ble_name) - 1; + default_ble_name[len - 4] = nibble_to_hex_lower[addr.addr[1] >> 4 & 0xf]; + default_ble_name[len - 3] = nibble_to_hex_lower[addr.addr[1] & 0xf]; + default_ble_name[len - 2] = nibble_to_hex_lower[addr.addr[0] >> 4 & 0xf]; + default_ble_name[len - 1] = nibble_to_hex_lower[addr.addr[0] & 0xf]; default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings - common_hal_bleio_adapter_set_name(self, (char *)default_ble_name); + mp_int_t name_len = 0; + + #if CIRCUITPY_DOTENV + char ble_name[32]; + name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); + if (name_len > 0) { + ble_name[name_len] = '\0'; + common_hal_bleio_adapter_set_name(self, (char *)ble_name); + } + #endif + + if (name_len <= 0) { + common_hal_bleio_adapter_set_name(self, (char *)default_ble_name); + } } static void bluetooth_adapter_background(void *data) { @@ -448,7 +464,17 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char *na ble_gap_conn_sec_mode_t sec; sec.lv = 0; sec.sm = 0; - sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, strlen(name)); + int result; + result = sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, strlen(name)); + for (int name_len = strlen(name); name_len > 0; --name_len) { + result = sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, name_len); + // expecting NRF_ERROR_DATA_SIZE when name too long + if (result == NRF_SUCCESS) { + return; + } + } + // default back to default if all fails + sd_ble_gap_device_name_set(&sec, (const uint8_t *)default_ble_name, sizeof(default_ble_name) - 1); } STATIC uint32_t _update_identities(bool is_central) { From 5ca6d8953d68edbf637e9d554c51545c8087a8f3 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 2 Jul 2022 22:34:42 +0200 Subject: [PATCH 099/108] use available constants instead of testing errors for length --- ports/espressif/common-hal/_bleio/Adapter.c | 3 +++ ports/nrf/common-hal/_bleio/Adapter.c | 14 ++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 0515cc4ee4..5eaf6e9cf4 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -106,6 +106,9 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable char ble_name[32]; name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); if (name_len > 0) { + if (name_len > MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH) { + name_len = MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH; + } ble_name[name_len] = '\0'; ble_svc_gap_device_name_set(ble_name); } else { diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 98dda3c1c4..5cebf2fa0f 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -464,17 +464,11 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char *na ble_gap_conn_sec_mode_t sec; sec.lv = 0; sec.sm = 0; - int result; - result = sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, strlen(name)); - for (int name_len = strlen(name); name_len > 0; --name_len) { - result = sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, name_len); - // expecting NRF_ERROR_DATA_SIZE when name too long - if (result == NRF_SUCCESS) { - return; - } + uint16_t len = strlen(name); + if (len > BLE_GAP_DEVNAME_MAX_LEN) { + len = BLE_GAP_DEVNAME_MAX_LEN; } - // default back to default if all fails - sd_ble_gap_device_name_set(&sec, (const uint8_t *)default_ble_name, sizeof(default_ble_name) - 1); + sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, len); } STATIC uint32_t _update_identities(bool is_central) { From 17d65fe8f331a48c3ba996bb031ef4db1af335f7 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Thu, 14 Jul 2022 13:31:41 +0200 Subject: [PATCH 100/108] fix the docs --- shared-bindings/framebufferio/FramebufferDisplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index c3eaced598..e999ac9bc1 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -353,7 +353,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, con } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_fill_row_obj, 1, framebufferio_framebufferdisplay_obj_fill_row); -//| root_group: Group +//| root_group: displayio.Group //| """The root group on the display.""" //| //| From 49a5e83a611b12bbca1f466adefea7f1f4041896 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 14 Jul 2022 15:53:52 +0000 Subject: [PATCH 101/108] Translated using Weblate (Swedish) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 8e0c363fc6..af46f6e8bb 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-07-12 13:10+0000\n" +"PO-Revision-Date: 2022-07-14 18:05+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -2246,7 +2246,7 @@ msgstr "Formatet stöds inte" #: shared-bindings/hashlib/__init__.c msgid "Unsupported hash algorithm" -msgstr "" +msgstr "Hash-algoritmen stöds inte" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -3819,7 +3819,7 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "pressing SW38 button at start up.\n" -msgstr "" +msgstr "genom att trycka på SW38-knappen vid start.\n" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h From 44a91c12be610a16d272213099500fa616b3dda8 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Thu, 14 Jul 2022 20:31:53 +0200 Subject: [PATCH 102/108] add docs for dotenv BLE --- docs/environment.rst | 10 +++++++++- docs/workflows.md | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/environment.rst b/docs/environment.rst index 2e5d81fca8..4d12009848 100644 --- a/docs/environment.rst +++ b/docs/environment.rst @@ -31,9 +31,17 @@ CircuitPython behavior CircuitPython will also read the environment to configure its behavior. Other keys are ignored by CircuitPython. Here are the keys it uses: +CIRCUITPY_BLE_NAME +~~~~~~~~~~~~~~~~~~ +Default BLE name the board advertises as, including for the BLE workflow. + +CIRCUITPY_WEB_API_PASSWORD +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Password required to make modifications to the board from the Web Workflow. + CIRCUITPY_WIFI_PASSWORD ~~~~~~~~~~~~~~~~~~~~~~~ -Wi-Fi password used to auto connect to CIRCUITPY_WIFI_SSID +Wi-Fi password used to auto connect to CIRCUITPY_WIFI_SSID. CIRCUITPY_WIFI_SSID ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/workflows.md b/docs/workflows.md index b011acd01c..2196d1111a 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -45,6 +45,10 @@ using a rotating key rather than a static one. Non-bonded devices won't be able connection, the central device can discover two default services. One for file transfer and one for CircuitPython specifically that includes serial characteristics. +To change the default BLE advertising name without (or before) running user code, the desired name +can be put in the `/.env` file. The key is `CIRCUITPY_BLE_NAME`. It's limited to approximately +30 characters depending on the port's settings and will be truncated if longer. + ### File Transfer API CircuitPython uses [an open File Transfer API](https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer) From 72f5537027c79b2fd8246dba3e6ee9fafc722911 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 Jul 2022 14:57:12 -0500 Subject: [PATCH 103/108] esp32: don't fully reset the wifi device .. this makes reconnecting without a full reset not work. Because this works on other generations of the esp32 (c2, c3, etc), apply this behavior only to esp32. After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting. --- ports/espressif/common-hal/wifi/__init__.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index 04612d745d..d823912d6d 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -214,6 +214,7 @@ void wifi_reset(void) { common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton)); wifi_radio_obj_t *radio = &common_hal_wifi_radio_obj; common_hal_wifi_radio_set_enabled(radio, false); + #ifndef CONFIG_IDF_TARGET_ESP32 ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, radio->handler_instance_all_wifi)); @@ -226,6 +227,7 @@ void wifi_reset(void) { esp_netif_destroy(radio->ap_netif); radio->ap_netif = NULL; wifi_inited = false; + #endif supervisor_workflow_request_background(); } From dcc27a8c88665172da2571f8bc93dff75c0bf580 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 Jul 2022 15:09:26 -0500 Subject: [PATCH 104/108] Need to ensure wifi radio is set enabled again on esp32 .. otherwise, nothing set it enabled on the second soft reboot. --- ports/espressif/common-hal/wifi/__init__.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index d823912d6d..885cc98f96 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -141,7 +141,12 @@ static bool wifi_ever_inited; static bool wifi_user_initiated; void common_hal_wifi_init(bool user_initiated) { + wifi_radio_obj_t *self = &common_hal_wifi_radio_obj; + if (wifi_inited) { + if (user_initiated && !wifi_user_initiated) { + common_hal_wifi_radio_set_enabled(self, true); + } return; } wifi_inited = true; @@ -154,7 +159,6 @@ void common_hal_wifi_init(bool user_initiated) { } wifi_ever_inited = true; - wifi_radio_obj_t *self = &common_hal_wifi_radio_obj; self->netif = esp_netif_create_default_wifi_sta(); self->ap_netif = esp_netif_create_default_wifi_ap(); self->started = false; @@ -204,6 +208,7 @@ void common_hal_wifi_init(bool user_initiated) { void wifi_user_reset(void) { if (wifi_user_initiated) { wifi_reset(); + wifi_user_initiated = false; } } From 8cdbeb62f6ded5f83ad73de4f66ab446b2fff583 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 Jul 2022 15:16:28 -0500 Subject: [PATCH 105/108] Pass check=False for an expected-fail command --- tools/ci_fetch_deps.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index 44295a06e9..55985ffe15 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -43,12 +43,12 @@ port_deps = { } -def run(title, command): +def run(title, command, check=True): print("::group::" + title, flush=True) print(command, flush=True) start = time.monotonic() try: - subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=True) + subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=check) finally: print("Duration:", time.monotonic() - start, flush=True) print("::endgroup::", flush=True) @@ -108,7 +108,11 @@ if submodules: submodules = " ".join(submodules) # This line will fail because the submodule's need different commits than the tip of the branch. We # fix it later. - run("Init the submodules we'll need", f"git submodule update --init -N --depth 1 {submodules}") + run( + "Init the submodules we'll need", + f"git submodule update --init -N --depth 1 {submodules}", + check=False, + ) run( "Fetch the submodule sha", From 6e7fdcc24b2aec8397528577d74a04bf36226ded Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 15 Jul 2022 13:48:19 -0700 Subject: [PATCH 106/108] Add wait for MDNS hostname to be set --- ports/espressif/common-hal/mdns/Server.c | 4 ++++ ports/espressif/esp-idf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/mdns/Server.c b/ports/espressif/common-hal/mdns/Server.c index 3c0070ae6f..c6c2a748a9 100644 --- a/ports/espressif/common-hal/mdns/Server.c +++ b/ports/espressif/common-hal/mdns/Server.c @@ -90,6 +90,10 @@ const char *common_hal_mdns_server_get_hostname(mdns_server_obj_t *self) { void common_hal_mdns_server_set_hostname(mdns_server_obj_t *self, const char *hostname) { mdns_hostname_set(hostname); + // Wait for the mdns task to set the new hostname. + while (!mdns_hostname_exists(hostname)) { + RUN_BACKGROUND_TASKS; + } self->hostname = hostname; } diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 171e5af9c5..0180c0cb80 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 171e5af9c5b9b126c5f81f217c7b1ff931d54863 +Subproject commit 0180c0cb80f052919badc15df164e8edde6344ad From c2a8ef752c4d3401ce688445c4915a2fdea49659 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 15 Jul 2022 14:01:50 -0700 Subject: [PATCH 107/108] Remove ps2io to make space --- .../adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk | 2 ++ .../boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk index e1e9be782c..39804bad26 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -15,3 +15,5 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = qio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_PS2IO = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk index 81b6eb1edc..db7ccf9337 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -16,3 +16,5 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_PS2IO = 0 From d39236b114732610c669ffd0ba90724e3066d681 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 14 Jul 2022 20:24:09 +0000 Subject: [PATCH 108/108] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7e6fce911f..5acd4e4e0f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-07-12 13:10+0000\n" +"PO-Revision-Date: 2022-07-15 21:21+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -2273,7 +2273,7 @@ msgstr "Formato não suportado" #: shared-bindings/hashlib/__init__.c msgid "Unsupported hash algorithm" -msgstr "" +msgstr "Sem compatibilidade com o algoritmo de hash" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -3860,7 +3860,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "pressing SW38 button at start up.\n" -msgstr "" +msgstr "pressionando o botão SW38 na inicialização.\n" #: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h #: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h