Browse Source
adds initial support to Espressif's ESP-WROVER-KIT Development board. Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>pull/41282/head
8 changed files with 265 additions and 0 deletions
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
if(CONFIG_BOOTLOADER_ESP_IDF) |
||||
include(ExternalProject) |
||||
|
||||
## we use hello-world project, but I think any can be used. |
||||
set(espidf_components_dir ${ESP_IDF_PATH}/components) |
||||
set(espidf_prefix ${CMAKE_BINARY_DIR}/esp-idf) |
||||
set(espidf_build_dir ${espidf_prefix}/build) |
||||
|
||||
ExternalProject_Add( |
||||
EspIdfBootloader |
||||
PREFIX ${espidf_prefix} |
||||
SOURCE_DIR ${espidf_components_dir}/bootloader/subproject |
||||
BINARY_DIR ${espidf_build_dir}/bootloader |
||||
CONFIGURE_COMMAND |
||||
${CMAKE_COMMAND} -G${CMAKE_GENERATOR} |
||||
-S ${espidf_components_dir}/bootloader/subproject |
||||
-B ${espidf_build_dir}/bootloader -DSDKCONFIG=${espidf_build_dir}/sdkconfig |
||||
-DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_BOARD} |
||||
-DPYTHON_DEPS_CHECKED=1 |
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} |
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} |
||||
-DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER} |
||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} |
||||
-DPYTHON=${PYTHON_EXECUTABLE} |
||||
BUILD_COMMAND |
||||
${CMAKE_COMMAND} --build . |
||||
INSTALL_COMMAND "" # This particular build system has no install command |
||||
) |
||||
|
||||
ExternalProject_Add( |
||||
EspPartitionTable |
||||
SOURCE_DIR ${espidf_components_dir}/partition_table |
||||
BINARY_DIR ${espidf_build_dir} |
||||
CONFIGURE_COMMAND "" |
||||
BUILD_COMMAND |
||||
${PYTHON_EXECUTABLE} ${ESP_IDF_PATH}/components/partition_table/gen_esp32part.py -q |
||||
--offset 0x8000 --flash-size 4MB ${ESP_IDF_PATH}/components/partition_table/partitions_singleapp.csv ${espidf_build_dir}/partitions_singleapp.bin |
||||
INSTALL_COMMAND "" |
||||
) |
||||
|
||||
if(CONFIG_BUILD_OUTPUT_BIN) |
||||
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands |
||||
COMMAND ${PYTHON_EXECUTABLE} ${ESP_IDF_PATH}/components/esptool_py/esptool/esptool.py |
||||
ARGS --chip esp32 elf2image --flash_mode dio --flash_freq 40m |
||||
-o ${CMAKE_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.bin |
||||
${CMAKE_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.elf) |
||||
endif() |
||||
|
||||
set_property(TARGET bintools PROPERTY disassembly_flag_inline_source) |
||||
|
||||
add_dependencies(app EspIdfBootloader EspPartitionTable) |
||||
|
||||
board_finalize_runner_args(esp32 "--esp-flash-bootloader=${espidf_build_dir}/bootloader/bootloader.bin") |
||||
|
||||
board_finalize_runner_args(esp32 "--esp-flash-partition_table=${espidf_build_dir}/partitions_singleapp.bin") |
||||
|
||||
board_finalize_runner_args(esp32 "--esp-boot-address=0x1000") |
||||
|
||||
board_finalize_runner_args(esp32 "--esp-partition-table-address=0x8000") |
||||
|
||||
board_finalize_runner_args(esp32 "--esp-app-address=0x10000") |
||||
|
||||
endif() |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
# ESP-WROVER-KIT board configuration |
||||
|
||||
# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
config BOARD_ESP_WROVER_KIT |
||||
bool "ESP-WROVER-KIT Development Board" |
||||
depends on SOC_ESP32 |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
# ESP-WROVER-KIT board configuration |
||||
|
||||
# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
config BOARD |
||||
default "esp32" |
||||
depends on BOARD_ESP_WROVER_KIT |
||||
|
||||
config ENTROPY_ESP32_RNG |
||||
default y if ENTROPY_GENERATOR |
||||
|
||||
if BT |
||||
|
||||
config HEAP_MEM_POOL_SIZE |
||||
default 16384 |
||||
|
||||
config ENTROPY_GENERATOR |
||||
default y |
||||
|
||||
choice BT_HCI_BUS_TYPE |
||||
default BT_ESP32 |
||||
endchoice |
||||
|
||||
endif # BT |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") |
||||
set(OPENOCD OPENOCD-NOTFOUND) |
||||
endif() |
||||
find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) |
||||
|
||||
include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) |
||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) |
@ -0,0 +1,109 @@
@@ -0,0 +1,109 @@
|
||||
/* |
||||
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
/dts-v1/; |
||||
|
||||
#include <espressif/esp32.dtsi> |
||||
|
||||
/ { |
||||
model = "esp32"; |
||||
compatible = "espressif,esp32"; |
||||
|
||||
aliases { |
||||
uart-0 = &uart0; |
||||
i2c-0 = &i2c0; |
||||
}; |
||||
|
||||
chosen { |
||||
zephyr,sram = &sram0; |
||||
zephyr,console = &uart0; |
||||
zephyr,shell-uart = &uart0; |
||||
zephyr,flash = &flash0; |
||||
}; |
||||
}; |
||||
|
||||
&cpu0 { |
||||
clock-frequency = <ESP32_CLK_CPU_240M>; |
||||
}; |
||||
|
||||
&cpu1 { |
||||
clock-frequency = <ESP32_CLK_CPU_240M>; |
||||
}; |
||||
|
||||
&uart0 { |
||||
status = "okay"; |
||||
current-speed = <115200>; |
||||
tx-pin = <1>; |
||||
rx-pin = <3>; |
||||
}; |
||||
|
||||
&gpio0 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&gpio1 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&i2c0 { |
||||
status = "okay"; |
||||
clock-frequency = <I2C_BITRATE_STANDARD>; |
||||
sda-pin = <21>; |
||||
scl-pin = <22>; |
||||
}; |
||||
|
||||
&spi2 { |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
status = "okay"; |
||||
miso-pin = <12>; |
||||
mosi-pin = <13>; |
||||
sclk-pin = <14>; |
||||
csel-pin = <15>; |
||||
}; |
||||
|
||||
&spi3 { |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
status = "okay"; |
||||
miso-pin = <19>; |
||||
mosi-pin = <23>; |
||||
sclk-pin = <18>; |
||||
csel-pin = <5>; |
||||
}; |
||||
|
||||
&timer0 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&timer1 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&timer2 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&timer3 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&trng0 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&flash0 { |
||||
status = "okay"; |
||||
partitions { |
||||
compatible = "fixed-partitions"; |
||||
#address-cells = <1>; |
||||
#size-cells = <1>; |
||||
|
||||
storage_partition: partition@9000 { |
||||
label = "storage"; |
||||
reg = <0x00009000 0x00006000>; |
||||
}; |
||||
}; |
||||
}; |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
identifier: esp_wrover_kit |
||||
name: ESP WROVER KIT |
||||
type: mcu |
||||
arch: xtensa |
||||
toolchain: |
||||
- espressif |
||||
supported: |
||||
- gpio |
||||
- i2c |
||||
- spi |
||||
- watchdog |
||||
- uart |
||||
- pinmux |
||||
- nvs |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
CONFIG_XTENSA_RESET_VECTOR=n |
||||
|
||||
CONFIG_BOARD_ESP_WROVER_KIT=y |
||||
CONFIG_SOC_ESP32=y |
||||
|
||||
CONFIG_MAIN_STACK_SIZE=2048 |
||||
|
||||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=240000000 |
||||
|
||||
CONFIG_CONSOLE=y |
||||
CONFIG_SERIAL=y |
||||
CONFIG_UART_CONSOLE=y |
||||
|
||||
CONFIG_XTENSA_USE_CORE_CRT1=n |
||||
|
||||
CONFIG_PINMUX=y |
||||
CONFIG_PINMUX_ESP32=y |
||||
|
||||
CONFIG_GPIO=y |
||||
CONFIG_GPIO_ESP32=y |
||||
|
||||
CONFIG_GEN_ISR_TABLES=y |
||||
CONFIG_GEN_IRQ_VECTOR_TABLE=n |
||||
|
||||
CONFIG_I2C=y |
||||
CONFIG_CLOCK_CONTROL=y |
||||
|
||||
CONFIG_BOOTLOADER_ESP_IDF=y |
Loading…
Reference in new issue