avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] Patch to stk500v2 to support non-USB XPROG


From: Erik Walthinsen
Subject: [avrdude-dev] Patch to stk500v2 to support non-USB XPROG
Date: Tue, 10 Aug 2010 11:58:43 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

In developing a stk500v2 XPROG bootloader for my product, I ran into a problem with avrdude switching into the USB-only unframed version of the protocol after SIGN_ON. It does so because of an assumption that every stk500v2-xprog device will be communicating over USB. In my case I'm running over a serial link (and soon running that over a mutliplexed protocol), and the assumption is no longer correct.

I did a quick hack to the stk500v2.c code in order to make both cases work. Basically it adds a struct var 'bareproto', which is used to decide whether to send the stk500 commands framed or unframed, rather than the specific programmer type. The flag itself is set when the actual comms port is selected, and currently is only set if it's USB.

Being a quick hack I don't expect this patch to go anywhere itself. However, something like it should be put in place, since non-USB XPROG implementations are likely to show up (especially since I'll be releasing mine at some point soon...).

Likely a better way to implement it would be an avrdude.conf flag that would specifically set it to "framed-mode". Along those lines it would be nice to have some way to define programmers by their SIGN_ON responses. Since SIGN_ON is always sent in full stk500 framed mode no matter what, having avrdude check through the .conf for a string match (rather than hard-coded) and then picking up the "framed-mode" flag before continuing would make it easy to define new programmer types for bootloaders, etc.

Due to my development schedule I'm unable to do anything further on this at this point, but if it's still an issue when I have a bit more time, I'll see if I can give it a go.

Patch is attached, and I'll be filing it in the bug tracker in a couple minutes.

Attachment: stk500v2-bareproto.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]