Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/esp8266: complete reimplementation based on ESP8266 RTOS SDK #11108

Merged
merged 20 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
464bb9f
cpu/esp8266: vendor files that are no longer needed removed
gschorcht Sep 5, 2019
a6d01fc
cpu/esp8266: vendor files changed for RTOS SDK
gschorcht Sep 5, 2019
dca6d59
cpu/esp_common: vendor files changed for RTOS SDK
gschorcht Sep 5, 2019
f397a74
cpu/esp8266: FreeRTOS adaption layer added for RTOS SDK
gschorcht Sep 5, 2019
28ea0a0
cpu/esp8266: required vendor RTOS SDK components added
gschorcht Sep 5, 2019
a212228
cpu/esp8266: files that are not needed any longer removed
gschorcht Sep 5, 2019
074369f
pkg/lwip: changes for ESP8266 esp_wifi
gschorcht Sep 5, 2019
ddc91df
cpu/esp8266: changes for RTOS SDK
gschorcht Sep 5, 2019
7d9a3a7
boards/esp8266: changes for RTOS SDK
gschorcht Sep 5, 2019
e5b7645
boards/esp32: changes for RTOS SDK
gschorcht Sep 5, 2019
4f4d882
cpu/esp32: changes for RTOS SDK
gschorcht Sep 5, 2019
afa0204
cpu/esp8266: required bootloader binaries
gschorcht Oct 16, 2019
9facce8
cpu/esp8266: use default number of priority levels
gschorcht Oct 17, 2019
b15d7df
cpu/esp8266: ESP8266_SDK_DIR renamed
gschorcht Oct 18, 2019
2c7b9b4
cpu/esp8266: toolchain renamed
gschorcht Oct 18, 2019
405be02
cpu/esp8266: funcs must not be called in assert
gschorcht Oct 22, 2019
6292276
cpu/esp8266: high-priority threads creation
gschorcht Oct 22, 2019
fe02845
cpu/esp8266: esptool.py is provided as tool
gschorcht Oct 25, 2019
309eab9
cpu/esp8266: enable colored output with log_color
gschorcht Nov 10, 2019
555a704
cpu/esp8266: reset tool to allow automatic tests
gschorcht Nov 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions boards/common/esp32/include/periph_conf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static const gpio_t pwm1_channels[] = PWM1_GPIOS;
*/

