-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinAVR make failure, New Install #24
Comments
Sorry for my late response.
You issue most likely relates to missing (or incomplete) msys2 subsystem for your WinAVR. I think I remember there were some installations not working without this.
But I should have mention this first (but since it is not very helpful): it is best to throw away Windows and use Linux! ;-)
However if you still need more support, I can try to cross-compile you a more recent avr-gcc with current winavr?
BR S.Baerwolf
|
bearwolf, I would certainly appreciate your cross compile and thank you for the offer. I would be happy to return the favor and am open to your suggestions. I thought I downloaded the latest WinAVR. I like your Linux suggestion and have several Linux computers I use. Windows is still my daily driver as Linux is not quite there yet for my requirements. |
Hi again
I just threw a bunch of tools together and compiled an avr-gcc (based on binutils 2.42, gcc 13.3.0 plus most recent avr-libc) for winx64 (amd64) on my aarch64 Orange Pi 5 Plus.
It is completely untested since I do not own any Windows.
Perhaps you can report me back even if (in the very unlikely case) everything works fine.
Otherwise if you wish some modifications, please let me know.
https://www.file-upload.net/download-15386161/win64-avr-gcc-13.3.0.experimental.tar.xz.html
The sha256sum is:
d875e37ae9e76be1ac6f0179229b7eb9096942a997f4a55fe01bbaaf0023da49 win64-avr-gcc-13.3.0.experimental.tar.xz
BR S. Baerwolf
|
Here is another link for backup: https://file.io/d4gt8rezNIYG
|
Stephen,
Thank you so much! I will try this tomorrow morning and I will let you know either way.
The first link you sent worked fine, the second "backup" link reported as deleted. Not a problem for me, just giving you some feedback in case you are interested.
Peter
From: Stephan Baerwolf ***@***.***>
Sent: Tuesday, September 17, 2024 5:08 PM
To: baerwolf/USBaspLoader ***@***.***>
Cc: Peter House ***@***.***>; Author ***@***.***>
Subject: Re: [baerwolf/USBaspLoader] WinAVR make failure, New Install (Issue #24)
Hi again
I just threw a bunch of tools together and compiled an avr-gcc (based on binutils 2.42, gcc 13.3.0 plus most recent avr-libc) for winx64 (amd64) on my aarch64 Orange Pi 5 Plus.
It is completely untested since I do not own any Windows.
Perhaps you can report me back even if (in the very unlikely case) everything works fine.
Otherwise if you wish some modifications, please let me know.
https://www.file-upload.net/download-15386161/win64-avr-gcc-13.3.0.experimental.tar.xz.html
The sha256sum is:
d875e37ae9e76be1ac6f0179229b7eb9096942a997f4a55fe01bbaaf0023da49 win64-avr-gcc-13.3.0.experimental.tar.xz
BR S. Baerwolf
-
Reply to this email directly, view it on GitHub<#24 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AP7H3JX5LSY6WS66TGIAL73ZXCK35AVCNFSM6AAAAABOF4G6TCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJWHEZTQNJSGM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Stephen,
Do you have any pointers on the best way to integrate this into the existing WinAVR folder structure?
I am thinking I could make a copy of my WinAVR folder for backup, Copy the files you sent into their same folders in WinAVR, and try it out. Do you think this would work?
Do you have another suggestion?
I miss the days when a compiler was simple and could be run from a batch file for simple small embedded programs !
Thank you so much.
Peter
From: Stephan Baerwolf ***@***.***>
Sent: Tuesday, September 17, 2024 5:08 PM
To: baerwolf/USBaspLoader ***@***.***>
Cc: Peter House ***@***.***>; Author ***@***.***>
Subject: Re: [baerwolf/USBaspLoader] WinAVR make failure, New Install (Issue #24)
Hi again
I just threw a bunch of tools together and compiled an avr-gcc (based on binutils 2.42, gcc 13.3.0 plus most recent avr-libc) for winx64 (amd64) on my aarch64 Orange Pi 5 Plus.
It is completely untested since I do not own any Windows.
Perhaps you can report me back even if (in the very unlikely case) everything works fine.
Otherwise if you wish some modifications, please let me know.
https://www.file-upload.net/download-15386161/win64-avr-gcc-13.3.0.experimental.tar.xz.html
The sha256sum is:
d875e37ae9e76be1ac6f0179229b7eb9096942a997f4a55fe01bbaaf0023da49 win64-avr-gcc-13.3.0.experimental.tar.xz
BR S. Baerwolf
—
Reply to this email directly, view it on GitHub<#24 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AP7H3JX5LSY6WS66TGIAL73ZXCK35AVCNFSM6AAAAABOF4G6TCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJWHEZTQNJSGM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Hi
First of all: I was able to test the package on some borrowed Windows10-machine. There everything works fine.
To your Questions:
(1) It is best to remove your (14year old) WinAVR completely.
(2) My avr-gcc package is statically built. (I hope I also linked the binutils statically - not shure right now)
Statical builds are larger but independent from surrounding libraries.
(3) Since my provided package only includes the avr-gcc (and the corresponding c standard library) you will need some more packages to get posix build environment. I suggest to install MSYS2: https://www.msys2.org/
There the additional commands like "make" or "grep" are included.
Or use https://github.com/skeeto/w64devkit - which is a portable derivate which needs no installation,
(4) regarding the avr-gcc: Just extract everything in some easy to reach folder. For example "c:\tools\avr\"
Then add "c:\tools\avr\bin" to your PATH in order to automatically find all the avr-tools (avr-gcc, avr-strip, avr-objcopy, avr-objdump ...)
You can do this globally via windows-setting, or within the msys2-shell by adding the string to the PATH-environment variable. Without the PATH you need to type the full directoy ahead avr-gcc (i.e.: c:\tools\avr\bin\avr-gcc ...) and makefiles may not find the avr-gcc (because they are unaware of c:\tools\avr ...)
At last:
I miss the days when a compiler was simple and could be run from a batch file for simple small embedded programs !
Yes, but it is primarly window's (and similar hipster shit's) fault. Thing are already pretty bad in IT.
And I fear it will become a lot worse.
https://www.youtube.com/watch?v=Oh9TNPD2Cdo&ab_channel=CodeTherapyw%2FRen%C3%A9Rebe
BR S. Baerwolf
|
Stephen,
I am getting really close to a good compile! Your compiler is working fine and thankfully included support for the Atmega328PB and I didn’t have to modify it.
For some reason, when I compile my code, I get and error from the linker for one of the modules and do not understand what is causing the error.
I am hoping you will recognize it and it is something simple I am overlooking.
Please do not let me burden you with any further work unless you are interested.
Here is my batch file and the error:
:: Compile
avr-gcc -c -DF_CPU=16000000UL -mmcu=atmega328PB *. c
:: Link to Intel hex format
avr-ld -A avr5 -b ihex main.o io.o ana.o ct.o tsb2.o eeprom.o
Error Output:
avr-ld: tsb2.o: in function `L0':
TSB2.c:(.text+0x100): undefined reference to `__tablejump2__'
avr-ld: TSB2.c:(.text+0x6f8): undefined reference to `__tablejump2__'
Clean compile and link with only this error. The assembler files pass the strait face test and look accurate to me. Except the TSB2 assembler – there are two “jmp __tablejump2__” with no definition of __tablejump2__
I included a .zip with my files “If you are interested”
I only need a hex file image of the code. I already have AVRDUDE set for Fusing, EEPROM, and Flashing the code. This should be simple and maintainable.
Peter House
From: Stephan Baerwolf ***@***.***>
Sent: Wednesday, September 18, 2024 6:33 PM
To: baerwolf/USBaspLoader ***@***.***>
Cc: Peter House ***@***.***>; Author ***@***.***>
Subject: Re: [baerwolf/USBaspLoader] WinAVR make failure, New Install (Issue #24)
Hi
First of all: I was able to test the package on some borrowed Windows10-machine. There everything works fine.
To your Questions:
(1) It is best to remove your (14year old) WinAVR completely.
(2) My avr-gcc package is statically built. (I hope I also linked the binutils statically - not shure right now)
Statical builds are larger but independent from surrounding libraries.
(3) Since my provided package only includes the avr-gcc (and the corresponding c standard library) you will need some more packages to get posix build environment. I suggest to install MSYS2: https://www.msys2.org/
There the additional commands like "make" or "grep" are included.
Or use https://github.com/skeeto/w64devkit - which is a portable derivate which needs no installation,
(4) regarding the avr-gcc: Just extract everything in some easy to reach folder. For example "c:\tools\avr\"
Then add "c:\tools\avr\bin" to your PATH in order to automatically find all the avr-tools (avr-gcc, avr-strip, avr-objcopy, avr-objdump ...)
You can do this globally via windows-setting, or within the msys2-shell by adding the string to the PATH-environment variable. Without the PATH you need to type the full directoy ahead avr-gcc (i.e.: c:\tools\avr\bin\avr-gcc ...) and makefiles may not find the avr-gcc (because they are unaware of c:\tools\avr ...)
At last:
I miss the days when a compiler was simple and could be run from a batch file for simple small embedded programs !
Yes, but it is primarly window's (and similar hipster shit's) fault. Thing are already pretty bad in IT.
And I fear it will become a lot worse.
https://www.youtube.com/watch?v=Oh9TNPD2Cdo&ab_channel=CodeTherapyw%2FRen%C3%A9Rebe
BR S. Baerwolf
—
Reply to this email directly, view it on GitHub<#24 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AP7H3JXCCWQRWEEZJHGNCG3ZXH5SLAVCNFSM6AAAAABOF4G6TCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZGU2TSOBVGU>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Hi again
Thanks for the reply. I am happy to hear the compiler is working.
Regarding your issue: I think you build your firmware the wrong way.
However I didn't get your zip-file to have a deeper look (please use external upload and post link and hash), so I only can speculate.
When compiling C-Code it (except a very few exception like OS kernels) uses not only a C-Compiler, but a default (built in) library, too. It is called the C standard library. In your case it is the avr-libc. (But there is also glibc, uclibc, dietlibc ...etc...)
These library implements the well known API (strcpy, printf, qsort ...etc...).
However it needs to be linked to the final binary - by default the compiler will do that.
It seems in your case you build the (unlinked) object-files with the gcc, but link them with the binutils-linker.
So you are missing the C-library to link! (And that is most likely the reason there are objects missing...)
Try to link also with gcc:
avr-gcc -o final.elf -mmcu=atmega328PB main.o io.o ana.o ct.o tsb2.o eeprom.o
The result is an elf-file containing all the sections in unified format.
You can extract the relevant firmware ihex (by ignoring the eeprom-, fuse- , signature- and lockbit-sections) via the avr-objcopy command:
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex final.elf final.hex
This is the way it is meant to be by default.
Of yourse you also could use the avr-ld and link the correct (in your case avr5) libc to it.
I could provide you with an example but would need your zipfile to prepare...
You can get an example-makefile for a fuill AVR build from: https://github.com/baerwolf/avrskel
BR, hope to read from you soon.
|
Not sure how to find the Hash. I do not use any of the standard libraries. Ths only code which is NOT in my source might be the startup code which I have always trusted to Atmel Studio and MPLABX. I would happily write this myself if necessary as it would only require setting the SP and possibly clearing RAM (not strictly necessary but useful for debugging). I will try your suggestions when I get in my office in an hour or so and post my results when done. Thank you, Peter |
The commands you suggested completed without error. I compared the hex file to another generated by Atmel Studio 7 a couple of years ago and it looks very similar. The tablejump2 is still in the TSB2.s assembly file with no target. The target label tablejump2 appears in the .elf file and I believe this may be how the compiler handles large switch() constructs. the symbol tablejump2 also appears in a previous versions .elf of this product created using MPLABX (I Hope to NEVER open again - too buggy and inconsistent) - unfortunately I do not have assembly files for this version. In any case - 0 compile errors and hex file generated using your suggested commands. I will hardware test the code over the weekend and work on building my own make file. I am also thinking about building a linux avr-gcc build server either in a VM or on a Raspberry Pi. I expect final hardware from my customer today. Where can I find a summary of the individual programs that make up avr-gcc? I need to learn this more completely. Thank you again for your assistance. |
File Hash on Windows 11 using Powershell PS C:\Users\Peter\Desktop\WA-UnivTSB24A\src> get-filehash src.zip Algorithm Hash Path SHA256 255500D63FB1208126EFC3B39ED472953CCA515111F31C1B0BFB47828F065FCF C:\Users\Peter\Desktop\WA-UnivTSB24A\src\src.zip PS C:\Users\Peter\Desktop\WA-UnivTSB24A\src> |
Where did you get the source for your AVR build? |
Atmel328PB Target Board is Fully Functional with software compiled using WinAVR !!! Thank you so much for your help. I still have a lot to do to streamline the build environment and prepare to compile the 5 other projects in this series of modules. |
Hi
Sorry for my delayed response, but I have too much work to do...
Atmel328PB Target Board is Fully Functional with software compiled using WinAVR !!!
So did you rollback to use the WinAVR? Or did you mean the new avr-gcc 13.3 ??
However, I am happy I was able to help you...
(Perhaps you may want to close the issue ;-) - communication will still be possible.)
Perhaps you also may choos to contact me directly via e-mail: ***@***.***
Where did you get the source for your AVR build?
I will answer it together with your following question
Where can I find a summary of the individual programs that make up avr-gcc? I need to learn this more completely.
Puh. Doing a canadian-cross compilation is quite hard and CPU intensive.
If you haven't done this before it will most likely fail in the first few attempts...
...don't be frustrated...
Basically you need to download
(1) binutils (containing linker, assembler, elf-inspection ...ect... supporting AVR)
https://sourceware.org/git/binutils-gdb.git
I used tag "binutils-2_42" = c7f28aad0c99d1d2fec4e52ebfa3735d90ceb8e9
(2) gcc (the gnu compiler collection containing c,c++ and supporting AVR)
https://gcc.gnu.org/git/gcc.git
I used tag "releases/gcc-13.3.0" = b71f1de6e9cf7181a288c0f39f9b1ef6580cf5c8
(3) you will need a standard C library - in case of AVR: avr-libc-->http://savannah.nongnu.org/projects/avr-libc/
https://github.com/avrdudes/avr-libc.git
I used the most recent stable release: avr-libc-2_2_0-release = 16b742119eaed8d966929033b1ad325faea89798
(4) the gcc will need at least gmp (big number arithmetic library)
https://github.com/gmp-mirror/gmp
I used commit 141ed4f98a50e4a3c1a95a1758cb599b7499ac39 which comes close to version "6.3.0"
(5) the gcc will need at least mpfr (a universal precision floating point library)
https://gitlab.inria.fr/mpfr/mpfr.git
I used tag "4.2.1" = 53b7b847c406376b10cdd0ddcd46482dbd715363
(6) the gcc will need at least mpc (a library for the arithmetic of complex numbers)
I used tag "1.3.1 = 9e125d9407a8230339cfbae0857d3ad61cd378ce"
(7) you can skip isl...
Long story short you can inspect "./contrib/download_prerequisites" in gcc's subdirectories, to check for the needed versions.
first stage:
Then you need to build binutils (target=avr) for the compiling host. Then gmp, mpfr and mpc for the compiling host.
Finally you build GCC (target=avr) for the compiling host. There will be NO avr-lib build here...
second stage:
You build binutils, gmp, mpfr, mpc and gcc for the windows target (mingw64-blahblah...).
Since the windows avr-gcc can not run on the building machine, you use the first stage avr-gcc to do the internal compiling to avr-files.
Finally you also use the first-stage avr-gcc on the building host to compile the avr-lib.
BUT you install its output to the windows avr-gcc...
The avr-gcc i provided to you contains all supportet avr-targets:
avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny tiny-stack double64 long-double32 tiny-stack/double 64 tiny-stack/long-double32 avr25/tiny-stack avr25/double64 avr25/long-double32 avr25/tiny-stack/double64 avr25/tiny-stack/long-double32 avr3/double64 avr3/long-double32 avr31/double64 avr31/long-double32 avr35/double64 avr35/long-double32 avr4/double64 avr4/long-double32 avr5/double64 avr5/long-double32 avr51/double64 avr51/long-double32 avr6/double64 avr6/long-double32 avrxmega2/double64 avrxmega2/long-double32 avrxmega3/short-calls avrxmega3/double64 avrxmega3/long-double32 avrxmega3/short-calls/double64 avrxmega3/short-calls/long-double32 avrxmega4/double64 avrxmega4/long-double32 avrxmega5/double64 avrxmega5/long-double32 avrxmega6/double64 avrxmega6/long-double32 avrxmega7/double64 avrxmega7/long-double32 avrtiny/double64 avrtiny/long-double32
I do not use any of the standard libraries.[...]
If you are using C, you are most definitively using the standard-C-lib.
It is not optional and used when you call its functions. It also contains startup code, trampolines and interrupt vectors...
I hope to read from you again, till then
BR Stephan
|
I am absolutely using your 13.3.0 version you compiled for me. Thank you so much for your help. I will close this issue and contact you directly. |
Problem Solved ! |
Experienced first time user if and brand new install of WinAVR-20100110 on Latest Win11. Have written assembler and c for several decades and still learning - tired of UI issues with MPLABX and yearning for an IDE-less existence again!
I seem to be able to run the compiler manually but get this message when running "make all" using a Makefile generated by mFile.
PS C:\Users\Peter\Desktop\WA-UnivTSB24A> make all
0 [main] sh 9088 sync_with_child: child 5772(0x224) died before initialization with status code 0xC0000142
39 [main] sh 9088 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 34660 sync_with_child: child 31028(0x228) died before initialization with status code 0xC0000142
39 [main] sh 34660 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
make: *** No rule to make target
main.elf', needed by
elf'. Stop.PS C:\Users\Peter\Desktop\WA-UnivTSB24A>
The text was updated successfully, but these errors were encountered: