Skip to content

Commit 4401b49

Browse files
Otpvondoiatssimbit18
authored andcommitted
boards/risc-v/esp32p4: add Waveshare ESP32-P4-PICO-WIFI board support
Add board support for the Waveshare ESP32-P4-PICO-WIFI development board. This board features: - ESP32-P4 dual-core RISC-V MCU (rev v1.0) - 768KB HP L2MEM (MM_REGIONS=2 for sram_low + sram_high) - 32MB external NOR Flash (GD25Q256EYIGR, Quad SPI) - 32MB SiP PSRAM (driver not yet available upstream) Configurations: - nsh: basic NuttX shell - spiflash: NSH with SPI Flash (SmartFS) support Signed-off-by: likun17 <likun17@xiaomi.com>
1 parent b606180 commit 4401b49

14 files changed

Lines changed: 1834 additions & 0 deletions

File tree

boards/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,14 @@ config ARCH_BOARD_ESP32P4_FUNCTION_EV_BOARD
636636
---help---
637637
The ESP32-P4 Function EV Board features the ESP32-P4 CPU with two RISC-V cores.
638638

639+
config ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
640+
bool "Waveshare ESP32-P4-PICO-WIFI"
641+
depends on ARCH_CHIP_ESP32P4
642+
select ARCH_HAVE_BUTTONS
643+
select ARCH_HAVE_IRQBUTTONS
644+
---help---
645+
The Waveshare ESP32-P4-PICO-WIFI features the ESP32-P4 CPU with two RISC-V cores.
646+
639647
config ARCH_BOARD_ET_STM32_STAMP
640648
bool "Futurlec: ET-STM32 Stamp"
641649
depends on ARCH_CHIP_STM32F103RE
@@ -3625,6 +3633,7 @@ config ARCH_BOARD
36253633
default "esp32c6-xiao" if ARCH_BOARD_ESP32C6_XIAO
36263634
default "esp32h2-devkit" if ARCH_BOARD_ESP32H2_DEVKIT
36273635
default "esp32p4-function-ev-board" if ARCH_BOARD_ESP32P4_FUNCTION_EV_BOARD
3636+
default "esp32p4-pico-wifi-wareshare" if ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
36283637
default "et-stm32-stamp" if ARCH_BOARD_ET_STM32_STAMP
36293638
default "tlsr8278adk80d" if ARCH_BOARD_TLSR8278ADK80D
36303639
default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG
@@ -4935,6 +4944,9 @@ endif
49354944
if ARCH_BOARD_ESP32P4_FUNCTION_EV_BOARD
49364945
source "boards/risc-v/esp32p4/esp32p4-function-ev-board/Kconfig"
49374946
endif
4947+
if ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
4948+
source "boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/Kconfig"
4949+
endif
49384950
if ARCH_BOARD_SIM
49394951
source "boards/sim/sim/sim/Kconfig"
49404952
endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
if ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
7+
8+
endif # ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# This file is autogenerated: PLEASE DO NOT EDIT IT.
3+
#
4+
# You can use "make menuconfig" to make any modifications to the installed .config file.
5+
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
6+
# modifications.
7+
#
8+
# CONFIG_NSH_ARGCAT is not set
9+
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
10+
CONFIG_ARCH="risc-v"
11+
CONFIG_ARCH_BOARD="esp32p4-pico-wifi-wareshare"
12+
CONFIG_ARCH_BOARD_COMMON=y
13+
CONFIG_ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE=y
14+
CONFIG_ARCH_CHIP="esp32p4"
15+
CONFIG_ARCH_CHIP_ESP32P4=y
16+
CONFIG_ARCH_INTERRUPTSTACK=2048
17+
CONFIG_ARCH_IRQ_TO_NDX=y
18+
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
19+
CONFIG_ARCH_NUSER_INTERRUPTS=17
20+
CONFIG_ARCH_RISCV=y
21+
CONFIG_BOARDCTL_RESET=y
22+
CONFIG_BOARD_LOOPSPERMSEC=15000
23+
CONFIG_BUILTIN=y
24+
CONFIG_ESP32P4_REV_MIN_100=y
25+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
26+
CONFIG_ESPRESSIF_FLASH_32M=y
27+
CONFIG_EXPERIMENTAL=y
28+
CONFIG_FS_PROCFS=y
29+
CONFIG_IDLETHREAD_STACKSIZE=2048
30+
CONFIG_INIT_ENTRYPOINT="nsh_main"
31+
CONFIG_INTELHEX_BINARY=y
32+
CONFIG_LIBC_PERROR_STDOUT=y
33+
CONFIG_LIBC_STRERROR=y
34+
CONFIG_MM_REGIONS=2
35+
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
36+
CONFIG_NSH_ARCHINIT=y
37+
CONFIG_NSH_BUILTIN_APPS=y
38+
CONFIG_NSH_FILEIOSIZE=512
39+
CONFIG_NSH_READLINE=y
40+
CONFIG_NSH_STRERROR=y
41+
CONFIG_PREALLOC_TIMERS=0
42+
CONFIG_RR_INTERVAL=200
43+
CONFIG_SCHED_BACKTRACE=y
44+
CONFIG_SCHED_WAITPID=y
45+
CONFIG_START_DAY=18
46+
CONFIG_START_MONTH=3
47+
CONFIG_START_YEAR=2026
48+
CONFIG_SYSTEM_DUMPSTACK=y
49+
CONFIG_SYSTEM_NSH=y
50+
CONFIG_TESTING_GETPRIME=y
51+
CONFIG_TESTING_OSTEST=y
52+
CONFIG_UART0_SERIAL_CONSOLE=y
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#
2+
# This file is autogenerated: PLEASE DO NOT EDIT IT.
3+
#
4+
# You can use "make menuconfig" to make any modifications to the installed .config file.
5+
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
6+
# modifications.
7+
#
8+
# CONFIG_NSH_ARGCAT is not set
9+
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
10+
CONFIG_ARCH="risc-v"
11+
CONFIG_ARCH_BOARD="esp32p4-pico-wifi-wareshare"
12+
CONFIG_ARCH_BOARD_COMMON=y
13+
CONFIG_ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE=y
14+
CONFIG_ARCH_CHIP="esp32p4"
15+
CONFIG_ARCH_CHIP_ESP32P4=y
16+
CONFIG_ARCH_INTERRUPTSTACK=2048
17+
CONFIG_ARCH_IRQ_TO_NDX=y
18+
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
19+
CONFIG_ARCH_NUSER_INTERRUPTS=17
20+
CONFIG_ARCH_RISCV=y
21+
CONFIG_BOARDCTL_RESET=y
22+
CONFIG_BOARD_LOOPSPERMSEC=15000
23+
CONFIG_BUILTIN=y
24+
CONFIG_ESP32P4_REV_MIN_100=y
25+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
26+
CONFIG_ESPRESSIF_FLASH_32M=y
27+
CONFIG_ESPRESSIF_SPIFLASH=y
28+
CONFIG_ESPRESSIF_SPIFLASH_SMARTFS=y
29+
CONFIG_ESPRESSIF_STORAGE_MTD_OFFSET=0x110000
30+
CONFIG_ESPRESSIF_STORAGE_MTD_SIZE=0x1ef0000
31+
CONFIG_EXPERIMENTAL=y
32+
CONFIG_FS_PROCFS=y
33+
CONFIG_IDLETHREAD_STACKSIZE=2048
34+
CONFIG_INIT_ENTRYPOINT="nsh_main"
35+
CONFIG_INTELHEX_BINARY=y
36+
CONFIG_LIBC_PERROR_STDOUT=y
37+
CONFIG_LIBC_STRERROR=y
38+
CONFIG_MM_REGIONS=2
39+
CONFIG_NAME_MAX=48
40+
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
41+
CONFIG_NSH_ARCHINIT=y
42+
CONFIG_NSH_BUILTIN_APPS=y
43+
CONFIG_NSH_DISABLE_LOSMART=y
44+
CONFIG_NSH_FILEIOSIZE=512
45+
CONFIG_NSH_READLINE=y
46+
CONFIG_NSH_STRERROR=y
47+
CONFIG_PREALLOC_TIMERS=0
48+
CONFIG_RR_INTERVAL=200
49+
CONFIG_SCHED_BACKTRACE=y
50+
CONFIG_SCHED_WAITPID=y
51+
CONFIG_SMARTFS_MAXNAMLEN=48
52+
CONFIG_START_DAY=18
53+
CONFIG_START_MONTH=3
54+
CONFIG_START_YEAR=2026
55+
CONFIG_SYSTEM_DUMPSTACK=y
56+
CONFIG_SYSTEM_FLASH_ERASEALL=y
57+
CONFIG_SYSTEM_NSH=y
58+
CONFIG_TESTING_FSTEST=y
59+
CONFIG_TESTING_FSTEST_MOUNTPT="/mnt"
60+
CONFIG_TESTING_GETPRIME=y
61+
CONFIG_TESTING_OSTEST=y
62+
CONFIG_UART0_SERIAL_CONSOLE=y
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/****************************************************************************
2+
* boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/include/board.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
#ifndef __BOARDS_RISCV_ESP32P4_ESP32P4_PICO_WIFI_WARESHARE_INCLUDE_BOARD_H
24+
#define __BOARDS_RISCV_ESP32P4_ESP32P4_PICO_WIFI_WARESHARE_INCLUDE_BOARD_H
25+
26+
/****************************************************************************
27+
* Pre-processor Definitions
28+
****************************************************************************/
29+
30+
/* GPIO pins used by the GPIO Subsystem */
31+
32+
#define BOARD_NGPIOOUT 2 /* Amount of GPIO Output pins */
33+
#define BOARD_NGPIOINT 1 /* Amount of GPIO Input w/ Interruption pins */
34+
35+
/* ESP32P4-Generic GPIOs ****************************************************/
36+
37+
/* BOOT Button */
38+
39+
#define BUTTON_BOOT 35
40+
41+
#endif /* __BOARDS_RISCV_ESP32P4_ESP32P4_PICO_WIFI_WARESHARE_INCLUDE_BOARD_H */
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
############################################################################
2+
# boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/scripts/Make.defs
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
###########################################################################
22+
23+
include $(TOPDIR)/.config
24+
include $(TOPDIR)/tools/Config.mk
25+
include $(TOPDIR)/tools/espressif/Config.mk
26+
include $(TOPDIR)/arch/risc-v/src/common/Toolchain.defs
27+
28+
# Remove quotes from CONFIG_ESPRESSIF_CHIP_SERIES configuration
29+
30+
CHIP_SERIES = $(patsubst "%",%,$(CONFIG_ESPRESSIF_CHIP_SERIES))
31+
32+
# Pick the linker scripts from the board level if they exist, if not
33+
# pick the common linker scripts.
34+
35+
ARCHSCRIPT += $(BOARD_COMMON_DIR)/scripts/$(CHIP_SERIES)_aliases.ld
36+
37+
ARCHSCRIPT += $(call FINDSCRIPT,$(CHIP_SERIES)_flat_memory.ld)
38+
39+
ifeq ($(CONFIG_ESP32P4_REV_MIN_300),y)
40+
BOARD_REV = .rev3
41+
endif
42+
43+
ifeq ($(CONFIG_ESPRESSIF_BOOTLOADER_MCUBOOT),y)
44+
ARCHSCRIPT += $(call FINDSCRIPT,$(CHIP_SERIES)_sections$(BOARD_REV).ld)
45+
else ifeq ($(CONFIG_ESPRESSIF_SIMPLE_BOOT),y)
46+
ARCHSCRIPT += $(call FINDSCRIPT,$(CHIP_SERIES)_sections$(BOARD_REV).ld)
47+
endif
48+
49+
ARCHPICFLAGS = -fpic
50+
51+
CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -Werror=return-type
52+
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
53+
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
54+
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
55+
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
56+
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
57+
58+
# Loadable module definitions
59+
60+
LDMODULEFLAGS += -melf32lriscv
61+
62+
# ELF module definitions
63+
64+
LDELFFLAGS += -melf32lriscv
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#############################################################################
2+
# boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/src/Make.defs
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
#############################################################################
22+
23+
include $(TOPDIR)/Make.defs
24+
25+
CSRCS = esp32p4_boot.c esp32p4_bringup.c
26+
27+
ifeq ($(CONFIG_BOARDCTL),y)
28+
CSRCS += esp32p4_appinit.c
29+
30+
ifeq ($(CONFIG_BOARDCTL_RESET),y)
31+
CSRCS += esp32p4_reset.c
32+
endif
33+
endif
34+
35+
ifeq ($(CONFIG_DEV_GPIO),y)
36+
CSRCS += esp32p4_gpio.c
37+
endif
38+
39+
ifeq ($(CONFIG_ARCH_BUTTONS),y)
40+
CSRCS += esp32p4_buttons.c
41+
endif
42+
43+
DEPPATH += --dep-path board
44+
VPATH += :board
45+
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board

0 commit comments

Comments
 (0)