AVRdude rebuilt with patch

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I'm not an expert with software building. But I'm looking for a tutorial that describes how to make an own built for avrdude.

I have an AVRispmkII from olimex and avrdude is not working on my windows 7 machine in combination with the XMEGA128A4U.

I notices the bug report, but I have no clue how to apply the patch and how to rebuilt avrdude 6.3 with the patch applied. Can somebody help me?

 

thx!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Windows or Linux? Latter should be trivial, former will make you weep blood!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First: While I have not built AVRDUDE on Windows I recently did so on Linux Mint. OTOH I have done e lot of other development work on Windows.. So what follows is a "vague extrapolation" based on those two experiences:

 

You need a C/C++ tool chain that runs on, and targets, Windows. I assume it should be GCC. You can get that, and the eco-system it can work in, by installing MinGW (Minimal GNU for Windows), probably including (or amended by) MSYS. It's been too long since I did set up a MinGW environment on Windows, so I'll direct you to the MinGW wiki for this. WithMinGW/MSYS in place you can attempt an actual build. 

 

AVRDUDE uses the GNU build system ("Autotools"). I.e. it comes with a configure script that, when run, will probe the system for functionality needed/supported and create a makefile. Thiss makefile can be used to do the build.

 

Looking in my notes from my build on Linux it goes like this:

 

First, in the root of the source tree

 

prompt> ./configure

to create the makefile. Keep a lookout for reports of errors or things missing. You'll have to fix any of those before proceeding. (On my Mint I had a lot of library stuff missing that I had to d/l and install at this stage).

 

After that the actual build is accomplished by this:

 

prompt> make

 

As for how to apply the patch, it depends on what form this patch has. If it is a .patch (or .diff (?)) file then you apply it by using the patch command.

 

Also note this terse stuff in the AVRDUDE docs on building on Windows: http://www.nongnu.org/avrdude/us... . It focuses on using Cygwin, which I (for possibly biased reasons) discourage. Alas, the note on the alternative ("use MinGW/MSYS directly") is not fleshed out in any detail.

 


 

If you tell us more about the problem with current AVRDUDE and the ATXmega128A4U we might be able to toss in some detailed advice. It could be that it is only a matter of patching the config file of AVRDUDE, not the executable as such. If you actually link to the bug-report/patch you are hinting at things might become clearer.

 

 

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wish to apply this patch in order to get it to work. http://savannah.nongnu.org/bugs/...

I have cygwin installed. Further steps are unknown for me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MathieuMH wrote:
I have cygwin installed.

Is the GCC tool chain in good working order? What happens if you simply type

gcc --version

on a command line?

 

Note the remark in the AVRDUDE doc page I linked to above that says

 recent versions of Cygwin (starting with 1.7) removed the MinGW support from the compiler that is needed in order to build a native Win32 API binary that does not require to install the Cygwin library cygwin1.dll at run-time

This might, or might not, be something that will influence your descision on if to use Cygwin or "use MinGW directly". Main difference, as I understand it is that building with Cygwin requires the Cygwin1.dll present when running the program while building directly with MinGW/MSYS does not.

 

MathieuMH wrote:
Further steps are unknown for me.

The patch you want to apply is actually a .patch file, so the patch command should be used. Any manpage should tell you how to use the patch command, e.g. https://linux.die.net/man/1/patch .

 

As for the build, I would hope that the aforementioned steps should suffice, e.g.

 

./configure

make

 


 

As I hinted at above I am not a fan of Cygwin, but use MinGW/MSYS without groaning too much. I'm sorry I thus can't help you more explicitly with Cygwin. Let us know if you go down the "direct MinGW/MSYS" route. I believe I still have MinGW/MSYS installed on my Windows 7 system and might  be able to follow/help you with the build.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MathieuMH wrote:
I have cygwin installed. Further steps are unknown for me.

http://download.savannah.gnu.org/releases/avrdude/avrdude-doc-6.3.pdf

(page 39)

There are two options to build avrdude from source under Windows.

(Cygwin + MinGW, MinGW)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

@gchapman: Same text as I linked to in my first post.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For reason I don't recall I have the Cygwin on my system. I recall something on Msys or MinGW. I just don't know if it is still installed. This is also done through the Cygwin right? Both path are possible for me. I'm just looking for the most efficient way to get a complied version of avrdude for windows with the patch included.

 

FYI: GCC is working.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, JohanEkdahl brought MinGW to my attention. Therefor I started looking on the internet. I found this guide to compile avrdude.

 

http://tomeko.net/other/avrdude/...

 

Using this command I applied the patch.

patch < endpointdetect_pass1.patch

Unfortunatly the make failed with the following response which leaves me clueless.

make[2]: *** [libavrdude_a-lexer.o] Error 1
make[2]: *** Leaving directory '/c/MinGW/msys/1.0/home/hebbrem/avrdude-6.3'
make[1]: *** [all-recursive] Error 1
make[1]: *** Leaving directory '/c/MinGW/msys/1.0/home/hebbrem/avrdude-6.3'
make: *** [all] Error 2

Any suggestions?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MathieuMH wrote:
Any suggestions?
Work further back up the output - that final error is the consequence, not the reason.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oke, I'll try to be more complete. There seems to be an issue is the usleep instance.

Bellow a screenshot of the whole result of the make command.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Apparently nothing in this life is ever really new. That was happening back in 2008 (9 years go) too...

 

https://lists.gnu.org/archive/ht...

 

EDIT: The curious thing though is back then the fix was:

-void usleep(unsigned long us);
+int usleep(unsigned int us);

yet this now seems to be the cause of the error. Sounds a lot like a 32 bit versus 64 bit thing to me.

 

(which is EXACTLY why God invented stdint.h). You might want to determine how your headers define useconds_t I guess.

 

EDIT2: apparently useconds_t is in <sys/types.h>. I guess you need to modify the .h in avrdude source to match.

 

One day someone will push a change to avrdude source to remove use of nasty things like "int".

Last Edited: Fri. Sep 29, 2017 - 11:08 AM