Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions arch/risc-v/src/common/espressif/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ config ESPRESSIF_FLASH_8M
config ESPRESSIF_FLASH_16M
bool "16 MB"

config ESPRESSIF_FLASH_32M
bool "32 MB"

endchoice # ESPRESSIF_FLASH

config ESPRESSIF_IDF_ENV_FPGA
Expand Down
15 changes: 15 additions & 0 deletions arch/risc-v/src/common/espressif/esp_allocateheap.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
#if defined(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
/* ESP32-P4 rev < v3 has non-contiguous SRAM: sram_low + sram_high.
* The primary heap is in sram_low. Add sram_high as a second region.
*/

extern uint8_t _sram_high_heap_start[];
extern uint8_t _sram_high_heap_end[];

size_t region_size = _sram_high_heap_end - _sram_high_heap_start;

if (region_size > 0)
{
kumm_addregion(_sram_high_heap_start, region_size);
}
#endif
}
#endif

9 changes: 6 additions & 3 deletions arch/risc-v/src/esp32p4/esp_chip_rev.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* Included Files
****************************************************************************/

#include <nuttx/config.h>

#include "hal/efuse_hal.h"

/****************************************************************************
Expand Down Expand Up @@ -65,21 +67,22 @@ void esp_chip_revision_check(void)

if (chip_rev < ESP32P4_MIN_FULLY_SUPPORTED_VERSION)
{
#ifndef ESP32P4_IGNORE_CHIP_REVISION_CHECK
#if !defined(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
ets_printf("ERROR: NuttX supports ESP32-P4 chip revision > v%d.%01d"
" (chip revision is v%" PRIu32 ".%" PRIu32 ")\n",
ESP32P4_MIN_FULLY_SUPPORTED_VERSION / 100,
ESP32P4_MIN_FULLY_SUPPORTED_VERSION % 100,
chip_rev / 100, chip_rev % 100);
PANIC();
#endif
#else
ets_printf("WARNING: NuttX supports ESP32-P4 chip revision > v%d.%01d"
" (chip revision is v%" PRIu32 ".%" PRIu32 ").\n"
"Ignoring this error and continuing because "
"`ESP32P4_IGNORE_CHIP_REVISION_CHECK` is set...\n"
"`CONFIG_ESP32P4_SELECTS_REV_LESS_V3` is set...\n"
"THIS MAY NOT WORK! DON'T USE THIS CHIP IN PRODUCTION!\n",
ESP32P4_MIN_FULLY_SUPPORTED_VERSION / 100,
ESP32P4_MIN_FULLY_SUPPORTED_VERSION % 100,
chip_rev / 100, chip_rev % 100);
#endif
}
}
12 changes: 12 additions & 0 deletions boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ config ARCH_BOARD_ESP32P4_FUNCTION_EV_BOARD
---help---
The ESP32-P4 Function EV Board features the ESP32-P4 CPU with two RISC-V cores.

config ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
bool "Waveshare ESP32-P4-PICO-WIFI"
depends on ARCH_CHIP_ESP32P4
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
---help---
The Waveshare ESP32-P4-PICO-WIFI features the ESP32-P4 CPU with two RISC-V cores.

config ARCH_BOARD_ET_STM32_STAMP
bool "Futurlec: ET-STM32 Stamp"
depends on ARCH_CHIP_STM32F103RE
Expand Down Expand Up @@ -3618,6 +3626,7 @@ config ARCH_BOARD
default "esp32c6-xiao" if ARCH_BOARD_ESP32C6_XIAO
default "esp32h2-devkit" if ARCH_BOARD_ESP32H2_DEVKIT
default "esp32p4-function-ev-board" if ARCH_BOARD_ESP32P4_FUNCTION_EV_BOARD
default "esp32p4-pico-wifi-wareshare" if ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
default "et-stm32-stamp" if ARCH_BOARD_ET_STM32_STAMP
default "tlsr8278adk80d" if ARCH_BOARD_TLSR8278ADK80D
default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG
Expand Down Expand Up @@ -4927,6 +4936,9 @@ endif
if ARCH_BOARD_ESP32P4_FUNCTION_EV_BOARD
source "boards/risc-v/esp32p4/esp32p4-function-ev-board/Kconfig"
endif
if ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
source "boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/Kconfig"
endif
if ARCH_BOARD_SIM
source "boards/sim/sim/sim/Kconfig"
endif
Expand Down
4 changes: 4 additions & 0 deletions boards/risc-v/esp32p4/common/scripts/esp32p4_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ SECTIONS
_bss_end_high = ABSOLUTE(.);
} > sram_high

/* Heap region for sram_high: from end of bss to end of sram_high segment */
_sram_high_heap_start = _bss_end_high;
_sram_high_heap_end = ORIGIN(sram_high) + LENGTH(sram_high);

/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
Expand Down
8 changes: 8 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

if ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE

