ESP8266_RTOS_SDK串口输出乱码
-
- Posts: 10
- Joined: Sun Jan 03, 2016 12:57 pm
ESP8266_RTOS_SDK串口输出乱码
Postby Nicholas3388 » Sun Jan 03, 2016 4:13 pm
-
- Posts: 10
- Joined: Sun Jan 03, 2016 12:57 pm
Re: ESP8266_RTOS_SDK串口输出乱码
Postby Nicholas3388 » Wed Jan 06, 2016 10:41 pm
Espressif_Faye wrote:您好,
ESP8266 的默认波特率为 74880,您提到的乱码是否由于波特率不匹配造成的?
您可以参考 uart.c 自行在代码中将波特率设置为 115200 或其他。
感谢您对 ESP8266 的关注!
你好,我将uart.c中uart_init_new里的波特率改为BIT_RATE_9600后还是出现乱码,还有其他的原因吗
-
- Posts: 10
- Joined: Sun Jan 03, 2016 12:57 pm
Re: ESP8266_RTOS_SDK串口输出乱码
Postby Nicholas3388 » Wed Jan 06, 2016 10:58 pm
Espressif_Faye wrote:您好,
ESP8266 的默认波特率为 74880,您提到的乱码是否由于波特率不匹配造成的?
您可以参考 uart.c 自行在代码中将波特率设置为 115200 或其他。
感谢您对 ESP8266 的关注!
编译生成的eagle.flash.bin,eagle.irom0text.bin,以及blank.bin的烧写地址为0x00000,0x40000, 0x7E000,这些地址有问题吗
-
- Posts: 10
- Joined: Sun Jan 03, 2016 12:57 pm
Re: ESP8266_RTOS_SDK串口输出乱码
Postby Nicholas3388 » Sun Jan 10, 2016 10:53 am
Espressif_Faye wrote:您好,
您的烧录看起来正确,您可以换块板子试一下吗?
或者提供您的测试程序,我们将进行测试验证。
你好,换了块板子也还是输出乱码。程序在附件中,能帮看看吗,谢了

- Attachments
-
- ESP8266_RTOS_SDK-master.rar
- (2.76 MiB) Downloaded 895 times
Re: ESP8266_RTOS_SDK串口输出乱码
Postby ESP_Faye » Mon Jan 11, 2016 4:30 pm
请注意,启动打印信息是 ROM code 中的,默认波特率为 74880,无法修改。
您只能修改应用程序中的打印信息波特率,可以参考如下代码:
Code: Select all
void wifiEventHandler(System_Event_t * event)
{
switch (event->event_id)
{
case EVENT_STAMODE_CONNECTED:
{
printf("WIFI Connected\n");
break;
}
case EVENT_STAMODE_GOT_IP:
{
struct ip_info hostInfo;
wifi_get_ip_info(STATION_IF, &hostInfo);
// IP Success
os_printf("Ip Addr: " IPSTR "\n", IP2STR(&hostInfo.ip));
os_printf("Netmask: " IPSTR "\n", IP2STR(&hostInfo.netmask));
os_printf("Gateway: " IPSTR "\n", IP2STR(&hostInfo.gw));
break;
}
case EVENT_STAMODE_DISCONNECTED:
{
printf("WIFI Disconnected\n");
break;
}
case EVENT_STAMODE_SCAN_DONE:
{
printf("WIFI Scan Done\n");
// TODO: Send Notification to Scanning Task
break;
}
case EVENT_STAMODE_DHCP_TIMEOUT:
{
printf("WIFI Error Retrieving IP\n");
// TODO: Send Notification to error handling task
break;
}
case EVENT_SOFTAPMODE_STACONNECTED:
{
// Send Station Discovery Packet
printf("AP Device Connected\n");
// TODO: Send notification to connected station task with station's IP
break;
}
}
}
void startWifiClient(void)
{
wifi_set_opmode(STATION_MODE);
struct station_config stationConfig =
{
.ssid = "SSID",
.password = "password"
};
wifi_station_set_config(&stationConfig);
}
/**
* Main Startup
*/
void ICACHE_FLASH_ATTR user_init(void)
{
// Serial Configuration
UART_SetBaudrate(0, BIT_RATE_115200);
// WIFI Configuration
wifi_set_event_handler_cb(wifiEventHandler);
// Start Client
startWifiClient();
}
Re: ESP8266_RTOS_SDK串口输出乱码
Postby wenhui_1 » Mon Jun 27, 2016 5:02 pm
gen_misc.sh version 20150911
SDK_PATH:
/home/wenhui/espressif/ESP8266_RTOS_SDK-1.4.0
BIN_PATH:
/home/wenhui/espressif/ESP8266_IOT_PLATFORM-master/bin
Please check SDK_PATH & BIN_PATH, enter (Y/y) to continue:
y
Please follow below steps(1-5) to generate specific bin(s):
STEP 1: use boot_v1.2+ by default
boot mode: new
STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
enter (0/1/2, default 0):
ignore boot
generate bin: eagle.flash.bin+eagle.irom0text.bin
STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
enter (0/1/2/3, default 2):
spi speed: 40 MHz
STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 0):
spi mode: QIO
STEP 5: choose spi size and map
0= 512KB( 256KB+ 256KB)
2=1024KB( 512KB+ 512KB)
3=2048KB( 512KB+ 512KB)
4=4096KB( 512KB+ 512KB)
5=2048KB(1024KB+1024KB)
6=4096KB(1024KB+1024KB)
enter (0/2/3/4/5/6, default 0):
4
...
!!!
SDK_PATH: /home/wenhui/espressif/ESP8266_RTOS_SDK-1.4.0
BIN_PATH: /home/wenhui/espressif/ESP8266_IOT_PLATFORM-master/bin
No boot needed.
Generate eagle.flash.bin and eagle.irom0text.bin successully in BIN_PATH
eagle.flash.bin-------->0x00000
eagle.irom0text.bin---->0x20000
!!!
...
这个问题也困扰了我3天
编译后提示的是烧写到0x20000地址而不是0x40000 地址
(烧写到0x40000 不打印乱码 也不打印其他信息)
我的解决方法是在
void user_init(void)
{
UART_SetBaudrate(0, BIT_RATE_115200); //添加
...
然后把地址设为
0x00000 0x20000 0x7E000
之后板子正常打印了
captdns stack 42, heap 24832
configing...
configing...
configing...
configing...
configing...
-
- Posts: 1
- Joined: Mon Jun 25, 2018 5:45 pm
Re: ESP8266_RTOS_SDK串口输出乱码
Postby 86xiaonazi » Mon Jun 25, 2018 5:52 pm
Who is online
Users browsing this forum: No registered users and 135 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.