loboris / MicroPython_K210_LoBo

MicroPython implementation for Kendryte K210
128 stars 24 forks source link

WiFi "Error setting baudrate" #15

Open CorruptName opened 4 years ago

CorruptName commented 4 years ago

After successfully flashing the provided firmware, When I try to connect with this error. Sipeed Dock M1W with ESP8285

>>> import network
>>> wifi = network.wifi
>>> wifi.reset()
>>> wifi.debug(True)
True
>>> wifi.reset()
>>> import _thread, network, time, machine, socket, gc, os
>>> wifi.start(tx=7, rx=6, ssid="SSID", password="PASS", baudrate=921600, wait=True)
M (10359821780) [WIFI]: Initialize WiFi UART
M (10359825780) [WIFI]: UART #0: initialize uart hardware
M (10359856677) [WIFI]: UART #0: initialized, tx=7, rx=6, bdr=921641
M (10359882693) [WIFI]: WiFi TASK STARTED
M (10359985755) [ATCMD]: Check and set device baudrate
W (10360626108) [ATCMD]: Trying at 115200 bd
W (10361316499) [ATCMD]: Trying at 230400 bd
W (10362006892) [ATCMD]: Trying at 460800 bd
W (10362697281) [ATCMD]: Trying at 1000000 bd
W (10363387678) [ATCMD]: Trying at 2000000 bd
E (10364076089) [ATCMD]: Error setting baudrate
M (10364080371) [WIFI]: UART #0 deinitialized
M (10364085209) [WIFI]: WiFi TASK TERMINATED
False

And here is log from flash:

./flash.sh -t 1MB -m dout

==========================
Flashing ESP8266 firmware:
--------------------------
  Flash type: 1MB
  Flash mode: dout
   Partition: 0
     Address: 0x001000
    Firmware: '../upgrade/esp8285_AT_1_2.bin'
 Erase Flash: 'yes'
================================================

esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting........_____....._____.
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 40MHz
MAC: 60:01:94:f0:8e:09
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 0.5s
Staying in bootloader.

esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 40MHz
MAC: 60:01:94:f0:8e:09
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 128 bytes to 75...
Wrote 128 bytes (75 compressed) at 0x000fc000 in 0.0 seconds (effective 51.4 kbit/s)...
Hash of data verified.
Flash params set to 0x0320
Compressed 4080 bytes to 2696...
Wrote 4080 bytes (2696 compressed) at 0x00000000 in 0.4 seconds (effective 74.2 kbit/s)...
Hash of data verified.
Compressed 1684 bytes to 1206...
Wrote 1684 bytes (1206 compressed) at 0x0007b000 in 0.2 seconds (effective 67.4 kbit/s)...
Hash of data verified.
Compressed 435876 bytes to 313593...
Wrote 435876 bytes (313593 compressed) at 0x00001000 in 50.4 seconds (effective 69.2 kbit/s)...
Hash of data verified.

Leaving...
Staying in bootloader.

Finished.

On a side note, The instructions should probably be updated or the flash.sh script fixed.. The instructions state that we should: Execute `./flash.sh -eo -t 1MB -m DOUT` to erase the existing firmware But when we get to: Execute `./flash.sh -t 1MB -m DOUT` to flash the new firmware This also causes erase first. That makes 2 erases before write. Also, During the second command, we are given a very brief window to reboot device while holding esp8285 boot pin to ground. This can be very tricky. I think that "flash.sh" should be fixed to not perform erase during write action.

Also, All of the steps in the instructions are "#1" lol.

Oh yea, And: ./flash.sh -eo -t 1MB -m DOUT should be replaced with: ./flash.sh -eo -t 1MB -m dout Since it will fail with capitals.