Fix baudrate logic when using SRAM mode
Signed-off-by: Huang Rui <vowstar@gmail.com>pull/27/head
parent
7a1669540c
commit
27e3a44e35
|
@ -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
|
||||
------------
|
||||
|
|
13
kflash.py
13
kflash.py
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue