pfalcon / yaota8266

Yet another OTA solution for ESP8266, this time supporting large (>512KB) firmwares even on 1MB devices (repo is rebased)
120 stars 33 forks source link

boot8266, etc. use default baud rate (74880) #2

Closed pfalcon closed 7 years ago

pfalcon commented 7 years ago

Currently, boot8266 and ota-server don't initialize UART, so it works with UART as initialized by BootROM, in particular, uses 74880 baud rate.

pfalcon commented 7 years ago

Currently, this is considered a feature to trace entire boot process from BootROM and up. I actually apply following patch to uPy:

--- a/esp8266/esp_mphal.c
+++ b/esp8266/esp_mphal.c
@@ -44,7 +44,7 @@ const mp_print_t mp_debug_print = {NULL, mp_hal_debug_tx_strn_cooked};
 void mp_hal_init(void) {
     //ets_wdt_disable(); // it's a pain while developing
     mp_hal_rtc_init();
-    uart_init(UART_BIT_RATE_115200, UART_BIT_RATE_115200);
+    uart_init(UART_BIT_RATE_74880, UART_BIT_RATE_74880);
 }
pfalcon commented 7 years ago

Baud rate is now configurable in config.h and defaults to 115200. If set to 0, UART's baud rate won't be changed (so will stay at 74800), which is useful for debugging.