* [PATCH] Fix the options and protocols used by the loadx command.
@ 2014-05-08 20:36 Owen Kirby
2014-05-09 6:39 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Owen Kirby @ 2014-05-08 20:36 UTC (permalink / raw)
To: barebox
From 3cd970250ff17ac406e46e18ebb26aa35949d1db Mon Sep 17 00:00:00 2001
From: Owen Kirby <osk@exegin.com>
Date: Thu, 8 May 2014 13:27:11 -0700
Subject: [PATCH] Fix the options and protocols used by the loadx command.
It seems like the loadx command was improperly copy/pasted from the loady
implementation, and was trying to load files using the ymodem protocol. This
patch should fix the command so that it uses xmodem, implements the -t option
and outputs the correct baudrate being used.
Signed-off-by: Owen Kirby <osk@exegin.com>
---
commands/loadxy.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/commands/loadxy.c b/commands/loadxy.c
index 7a91286..e023468 100644
--- a/commands/loadxy.c
+++ b/commands/loadxy.c
@@ -156,7 +156,7 @@ static int do_loadx(int argc, char *argv[])
char *output_file = NULL, *cname = NULL;
struct console_device *cdev = NULL;
- while ((opt = getopt(argc, argv, "f:b:o:c")) > 0) {
+ while ((opt = getopt(argc, argv, "f:b:t:o:c")) > 0) {
switch (opt) {
case 'f':
output_file = optarg;
@@ -211,12 +211,12 @@ static int do_loadx(int argc, char *argv[])
}
current_baudrate = console_change_speed(cdev, load_baudrate);
- printf("## Ready for binary (X-Modem) download "
+ printf("## Ready for binary (xmodem) download "
"to 0x%08lX offset on %s device at %d bps...\n", offset,
- output_file, load_baudrate);
- rcode = do_load_serial_ymodem(cdev);
+ output_file, load_baudrate ? load_baudrate : current_baudrate);
+ rcode = do_load_serial_xmodem(cdev, ofd);
if (rcode < 0) {
- printf("## Binary (kermit) download aborted (%d)\n", rcode);
+ printf("## Binary (xmodem) download aborted (%d)\n", rcode);
rcode = 1;
}
console_change_speed(cdev, current_baudrate);
--
1.7.9.5
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix the options and protocols used by the loadx command.
2014-05-08 20:36 [PATCH] Fix the options and protocols used by the loadx command Owen Kirby
@ 2014-05-09 6:39 ` Sascha Hauer
2014-05-09 23:07 ` Owen Kirby
0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2014-05-09 6:39 UTC (permalink / raw)
To: Owen Kirby; +Cc: barebox
Hi Owen,
On Thu, May 08, 2014 at 01:36:14PM -0700, Owen Kirby wrote:
> From 3cd970250ff17ac406e46e18ebb26aa35949d1db Mon Sep 17 00:00:00 2001
> From: Owen Kirby <osk@exegin.com>
> Date: Thu, 8 May 2014 13:27:11 -0700
> Subject: [PATCH] Fix the options and protocols used by the loadx command.
>
> It seems like the loadx command was improperly copy/pasted from the loady
> implementation, and was trying to load files using the ymodem protocol. This
> patch should fix the command so that it uses xmodem, implements the -t option
> and outputs the correct baudrate being used.
>
> Signed-off-by: Owen Kirby <osk@exegin.com>
I'm always surprised to still see patches to the serial download
protocols. I hardly ever use them. Anyway, patch looks good, so:
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix the options and protocols used by the loadx command.
2014-05-09 6:39 ` Sascha Hauer
@ 2014-05-09 23:07 ` Owen Kirby
0 siblings, 0 replies; 3+ messages in thread
From: Owen Kirby @ 2014-05-09 23:07 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 14-05-08 11:39 PM, Sascha Hauer wrote:
> Hi Owen,
>
> On Thu, May 08, 2014 at 01:36:14PM -0700, Owen Kirby wrote:
>> From 3cd970250ff17ac406e46e18ebb26aa35949d1db Mon Sep 17 00:00:00 2001
>> From: Owen Kirby <osk@exegin.com>
>> Date: Thu, 8 May 2014 13:27:11 -0700
>> Subject: [PATCH] Fix the options and protocols used by the loadx command.
>>
>> It seems like the loadx command was improperly copy/pasted from the loady
>> implementation, and was trying to load files using the ymodem protocol. This
>> patch should fix the command so that it uses xmodem, implements the -t option
>> and outputs the correct baudrate being used.
>>
>> Signed-off-by: Owen Kirby <osk@exegin.com>
> I'm always surprised to still see patches to the serial download
> protocols. I hardly ever use them. Anyway, patch looks good, so:
> Applied, thanks
>
> Sascha
>
Old protocols never die :)
I'm not yet sure that I want to use xmodem over DFU just yet, but it
seemed like an obvious bug.
Cheers,
Owen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-09 23:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-08 20:36 [PATCH] Fix the options and protocols used by the loadx command Owen Kirby
2014-05-09 6:39 ` Sascha Hauer
2014-05-09 23:07 ` Owen Kirby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox