tools: kwboot: Allow to specify custom baudrate only in supported operations
PATCH 1/1 tools: kwboot: Allow to specify custom baudrate only in supported operations
Custom baudrate different than 115200 may be specified only when kwboot is not going to send boot/debug message pattern or when it is going to send boot message pattern with image file (in which case baudrate change happens after sending kwbimage header). BootROM detects boot/debug message pattern only at baudrate 115200.
--- tools/kwboot.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/kwboot.c +4 -0
@@ -2128,6 +2128,10 @@ main(int argc, char **argv)if (!bootmsg && !term && !debugmsg && !imgpath) goto usage; +/* boot and debug message use baudrate 115200 */ +if (((bootmsg && !imgpath) || debugmsg) && baudrate !=115200 ) + goto usage; + ttypath = argv[optind++];if (optind != argc)
Signature · 1 line
2.20.1
Quoted 16 lines · On Sun, 6 Mar 2022 13:38:30 +0100 Pali Rohár <[email protected]> wrote:
Custom baudrate different than 115200 may be specified only when kwboot is not going to send boot/debug message pattern or when it is going to send boot message pattern with image file (in which case baudrate change happens after sending kwbimage header). BootROM detects boot/debug message pattern only at baudrate 115200.
Signed-off-by Pali Rohár <[email protected]>--- tools/kwboot.c | 4 ++++ 1 file changed, 4 insertions(+)tools/kwboot.c +0
-0
tools/kwboot.c main(int argc, char **argv) · line 2133
Quoted 6 lines
tools/kwboot.c +3
-0@@ -2128,6 +2128,10 @@ main(int argc, char **argv)if (!bootmsg && !term && !debugmsg && !imgpath) goto usage; +/* boot and debug message use baudrate 115200 */ +if (((bootmsg && !imgpath) || debugmsg) && baudrate !=115200 ) + goto usage;
Maybe this should print an actual error message describing the problem? Otherwise the user might not understand why they are getting usage...
Marek
Quoted 22 lines · Marek Behún
Quoted 19 lines · On Sun, 6 Mar 2022 13:38:30 +0100 Pali Rohár <[email protected]> wrote:
Custom baudrate different than 115200 may be specified only when kwboot is not going to send boot/debug message pattern or when it is going to send boot message pattern with image file (in which case baudrate change happens after sending kwbimage header). BootROM detects boot/debug message pattern only at baudrate 115200.
Signed-off-by Pali Rohár <[email protected]>--- tools/kwboot.c | 4 ++++ 1 file changed, 4 insertions(+)tools/kwboot.c +0
-0@@ -2128,6 +2128,10 @@ main(int argc, char **argv)if (!bootmsg && !term && !debugmsg && !imgpath) goto usage;
Quoted 6 lines
tools/kwboot.c main(int argc, char **argv) · line 2133
Quoted 3 lines
tools/kwboot.c +3
-0+/* boot and debug message use baudrate 115200 */ +if (((bootmsg && !imgpath) || debugmsg) && baudrate !=115200 ) + goto usage;Maybe this should print an actual error message describing the problem? Otherwise the user might not understand why they are getting usage...
I agree. Such more detailed infos are always helpful.
Thanks,
Stefan