endif # ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32p4-pico-wifi-wareshare"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE=y
CONFIG_ARCH_CHIP="esp32p4"
CONFIG_ARCH_CHIP_ESP32P4=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_IRQ_TO_NDX=y
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
CONFIG_ARCH_NUSER_INTERRUPTS=17
CONFIG_ARCH_RISCV=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=15000
CONFIG_BUILTIN=y
CONFIG_ESP32P4_REV_MIN_100=y
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
CONFIG_ESPRESSIF_FLASH_32M=y
CONFIG_EXPERIMENTAL=y
CONFIG_FS_PROCFS=y
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MM_REGIONS=2
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_NSH_STRERROR=y
CONFIG_PREALLOC_TIMERS=0
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_BACKTRACE=y
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=18
CONFIG_START_MONTH=3
CONFIG_START_YEAR=2026
CONFIG_SYSTEM_DUMPSTACK=y
CONFIG_SYSTEM_NSH=y
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_UART0_SERIAL_CONSOLE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32p4-pico-wifi-wareshare"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32P4_PICO_WIFI_WARESHARE=y
CONFIG_ARCH_CHIP="esp32p4"
CONFIG_ARCH_CHIP_ESP32P4=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_IRQ_TO_NDX=y
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
CONFIG_ARCH_NUSER_INTERRUPTS=17
CONFIG_ARCH_RISCV=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=15000
CONFIG_BUILTIN=y
CONFIG_ESP32P4_REV_MIN_100=y
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
CONFIG_ESPRESSIF_FLASH_32M=y
CONFIG_ESPRESSIF_SPIFLASH=y
CONFIG_ESPRESSIF_SPIFLASH_SMARTFS=y
CONFIG_ESPRESSIF_STORAGE_MTD_OFFSET=0x110000
CONFIG_ESPRESSIF_STORAGE_MTD_SIZE=0x1ef0000
CONFIG_EXPERIMENTAL=y
CONFIG_FS_PROCFS=y
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MM_REGIONS=2
CONFIG_NAME_MAX=48
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_NSH_STRERROR=y
CONFIG_PREALLOC_TIMERS=0
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_BACKTRACE=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_MAXNAMLEN=48
CONFIG_START_DAY=18
CONFIG_START_MONTH=3
CONFIG_START_YEAR=2026
CONFIG_SYSTEM_DUMPSTACK=y
CONFIG_SYSTEM_FLASH_ERASEALL=y
CONFIG_SYSTEM_NSH=y
CONFIG_TESTING_FSTEST=y
CONFIG_TESTING_FSTEST_MOUNTPT="/mnt"
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_UART0_SERIAL_CONSOLE=y
41 changes: 41 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/****************************************************************************
* boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/include/board.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

#ifndef __BOARDS_RISCV_ESP32P4_ESP32P4_PICO_WIFI_WARESHARE_INCLUDE_BOARD_H
#define __BOARDS_RISCV_ESP32P4_ESP32P4_PICO_WIFI_WARESHARE_INCLUDE_BOARD_H

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* GPIO pins used by the GPIO Subsystem */

#define BOARD_NGPIOOUT 2 /* Amount of GPIO Output pins */
#define BOARD_NGPIOINT 1 /* Amount of GPIO Input w/ Interruption pins */

/* ESP32P4-Generic GPIOs ****************************************************/

/* BOOT Button */

#define BUTTON_BOOT 35

#endif /* __BOARDS_RISCV_ESP32P4_ESP32P4_PICO_WIFI_WARESHARE_INCLUDE_BOARD_H */
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
############################################################################
# boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/scripts/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
###########################################################################

include $(TOPDIR)/.config
include $(TOPDIR)/tools/Config.mk
include $(TOPDIR)/tools/espressif/Config.mk
include $(TOPDIR)/arch/risc-v/src/common/Toolchain.defs

# Remove quotes from CONFIG_ESPRESSIF_CHIP_SERIES configuration

CHIP_SERIES = $(patsubst "%",%,$(CONFIG_ESPRESSIF_CHIP_SERIES))

# Pick the linker scripts from the board level if they exist, if not
# pick the common linker scripts.

ARCHSCRIPT += $(BOARD_COMMON_DIR)/scripts/$(CHIP_SERIES)_aliases.ld

ARCHSCRIPT += $(call FINDSCRIPT,$(CHIP_SERIES)_flat_memory.ld)

ifeq ($(CONFIG_ESP32P4_REV_MIN_300),y)
BOARD_REV = .rev3
endif

ifeq ($(CONFIG_ESPRESSIF_BOOTLOADER_MCUBOOT),y)
ARCHSCRIPT += $(call FINDSCRIPT,$(CHIP_SERIES)_sections$(BOARD_REV).ld)
else ifeq ($(CONFIG_ESPRESSIF_SIMPLE_BOOT),y)
ARCHSCRIPT += $(call FINDSCRIPT,$(CHIP_SERIES)_sections$(BOARD_REV).ld)
endif

ARCHPICFLAGS = -fpic

CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -Werror=return-type
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__

# Loadable module definitions

LDMODULEFLAGS += -melf32lriscv

# ELF module definitions

LDELFFLAGS += -melf32lriscv
45 changes: 45 additions & 0 deletions boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/src/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#############################################################################
# boards/risc-v/esp32p4/esp32p4-pico-wifi-wareshare/src/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#############################################################################

include $(TOPDIR)/Make.defs

CSRCS = esp32p4_boot.c esp32p4_bringup.c

ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += esp32p4_appinit.c

ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += esp32p4_reset.c
endif
endif

ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += esp32p4_gpio.c
endif

ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += esp32p4_buttons.c
endif

DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
Loading
Loading