esp32[s3]: Add nuttx toolchain support on mcuboot

This commit is contained in:
Eren Terzioglu 2024-07-03 11:07:19 +02:00 committed by Xiang Xiao
parent 024e95875a
commit c9f5ae5fa4
2 changed files with 43 additions and 1 deletions

View File

@ -36,6 +36,7 @@ BOOTLOADER_CONFIG = $(BOOTLOADER_DIR)/bootloader.conf
MCUBOOT_SRCDIR = $(BOOTLOADER_DIR)/mcuboot
MCUBOOT_ESPDIR = $(MCUBOOT_SRCDIR)/boot/espressif
MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
MCUBOOT_TOOLCHAIN = $(TOPDIR)/tools/esp32s3/mcuboot_toolchain_esp32s3.cmake
$(BOOTLOADER_DIR):
$(Q) mkdir -p $(BOOTLOADER_DIR) &>/dev/null
@ -105,7 +106,8 @@ $(BOOTLOADER_BIN): chip/$(ESP_HAL_3RDPARTY_REPO) $(MCUBOOT_SRCDIR) $(BOOTLOADER_
-c esp32s3 \
-f $(BOOTLOADER_CONFIG) \
-p $(BOOTLOADER_DIR) \
-e $(HALDIR)
-e $(HALDIR) \
-d $(MCUBOOT_TOOLCHAIN)
$(call COPYFILE, $(BOOTLOADER_DIR)/$(BOOTLOADER_OUTDIR)/mcuboot-esp32s3.bin, $(TOPDIR))
bootloader: $(BOOTLOADER_CONFIG) $(BOOTLOADER_BIN)

View File

@ -0,0 +1,40 @@
# ##############################################################################
# tools/esp32s3/mcuboot_toolchain_esp32s3.cmake
#
# 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.
#
# ##############################################################################
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER xtensa-esp32s3-elf-gcc)
set(CMAKE_CXX_COMPILER xtensa-esp32s3-elf-g++)
set(CMAKE_ASM_COMPILER xtensa-esp32s3-elf-gcc)
set(_CMAKE_TOOLCHAIN_PREFIX xtensa-esp32s3-elf-)
set(CMAKE_C_FLAGS
"-mlongcalls"
CACHE STRING "C Compiler Base Flags" FORCE)
set(CMAKE_CXX_FLAGS
"-mlongcalls"
CACHE STRING "C++ Compiler Base Flags" FORCE)
set(CMAKE_ASM_FLAGS
"${UNIQ_CMAKE_ASM_FLAGS}"
CACHE STRING "ASM Compiler Base Flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS
"-Wl,--gc-sections"
CACHE STRING "Linker Base Flags")