/**
* @brief Static array with configuration for declared I2C devices
* @brief Static array with configuration for declared SPI devices
*/
static const spi_conf_t spi_config[] = {
#ifdef SPI0_CTRL
Expand Down Expand Up @@ -220,7 +220,7 @@ static const spi_conf_t spi_config[] = {
#endif

/**
* @brief Static array with configuration for declared I2C devices
* @brief Static array with configuration for declared UART devices
*/
static const uart_conf_t uart_config[] = {
{
Expand Down Expand Up @@ -249,13 +249,7 @@ static const uart_conf_t uart_config[] = {
*
* @note UART_NUMOF definition must not be changed.
*/
#if defined(UART1_TXD) && defined(UART1_RXD) && defined(UART2_TXD) && defined(UART2_RXD)
#define UART_NUMOF 3
#elif (defined(UART1_TXD) && defined(UART1_RXD)) || (defined(UART2_TXD) && defined(UART2_RXD))
#define UART_NUMOF 2
#else
#define UART_NUMOF 1
#endif
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions boards/common/esp8266/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_uart_modecfg
4 changes: 2 additions & 2 deletions boards/common/esp8266/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
include $(RIOTMAKE)/tools/serial.inc.mk

# reset tool configuration
RESET ?= esptool.py
RESET_FLAGS ?= --port $(PROG_DEV) --before default_reset run
RESET ?= $(RIOTTOOLS)/esptool/espreset.py
RESET_FLAGS ?= --port $(PROG_DEV)
53 changes: 45 additions & 8 deletions boards/common/esp8266/board_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
* @author Gunar Schorcht <gunar@schorcht.net>
*/

#include "board_common.h"
#include "board.h"
#include "esp_common.h"
#include "log.h"
#include "periph/gpio.h"
#include "esp_libc.h"
#include "rom/ets_sys.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -40,35 +43,69 @@ void board_init(void)
#endif
}

extern void adc_print_config(void);
extern void dac_print_config(void);
extern void pwm_print_config(void);
extern void i2c_print_config(void);
extern void spi_print_config(void);
extern void uart_print_config(void);
extern void timer_print_config(void);
extern void can_print_config(void);

void board_print_config (void)
{
LOG_INFO("\nBoard configuration:\n");
ets_printf("\nBoard configuration:\n");

#if MODULE_PERIPH_ADC
adc_print_config();
#endif
#if MODULE_PERIPH_DAC
dac_print_config();
#endif
#if MODULE_PERIPH_PWM
pwm_print_config();
#endif
#if MODULE_PERIPH_I2C
i2c_print_config();
#endif
#if MODULE_PERIPH_SPI
spi_print_config();
#endif
#if MODULE_PERIPH_UART
uart_print_config();
#endif
#if MODULE_PERIPH_TIMER
timer_print_config();
#endif
#ifdef MODULE_ESP_CAN
can_print_config();
#endif

LOG_INFO("\tLED: pins=[ ");
ets_printf("\tLED\t\tpins=[ ");
#ifdef LED0_PIN
LOG_INFO("%d ", LED0_PIN);
ets_printf("%d ", LED0_PIN);
#endif
#ifdef LED1_PIN
LOG_INFO("%d ", LED1_PIN);
ets_printf("%d ", LED1_PIN);
#endif
#ifdef LED2_PIN
LOG_INFO("%d ", LED2_PIN);
ets_printf("%d ", LED2_PIN);
#endif
ets_printf("]\n");

ets_printf("\tBUTTON\t\tpins=[ ");
#ifdef BUTTON0_PIN
ets_printf("%d ", BUTTON0_PIN);
#endif
#ifdef BUTTON2_PIN
ets_printf("%d ", BUTTON1_PIN);
#endif
#ifdef BUTTON3_PIN
ets_printf("%d ", BUTTON2_PIN);
#endif
LOG_INFO("]\n");
ets_printf("]\n");

LOG_INFO("\n\n");
ets_printf("\n");
}

#ifdef __cplusplus
Expand Down
6 changes: 5 additions & 1 deletion boards/common/esp8266/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* @{
*/

/* not required when compiling ESP vendor code parts */
#ifndef ESP_PLATFORM

#include <stdint.h>

#include "cpu.h"
Expand Down Expand Up @@ -124,7 +127,7 @@ extern mtd_dev_t *mtd0;
* initializations are done during the CPU initialization that is called from
* boot loader.
*/
extern void board_init(void);
void board_init (void);

/**
* @brief Print the board configuration in a human readable format
Expand All @@ -140,4 +143,5 @@ void board_print_config (void);

/** @} */

#endif /* ESP_PLATFORM */
#endif /* BOARD_COMMON_H */
26 changes: 13 additions & 13 deletions boards/common/esp8266/include/board_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ extern "C" {
#define ENC28J60_PARAM_SPI SPI_DEV(0) /**< SPI_DEV(0) is used (fixed) */

#ifndef ENC28J60_PARAM_CS
#define ENC28J60_PARAM_CS GPIO4 /**< ENC28J60 CS signal (can be overriden) */
#define ENC28J60_PARAM_CS GPIO4 /**< ENC28J60 CS signal (can be overridden) */
#endif
#ifndef ENC28J60_PARAM_INT
#define ENC28J60_PARAM_INT GPIO9 /**< ENC28J60 INT signal (can be overriden) */
#define ENC28J60_PARAM_INT GPIO9 /**< ENC28J60 INT signal (can be overridden) */
#endif
#ifndef ENC28J60_PARAM_RESET
#define ENC28J60_PARAM_RESET GPIO10 /**< ENC28J60 RESET signal (can be overriden) */
#define ENC28J60_PARAM_RESET GPIO10 /**< ENC28J60 RESET signal (can be overridden) */
#endif
/** @} */
#endif /* defined(MODULE_ENC28J60) || defined(DOXYGEN) */
Expand All @@ -82,16 +82,16 @@ extern "C" {
#define MRF24J40_PARAM_SPI SPI_DEV(0) /**< SPI_DEV(0) is used (fixed) */

#ifndef MRF24J40_PARAM_SPI_CLK
#define MRF24J40_PARAM_SPI_CLK SPI_CLK_1MHZ /**< SPI bus speed used (can be overriden) */
#define MRF24J40_PARAM_SPI_CLK SPI_CLK_1MHZ /**< SPI bus speed used (can be overridden) */
#endif
#ifndef MRF24J40_PARAM_CS
#define MRF24J40_PARAM_CS GPIO16 /**< MRF24J40 CS signal (can be overriden) */
#define MRF24J40_PARAM_CS GPIO16 /**< MRF24J40 CS signal (can be overridden) */
#endif
#ifndef MRF24J40_PARAM_INT
#define MRF24J40_PARAM_INT GPIO0 /**< MRF24J40 INT signal (can be overriden) */
#define MRF24J40_PARAM_INT GPIO0 /**< MRF24J40 INT signal (can be overridden) */
#endif
#ifndef MRF24J40_PARAM_RESET
#define MRF24J40_PARAM_RESET GPIO2 /**< MRF24J40 RESET signal (can be overriden) */
#define MRF24J40_PARAM_RESET GPIO2 /**< MRF24J40 RESET signal (can be overridden) */
#endif
/** @} */
#endif /* defined(MODULE_MRF24J40) || defined(DOXYGEN) */
Expand All @@ -109,14 +109,14 @@ extern "C" {
* If not defined, the default CS signal of SPI_DEV(0) is used.
* @{
*/
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0) /**< SPI_DEV(0) is used (fixed) */
#define SDCARD_SPI_PARAM_CLK SPI0_SCK_GPIO /**< SPI_DEV(0) SCK is used (fixed) */
#define SDCARD_SPI_PARAM_MOSI SPI0_MOSI_GPIO /**< SPI_DEV(0) MOSI is used (fixed) */
#define SDCARD_SPI_PARAM_MISO SPI0_MISO_GPIO /**< SPI_DEV(0) MISO is used (fixed) */
#define SDCARD_SPI_PARAM_POWER GPIO_UNDEF /**< power control is not used (fixed) */
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0) /**< SPI_DEV(0) is used (fixed) */
#define SDCARD_SPI_PARAM_CLK SPI0_SCK /**< SPI_DEV(0) SCK is used (fixed) */
#define SDCARD_SPI_PARAM_MOSI SPI0_MOSI /**< SPI_DEV(0) MOSI is used (fixed) */
#define SDCARD_SPI_PARAM_MISO SPI0_MISO /**< SPI_DEV(0) MISO is used (fixed) */
#define SDCARD_SPI_PARAM_POWER GPIO_UNDEF /**< power control is not used (fixed) */

#ifndef SDCARD_SPI_PARAM_CS
#define SDCARD_SPI_PARAM_CS SPI0_CS0_GPIO /**< SD-Card CS signal (can be overridden) */
#define SDCARD_SPI_PARAM_CS SPI0_CS0 /**< SD-Card CS signal (can be overridden) */
#endif
/** @} */
#endif /* defined(MODULE_SDCARD_SPI) || defined(DOXYGEN) */
Expand Down
Loading