Fix baudrate logic when using SRAM mode

Signed-off-by: Huang Rui <vowstar@gmail.com>
pull/27/head
Huang Rui 2019-04-29 20:21:14 +08:00
parent 7a1669540c
commit 27e3a44e35
2 changed files with 10 additions and 9 deletions

View File

@ -75,14 +75,12 @@ For fast programming,
Execute user code directly in SRAM and view in serial terminal,
The baudrate is 115200, not download baudrate
.. code:: bash
# For `.elf` file
python3 kflash.py -b 4500000 -B goE -s -t hello_world
python3 kflash.py -b 115200 -B goE -s -t hello_world
# For `.bin` file
python3 kflash.py -b 4500000 -B goE -s -t hello_world.bin
python3 kflash.py -b 115200 -B goE -s -t hello_world.bin
Requirements
------------

View File

@ -1200,7 +1200,7 @@ if __name__ == '__main__':
print(INFO_MSG,"Greeting Message Detected, Start Downloading ISP",BASH_TIPS['DEFAULT'])
if manually_set_the_board and (not args.Slow):
if args.baudrate >= 1500000:
if (args.baudrate >= 1500000) or args.sram:
loader.change_baudrate_stage0(args.baudrate)
# 2. download bootloader and firmware
@ -1220,16 +1220,19 @@ if __name__ == '__main__':
# Boot the code from SRAM
loader.boot()
# Dangerous, here are dinosaur infested!!!!!
# Don't touch this code unless you know what you are doing
loader._port.baudrate = 115200
if args.sram:
# Dangerous, here are dinosaur infested!!!!!
# Don't touch this code unless you know what you are doing
loader._port.baudrate = args.baudrate
print(INFO_MSG,"Boot user code from SRAM", BASH_TIPS['DEFAULT'])
if(args.terminal == True):
open_terminal(False)
exit(0)
# Dangerous, here are dinosaur infested!!!!!
# Don't touch this code unless you know what you are doing
loader._port.baudrate = 115200
print(INFO_MSG,"Wait For 0.1 second for ISP to Boot", BASH_TIPS['DEFAULT'])
time.sleep(0.1)