Skip to content

Commit

Permalink
loaders/flash/espressif: re-organize common things
Browse files Browse the repository at this point in the history
  • Loading branch information
erhankur committed Dec 5, 2023
1 parent 09db343 commit ce96f2f
Show file tree
Hide file tree
Showing 88 changed files with 6,279 additions and 7,437 deletions.
1 change: 1 addition & 0 deletions contrib/loaders/flash/espressif/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SRCS := $(IDF_PATH)/components/app_trace/port/$(STUB_ARCH)/port.c \
$(IDF_PATH)/components/esp_hw_support/port/esp32/rtc_clk_init.c \
$(IDF_PATH)/components/esp_hw_support/port/esp32/rtc_time.c \
$(IDF_PATH)/components/xtensa/eri.c \
$(STUB_CHIP_PATH)/stub_sha_chip.c \
$(STUB_CHIP_PATH)/stub_spiflash_rom_patch.c

CFLAGS := -std=gnu99 -mlongcalls -mtext-section-literals
Expand Down
41 changes: 22 additions & 19 deletions contrib/loaders/flash/espressif/esp32/sdkconfig.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */

#ifndef _STUB_SDKCONFIG_H_
#define _STUB_SDKCONFIG_H_
#ifndef OPENOCD_LOADERS_FLASH_ESPRESSIF_ESP32_SDKCONFIG_H
#define OPENOCD_LOADERS_FLASH_ESPRESSIF_ESP32_SDKCONFIG_H

/* Here config defines necessary to compile sources from IDF */

#define CONFIG_IDF_TARGET_ARCH_XTENSA 1
#define CONFIG_IDF_TARGET_ESP32 1
#define CONFIG_IDF_TARGET_ARCH_XTENSA 1
#define CONFIG_IDF_TARGET_ESP32 1

/* Use ROM flash driver patch */
#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1
#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1

/* Disable application module multi-threading lock */
#define CONFIG_APPTRACE_LOCK_ENABLE 0
#define CONFIG_APPTRACE_LOCK_ENABLE 0

/* Enable apptarce module for flash data transfers */
#define CONFIG_APPTRACE_DEST_JTAG 1
#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
#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
#define CONFIG_CONSOLE_UART_NUM 0
/* Debug UART baudrate */
#define CONFIG_CONSOLE_UART_BAUDRATE 115200
#define CONFIG_CONSOLE_UART_BAUDRATE 115200
/* alloc apptrace data buffers on stack */
#define CONFIG_STUB_STACK_DATA_POOL_SIZE (2 * CONFIG_APPTRACE_BUF_SIZE)

#define CONFIG_STUB_STACK_DATA_POOL_SIZE (2 * CONFIG_APPTRACE_BUF_SIZE)
/* needed due to apptrace sources usage */
#define CONFIG_LOG_MAXIMUM_LEVEL 0
#define CONFIG_LOG_MAXIMUM_LEVEL 0
/* needed due to various checks in IDF headers */
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
/* TODO: use current clk, get it from PLL settings */
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 240
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 240
/* Unused by stub, just for compilation of IDF */
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000

#endif /*_STUB_SDKCONFIG_H_ */
#endif /* OPENOCD_LOADERS_FLASH_ESPRESSIF_ESP32_SDKCONFIG_H */
Loading

0 comments on commit ce96f2f

Please sign in to comment.