diff --git a/ports/esp32/boards/BPI_LEAF_S2/board.json b/ports/esp32/boards/BPI_LEAF_S2/board.json new file mode 100644 index 0000000000000..8b33157c2f92a --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S2/board.json @@ -0,0 +1,21 @@ +{ + "deploy": [ + "deploy.md" + ], + "docs": "", + "features": [ + "Battery Charging", + "RGB LED", + "USB-C", + "SPIRAM", + "WiFi" + ], + "images": [ + "bpi_leaf_s2.jpg" + ], + "mcu": "esp32s2", + "product": "BPI-Leaf-S2", + "thumbnail": "", + "url": "https://banana-pi.org/", + "vendor": "Banana Pi" +} diff --git a/ports/esp32/boards/BPI_LEAF_S2/deploy.md b/ports/esp32/boards/BPI_LEAF_S2/deploy.md new file mode 100644 index 0000000000000..d2c5d826e35ba --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S2/deploy.md @@ -0,0 +1,24 @@ +The board needs to be put into bootloader mode before upgrading. + +To do it: Hold down **BOOT** and then press **RST** once, finally release **BOOT**. + +Program your board using the esptool.py program, found [here](https://github.com/espressif/esptool). + +If you are putting MicroPython on your board for the first time then you should +first erase the entire flash using: + +```bash +python -m esptool --chip esp32s2 --port /dev/ttyACM0 erase_flash +``` + +From then on program the firmware starting at address `0x1000`: + +```bash +python -m esptool --chip esp32s2 --port /dev/ttyACM0 write_flash -z 0x1000 firmware.bin +``` + +`/dev/ttyACM0` is the port format of Linux, in MacOS it might be `/dev/cu.usbmodem01`, in Windows it might be `COM1`, need to confirm the port number of the board. + +`firmware.bin` should be the filename of the firmware you want to use. + +When the program is finished, press RST. diff --git a/ports/esp32/boards/BPI_LEAF_S2/mpconfigboard.cmake b/ports/esp32/boards/BPI_LEAF_S2/mpconfigboard.cmake new file mode 100644 index 0000000000000..9d97aa49b1bac --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S2/mpconfigboard.cmake @@ -0,0 +1,8 @@ +set(IDF_TARGET esp32s2) + +set(SDKCONFIG_DEFAULTS + boards/sdkconfig.base + boards/sdkconfig.spiram_sx + boards/sdkconfig.usb + boards/BPI_LEAF_S2/sdkconfig.board +) diff --git a/ports/esp32/boards/BPI_LEAF_S2/mpconfigboard.h b/ports/esp32/boards/BPI_LEAF_S2/mpconfigboard.h new file mode 100644 index 0000000000000..0526ca33bb199 --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S2/mpconfigboard.h @@ -0,0 +1,12 @@ +#define MICROPY_HW_BOARD_NAME "BPI-Leaf-S2" +#define MICROPY_HW_MCU_NAME "ESP32-S2" + +#define MICROPY_PY_BLUETOOTH (0) +#define MICROPY_HW_ENABLE_SDCARD (0) + +#define MICROPY_HW_I2C0_SCL (9) +#define MICROPY_HW_I2C0_SDA (8) + +#define MICROPY_HW_SPI1_MOSI (35) +#define MICROPY_HW_SPI1_MISO (36) +#define MICROPY_HW_SPI1_SCK (37) diff --git a/ports/esp32/boards/BPI_LEAF_S2/sdkconfig.board b/ports/esp32/boards/BPI_LEAF_S2/sdkconfig.board new file mode 100644 index 0000000000000..f1f5d86761e1e --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S2/sdkconfig.board @@ -0,0 +1,19 @@ +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y + +CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +CONFIG_ESPTOOLPY_AFTER_NORESET=y + +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_USB_AND_UART=y + +CONFIG_LWIP_LOCAL_HOSTNAME="BPI-Leaf-S2" + +# CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID is not set +CONFIG_TINYUSB_DESC_CUSTOM_VID=0x303A +# CONFIG_TINYUSB_DESC_USE_DEFAULT_PID is not set +CONFIG_TINYUSB_DESC_CUSTOM_PID=0x80E3 +CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100 +CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Banana Pi" +CONFIG_TINYUSB_DESC_PRODUCT_STRING="BPI-Leaf-S2 Device" diff --git a/ports/esp32/boards/BPI_LEAF_S3/board.json b/ports/esp32/boards/BPI_LEAF_S3/board.json new file mode 100644 index 0000000000000..1c7c7c1e3cecc --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S3/board.json @@ -0,0 +1,23 @@ +{ + "deploy": [ + "deploy.md" + ], + "docs": "", + "features": [ + "Battery Charging", + "RGB LED", + "SPIRAM", + "USB-C", + "BLE", + "WiFi", + "STEMMA QT/QWIIC" + ], + "images": [ + "bpi_leaf_s3.jpg" + ], + "mcu": "esp32s3", + "product": "BPI-Leaf-S3", + "thumbnail": "", + "url": "https://wiki.banana-pi.org/BPI-Leaf-S3", + "vendor": "Banana Pi" +} diff --git a/ports/esp32/boards/BPI_LEAF_S3/deploy.md b/ports/esp32/boards/BPI_LEAF_S3/deploy.md new file mode 100644 index 0000000000000..664c162f047a4 --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S3/deploy.md @@ -0,0 +1,24 @@ +The board needs to be put into bootloader mode before upgrading. + +To do it: Hold down **BOOT** and then press **RST** once, finally release **BOOT**. + +Program your board using the esptool.py program, found [here](https://github.com/espressif/esptool). + +If you are putting MicroPython on your board for the first time then you should +first erase the entire flash using: + +```bash +python -m esptool --chip esp32s3 --port /dev/ttyACM0 erase_flash +``` + +From then on program the firmware starting at address `0x0`: + +```bash +python -m esptool --chip esp32s3 --port /dev/ttyACM0 write_flash -z 0x0 firmware.bin +``` + +`/dev/ttyACM0` is the port format of Linux, in MacOS it might be `/dev/cu.usbmodem01`, in Windows it might be `COM1`, need to confirm the port number of the board. + +`firmware.bin` should be the filename of the firmware you want to use. + +When the program is finished, press RST. diff --git a/ports/esp32/boards/BPI_LEAF_S3/mpconfigboard.cmake b/ports/esp32/boards/BPI_LEAF_S3/mpconfigboard.cmake new file mode 100644 index 0000000000000..607d148f026a4 --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S3/mpconfigboard.cmake @@ -0,0 +1,9 @@ +set(IDF_TARGET esp32s3) + +set(SDKCONFIG_DEFAULTS + boards/sdkconfig.base + boards/sdkconfig.usb + boards/sdkconfig.ble + boards/sdkconfig.spiram_sx + boards/BPI_LEAF_S3/sdkconfig.board +) diff --git a/ports/esp32/boards/BPI_LEAF_S3/mpconfigboard.h b/ports/esp32/boards/BPI_LEAF_S3/mpconfigboard.h new file mode 100644 index 0000000000000..848695c3a1175 --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S3/mpconfigboard.h @@ -0,0 +1,11 @@ +#define MICROPY_HW_BOARD_NAME "BPI-Leaf-S3" +#define MICROPY_HW_MCU_NAME "ESP32-S3" + +#define MICROPY_PY_MACHINE_DAC (0) + +#define MICROPY_HW_I2C0_SCL (16) +#define MICROPY_HW_I2C0_SDA (15) + +#define MICROPY_HW_SPI1_MOSI (35) +#define MICROPY_HW_SPI1_MISO (37) +#define MICROPY_HW_SPI1_SCK (36) diff --git a/ports/esp32/boards/BPI_LEAF_S3/sdkconfig.board b/ports/esp32/boards/BPI_LEAF_S3/sdkconfig.board new file mode 100644 index 0000000000000..17f4602b946f2 --- /dev/null +++ b/ports/esp32/boards/BPI_LEAF_S3/sdkconfig.board @@ -0,0 +1,24 @@ +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y + +CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +CONFIG_ESPTOOLPY_AFTER_NORESET=y + +CONFIG_SPIRAM_MEMTEST= + +CONFIG_ESPTOOLPY_FLASHSIZE_4MB= +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_16MB= +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv" + +CONFIG_LWIP_LOCAL_HOSTNAME="BPI-Leaf-S3" + +# CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID is not set +CONFIG_TINYUSB_DESC_CUSTOM_VID=0x303A +# CONFIG_TINYUSB_DESC_USE_DEFAULT_PID is not set +CONFIG_TINYUSB_DESC_CUSTOM_PID=0x80E0 +CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100 +CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Banana Pi" +CONFIG_TINYUSB_DESC_PRODUCT_STRING="BPI-Leaf-S3 Device"