cpu_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2022 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #if !defined(__ASSEMBLER__)
22 # include <stdint.h>
23 #endif
24 
30 #ifdef MODULE_NEWLIB_NANO
31 # define THREAD_EXTRA_STACKSIZE (0)
32 #else
33 # define THREAD_EXTRA_STACKSIZE (512)
34 #endif
35 
37 #define THREAD_EXTRA_STACKSIZE_PRINTF (1536)
38 
39 #ifndef THREAD_STACKSIZE_DEFAULT
41 # define THREAD_STACKSIZE_DEFAULT (2048)
42 #endif
43 
44 #ifndef THREAD_STACKSIZE_IDLE
46 # define THREAD_STACKSIZE_IDLE (2048)
47 #endif
48 
49 #ifndef ESP_WIFI_STACKSIZE
51 # define ESP_WIFI_STACKSIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE)
52 #endif
56 #define PRINTF_BUFSIZ 256
57 
61 #define PUF_SRAM_ATTRIBUTES __attribute__((used, section(".noinit")))
62 
71 #define CPU_HAS_UNALIGNED_ACCESS 1
72 
77 #if !DOXYGEN && !defined(__ASSEMBLER__)
78 /* start address of flash pages in CPU address space as determined by the linker */
79 extern uint8_t _fp_mmu_start;
80 #endif
81 
82 #define FLASHPAGE_SIZE (4096U)
83 #define FLASHPAGE_WRITE_BLOCK_SIZE (4U)
84 #define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (4U)
89 #define FLASHPAGE_NUMOF (CONFIG_ESP_FLASHPAGE_CAPACITY / FLASHPAGE_SIZE)
90 
94 #define CPU_FLASH_BASE ((uint32_t)&_fp_mmu_start)
95 
98 /* include ESP32x SoC specific compile time configurations */
99 #if defined(CPU_FAM_ESP32)
100 # include "cpu_conf_esp32.h"
101 #elif defined(CPU_FAM_ESP32C3)
102 # include "cpu_conf_esp32c3.h"
103 #elif defined(CPU_FAM_ESP32C6)
104 # include "cpu_conf_esp32c6.h"
105 #elif defined(CPU_FAM_ESP32H2)
106 # include "cpu_conf_esp32h2.h"
107 #elif defined(CPU_FAM_ESP32S2)
108 # include "cpu_conf_esp32s2.h"
109 #elif defined(CPU_FAM_ESP32S3)
110 # include "cpu_conf_esp32s3.h"
111 #else
112 # error "ESP32x family implementation missing"
113 #endif
114 
115 #ifdef __cplusplus
116 extern "C" {
117 #endif
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
Compile-time configuration macros for ESP32 SoCs.
Compile-time configuration macros for ESP32-C3 SoCs.
Compile-time configuration macros for ESP32-C6 SoCs.
Compile-time configuration macros for ESP32-H2 SoCs.
Compile-time configuration macros for ESP32-S2 SoCs.
Compile-time configuration macros for ESP32-S3 SoCs.