-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flash/esp: Adds ESP32-S3 flash support
- Loading branch information
Showing
24 changed files
with
1,906 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Makefile to compile the flasher stub program | ||
# | ||
# Note that YOU DO NOT NEED TO COMPILE THIS IN ORDER TO JUST USE | ||
|
||
# See the comments in the top of the Makefile for parameters that | ||
# you probably want to override. | ||
# | ||
# Copyright (c) 2021 Espressif Systems | ||
# All rights reserved | ||
# | ||
# | ||
# This program is free software; you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation; either version 2 of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin | ||
# Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
# Prefix for ESP32-S3 cross compilers (can include a directory path) | ||
CROSS ?= xtensa-esp32s3-elf- | ||
|
||
# Path to the esp-idf root dir | ||
IDF_PATH ?= ../.. | ||
|
||
STUB_CHIP_PATH := $(shell pwd) | ||
STUB_COMMON_PATH := $(STUB_CHIP_PATH)/.. | ||
STUB_CHIP_ARCH_PATH := $(STUB_COMMON_PATH)/xtensa | ||
STUB_OBJ_DEPS := sdkconfig.h | ||
STUB_LD_SCRIPT := stub.ld | ||
STUB_CHIP := ESP32S3 | ||
|
||
SRCS := $(IDF_PATH)/components/app_trace/port/xtensa/port.c \ | ||
$(IDF_PATH)/components/xtensa/eri.c \ | ||
$(IDF_PATH)/components/esp_hw_support/port/esp32s3/rtc_clk.c \ | ||
$(IDF_PATH)/components/esp_hw_support/port/esp32s3/rtc_clk_init.c \ | ||
$(IDF_PATH)/components/esp_hw_support/port/esp32s3/rtc_time.c | ||
|
||
CFLAGS := -mlongcalls -mtext-section-literals | ||
|
||
INCLUDES := -I$(IDF_PATH)/components/esp32s3/include -I$(IDF_PATH)/components/soc/esp32s3/include \ | ||
-I$(IDF_PATH)/components/esp_rom/include/esp32s3 -I$(IDF_PATH)/components/xtensa/esp32s3/include \ | ||
-I$(IDF_PATH)/components/hal/esp32s3/include \ | ||
-I$(IDF_PATH)/components/esp_hw_support/port/esp32s3/private_include \ | ||
-I$(IDF_PATH)/components/esp_hw_support/port/esp32s3 \ | ||
-I$(IDF_PATH)/components/xtensa/include \ | ||
-I$(IDF_PATH)/components/freertos/include \ | ||
-I$(IDF_PATH)/components/freertos/port/xtensa/include | ||
|
||
DEFINES := | ||
|
||
LDFLAGS := -L$(IDF_PATH)/components/esp32s3/ld -T$(IDF_PATH)/components/esp_rom/esp32s3/ld/esp32s3.rom.ld \ | ||
-T$(IDF_PATH)/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld | ||
|
||
include ../stub_common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef _STUB_SDKCONFIG_H_ | ||
#define _STUB_SDKCONFIG_H_ | ||
|
||
#define CONFIG_IDF_TARGET_ARCH_XTENSA 1 | ||
#define CONFIG_IDF_TARGET_ESP32S3 1 | ||
#define CONFIG_FREERTOS_UNICORE 0 | ||
/* Use ROM flash driver patch | ||
* #define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 | ||
* Disable application module multi-threading lock */ | ||
#define CONFIG_APPTRACE_LOCK_ENABLE 0 | ||
/* Enable apptarce module for flash data transfers */ | ||
#define CONFIG_APPTRACE_DEST_JTAG 1 | ||
#define CONFIG_APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE 1 | ||
#define CONFIG_APPTRACE_ENABLE 1 | ||
#define CONFIG_APPTRACE_BUF_SIZE 0 | ||
#define CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX 0 | ||
/* Debug UART number */ | ||
#define CONFIG_CONSOLE_UART_NUM 0 | ||
/* Debug UART baudrate */ | ||
#define CONFIG_CONSOLE_UART_BAUDRATE 115200 | ||
/* alloc apptrace data buffers on stack */ | ||
#define CONFIG_STUB_STACK_DATA_POOL_SIZE (2*CONFIG_APPTRACE_BUF_SIZE) | ||
|
||
/* needed due to apptrace sources usage */ | ||
#define CONFIG_LOG_MAXIMUM_LEVEL 0 | ||
/* needed due to various checks in IDF headers */ | ||
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16 | ||
/* TODO: use current clk, get it from PLL settings */ | ||
#define CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ 160 | ||
/* Unused by stub, just for compilation of IDF */ | ||
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000 | ||
|
||
#endif /*_STUB_SDKCONFIG_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*************************************************************************** | ||
* LD script for ESP32-S3 flasher stub * | ||
* Copyright (C) 2021 Espressif Systems Ltd. * | ||
* Author: Alexey Gerenkov <alexey@espressif.com> * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * | ||
***************************************************************************/ | ||
|
||
MEMORY { | ||
/* place stub at the beginning of the OpenOCD working area, | ||
remaining space will be used for other chunks */ | ||
iram : org = 0x403B0000, len = 0x4000 | ||
dram : org = 0x3FCE0000, len = 0xC000 | ||
} | ||
|
||
INCLUDE stub_common.ld |
Oops, something went wrong.