mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-15 08:32:42 +08:00
feat(esp8266): Add configuration for UART baudrate
This commit is contained in:
@ -553,7 +553,6 @@ void __assert_func(const char *file, int line, const char *func, const char *exp
|
|||||||
#include "esp8266/pin_mux_register.h"
|
#include "esp8266/pin_mux_register.h"
|
||||||
#include "esp8266/rom_functions.h"
|
#include "esp8266/rom_functions.h"
|
||||||
|
|
||||||
#define CONFIG_CONSOLE_UART_BAUDRATE 74880
|
|
||||||
#define BOOTLOADER_CONSOLE_CLK_FREQ 52 * 1000 * 1000
|
#define BOOTLOADER_CONSOLE_CLK_FREQ 52 * 1000 * 1000
|
||||||
|
|
||||||
extern int _bss_start;
|
extern int _bss_start;
|
||||||
@ -575,8 +574,6 @@ static void uart_console_configure(void)
|
|||||||
CLEAR_PERI_REG_MASK(UART_CONF1(CONFIG_CONSOLE_UART_NUM), UART_RX_FLOW_EN);
|
CLEAR_PERI_REG_MASK(UART_CONF1(CONFIG_CONSOLE_UART_NUM), UART_RX_FLOW_EN);
|
||||||
CLEAR_PERI_REG_MASK(UART_CONF0(CONFIG_CONSOLE_UART_NUM), UART_TX_FLOW_EN);
|
CLEAR_PERI_REG_MASK(UART_CONF0(CONFIG_CONSOLE_UART_NUM), UART_TX_FLOW_EN);
|
||||||
|
|
||||||
uart_div_modify(CONFIG_CONSOLE_UART_NUM, BOOTLOADER_CONSOLE_CLK_FREQ / CONFIG_CONSOLE_UART_BAUDRATE);
|
|
||||||
|
|
||||||
WRITE_PERI_REG(UART_CONF0(CONFIG_CONSOLE_UART_NUM),
|
WRITE_PERI_REG(UART_CONF0(CONFIG_CONSOLE_UART_NUM),
|
||||||
0 // None parity
|
0 // None parity
|
||||||
| (1 << 4) // 1-bit stop
|
| (1 << 4) // 1-bit stop
|
||||||
@ -587,6 +584,8 @@ static void uart_console_configure(void)
|
|||||||
SET_PERI_REG_MASK(UART_CONF0(CONFIG_CONSOLE_UART_NUM), UART_RXFIFO_RST | UART_TXFIFO_RST);
|
SET_PERI_REG_MASK(UART_CONF0(CONFIG_CONSOLE_UART_NUM), UART_RXFIFO_RST | UART_TXFIFO_RST);
|
||||||
CLEAR_PERI_REG_MASK(UART_CONF0(CONFIG_CONSOLE_UART_NUM), UART_RXFIFO_RST | UART_TXFIFO_RST);
|
CLEAR_PERI_REG_MASK(UART_CONF0(CONFIG_CONSOLE_UART_NUM), UART_RXFIFO_RST | UART_TXFIFO_RST);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
uart_div_modify(CONFIG_CONSOLE_UART_NUM, BOOTLOADER_CONSOLE_CLK_FREQ / CONFIG_CONSOLE_UART_BAUDRATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t bootloader_init()
|
esp_err_t bootloader_init()
|
||||||
|
@ -52,6 +52,11 @@ config CONSOLE_UART_NUM
|
|||||||
default 0 if CONSOLE_UART_CUSTOM_NUM_0
|
default 0 if CONSOLE_UART_CUSTOM_NUM_0
|
||||||
default 1 if CONSOLE_UART_CUSTOM_NUM_1
|
default 1 if CONSOLE_UART_CUSTOM_NUM_1
|
||||||
|
|
||||||
|
config CONSOLE_UART_BAUDRATE
|
||||||
|
int "UART console baud rate"
|
||||||
|
default 74880
|
||||||
|
range 1200 4000000
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu WIFI
|
menu WIFI
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
gwen:
|
gwen:
|
||||||
core: 8ee40dd
|
core: b9f2d3e
|
||||||
net80211: eca7811
|
net80211: eca7811
|
||||||
pp: eca7811
|
pp: eca7811
|
||||||
smartconfig:eca7811
|
smartconfig:eca7811
|
||||||
|
Binary file not shown.
@ -30,7 +30,7 @@ void write_data_to_rtc(uint8_t *);
|
|||||||
|
|
||||||
void get_data_from_rtc(uint8_t *);
|
void get_data_from_rtc(uint8_t *);
|
||||||
|
|
||||||
uint8_t chip_init(uint8_t* init_data, uint8_t *mac);
|
uint8_t chip_init(uint8_t* init_data, uint8_t *mac, uint32_t uart_baudrate);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t *init_data, esp_phy_calibrat
|
|||||||
}
|
}
|
||||||
|
|
||||||
esp_efuse_mac_get_default(sta_mac);
|
esp_efuse_mac_get_default(sta_mac);
|
||||||
chip_init(local_init_data, sta_mac);
|
chip_init(local_init_data, sta_mac, CONFIG_CONSOLE_UART_BAUDRATE);
|
||||||
get_data_from_rtc((uint8_t *)calibration_data);
|
get_data_from_rtc((uint8_t *)calibration_data);
|
||||||
|
|
||||||
memcpy(rx_gain_dc_table, calibration_data->rx_gain_dc_table, 4 * 125);
|
memcpy(rx_gain_dc_table, calibration_data->rx_gain_dc_table, 4 * 125);
|
||||||
|
Reference in New Issue
Block a user