Skip to content

Commit 0005683

Browse files
authored
Merge pull request #21616 from gschorcht/cpu/esp32/add_esp32_c6
cpu/esp32: add ESP32-C6 support
2 parents bd17805 + 3af41ab commit 0005683

File tree

72 files changed

+3198
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3198
-79
lines changed

boards/common/esp32c6/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-FileCopyrightText: 2025 Gunar Schorcht
2+
# SPDX-License-Identifier: LGPL-2.1-only
3+
4+
config BOARD_COMMON_ESP32C6
5+
bool
6+
select BOARD_COMMON_ESP32X
7+
8+
source "$(RIOTBOARD)/common/esp32x/Kconfig"

boards/common/esp32c6/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
MODULE = boards_common_esp32c6
2+
3+
DIRS = $(RIOTBOARD)/common/esp32x
4+
5+
include $(RIOTBASE)/Makefile.base

boards/common/esp32c6/Makefile.dep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
USEMODULE += boards_common_esp32c6
2+
3+
include $(RIOTBOARD)/common/esp32x/Makefile.dep
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CPU_FAM = esp32c6
2+
3+
include $(RIOTBOARD)/common/esp32x/Makefile.features
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
INCLUDES += -I$(RIOTBOARD)/common/esp32c6/include
2+
3+
include $(RIOTBOARD)/common/esp32x/Makefile.include

boards/common/esp32c6/doc.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Copyright (C) 2025 Gunar Schorcht
3+
4+
This file is subject to the terms and conditions of the GNU Lesser
5+
General Public License v2.1. See the file LICENSE in the top level
6+
directory for more details.
7+
-->
8+
9+
@defgroup boards_common_esp32c6 ESP32-C6 Common
10+
@ingroup boards_common
11+
@ingroup boards_esp32c6
12+
@brief Definitions and configurations that are common for
13+
all ESP32-C6 boards.
14+
15+
For detailed information about the ESP32-C6, configuring and compiling RIOT
16+
for ESP32-C6 boards, please refer \ref esp32_riot.
17+
18+
@defgroup boards_esp32c6 ESP32-C6 Boards
19+
@ingroup boards
20+
@brief This group of boards contains the documentation of ESP32-C6 boards.
21+
22+
@note For detailed information about the ESP32-C6 SoC, the tool chain
23+
as well as configuring and compiling RIOT for ESP32-C6 boards,
24+
see \ref esp32_riot.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Gunar Schorcht
3+
* SPDX-License-Identifier: LGPL-2.1-only
4+
*/
5+
6+
#pragma once
7+
8+
/**
9+
* @ingroup boards_common_esp32c6
10+
* @brief Board definitions that are common for all ESP32-C6 boards.
11+
*
12+
* This file contains board configurations that are valid for all ESP32-C6.
13+
*
14+
* For detailed information about the configuration of ESP32-C6 boards, see
15+
* section \ref esp32_peripherals "Common Peripherals".
16+
*
17+
* @author Gunar Schorcht <[email protected]>
18+
* @file
19+
* @{
20+
*/
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
#if !DOXYGEN
27+
28+
/**
29+
* @name ztimer Configuration valid for all ESP32-C6 boards
30+
* @{
31+
*/
32+
#if CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 20
33+
# define CONFIG_ZTIMER_USEC_ADJUST_SET 134
34+
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 139
35+
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 40
36+
# define CONFIG_ZTIMER_USEC_ADJUST_SET 33
37+
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 34
38+
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 80
39+
# define CONFIG_ZTIMER_USEC_ADJUST_SET 18
40+
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 18
41+
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 120
42+
# define CONFIG_ZTIMER_USEC_ADJUST_SET 12
43+
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 13
44+
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 160
45+
# define CONFIG_ZTIMER_USEC_ADJUST_SET 11
46+
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 10
47+
#else
48+
# error "Invalid CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ value"
49+
#endif
50+
/** @} */
51+
52+
#endif /* !DOXYGEN */
53+
54+
#ifdef __cplusplus
55+
} /* end extern "C" */
56+
#endif
57+
58+
/** @} */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Gunar Schorcht
3+
* SPDX-License-Identifier: LGPL-2.1-only
4+
*/
5+
6+
#pragma once
7+
8+
/**
9+
* @ingroup boards_common_esp32c6
10+
* @brief Common peripheral configurations for ESP32-C6 boards
11+
*
12+
* This file contains the peripheral configurations that are valid for all
13+
* ESP32-C6 boards.
14+
*
15+
* For detailed information about the peripheral configuration for ESP32-C6
16+
* boards, see section \ref esp32_peripherals "Common Peripherals".
17+
*
18+
* @author Gunar Schorcht <[email protected]>
19+
* @file
20+
* @{
21+
*/
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
/**
28+
* @name UART configuration
29+
* @{
30+
*/
31+
#ifndef UART0_TXD
32+
# define UART0_TXD (GPIO16) /**< TxD of UART_DEV(0) used on all ESP32-C6 boards */
33+
#endif
34+
35+
#ifndef UART0_RXD
36+
# define UART0_RXD (GPIO17) /**< RxD of UART_DEV(0) used on all ESP32-C6 boards */
37+
#endif
38+
/** @} */
39+
40+
#ifdef __cplusplus
41+
} /* end extern "C" */
42+
#endif
43+
44+
/** @} */

boards/common/esp32x/include/board_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
# include "board_common_esp32.h"
3636
#elif defined(CPU_FAM_ESP32C3)
3737
# include "board_common_esp32c3.h"
38+
#elif defined(CPU_FAM_ESP32C6)
39+
# include "board_common_esp32c6.h"
3840
#elif defined(CPU_FAM_ESP32H2)
3941
# include "board_common_esp32h2.h"
4042
#elif defined(CPU_FAM_ESP32S2)

boards/common/esp32x/include/periph_conf_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
# include "periph_conf_common_esp32.h"
2525
#elif defined(CPU_FAM_ESP32C3)
2626
# include "periph_conf_common_esp32c3.h"
27+
#elif defined(CPU_FAM_ESP32C6)
28+
# include "periph_conf_common_esp32c6.h"
2729
#elif defined(CPU_FAM_ESP32H2)
2830
# include "periph_conf_common_esp32h2.h"
2931
#elif defined(CPU_FAM_ESP32S2)

0 commit comments

Comments
 (0)