zakkemble / avr-gcc-build Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://blog.zakkemble.net/avr-gcc-builds/
Home Page: https://blog.zakkemble.net/avr-gcc-builds/
The build script does cumbersome commands like
cp -r "$PREFIX_LIBC"/* "$PREFIX_GCC_LINUX"
in order to "install" AVR-LibC. The proper way to install it in a location other then --prefix
is:
make install prefix="${PREFIX_GCC_LINUX}"
etc.
Configuring GCC with --with-gnu-ld
can improve the handling of @-files:
Only when the driver knows that the GNU linker is used, it will put options / objects for linking in @-file. This may be required on Windows when the inflated command line is too long for Windows. The behaviour of collect2
also depends on that flag: When the driver calls collect2
for linking with an @-file, collect2
will call ld
with an @-file only with the GNU linker.
The configure scripts can't always work this out, e.g. for canadian-cross builds, because configure cannot call the host's ld.exe
.
The build script uses avr-libc3 which is outdated, last update was 4 years ago . Better use the original avr-libc. You may argue that there is no AVR LibC release yet, but that applies to avr-libc3, too.
Hi.
apt install should install ca-certificates (for wget TLS vlaidation) and automake (for avr-libc bootstrap)
I tested the latest avr-gcc compiler here at the University of Applied Sciences in Amsterdam. We always attempt :) to compile without any warnings as all are then treated as errors.
In de the function _delay_us(double __us) in delay.h I get a warning (and thus an error) on line 279 that
uint8_t __ticks;
is unitialized.
Changing this line into
uint8_t __ticks = 0;
Solved it.
My Euro 0.02 :)
I am building a project for ATmega640 using GCC 12.1. I'm passing a -Wl,--print-memory-usage
flag to the linker to get the memory usage, but GCC thinks that the device has 128KB of flash, instead of 64KB. The RAM and EEPROM sizes are also wrong.
Linker flags: -mmcu=atmega640 -fno-exceptions -fno-rtti -Wl,--gc-sections -Wl,--print-memory-usage
Output:
Memory region Used Size Region Size %age Used
text: 49628 B 128 KB 37.86%
data: 748 B 65440 B 1.14%
eeprom: 0 GB 64 KB 0.00%
fuse: 0 GB 3 B 0.00%
lock: 0 GB 1 KB 0.00%
signature: 0 GB 1 KB 0.00%
user_signatures: 0 GB 1 KB 0.00%
When the command from #3, the correct percentage is displayed:
Device: atmega640
Program: 49628 bytes (75.7% Full)
(.text + .data + .bootloader)
Data: 332 bytes (4.1% Full)
(.data + .bss + .noinit)
Unfortunately, this issue means that compiler does not detect when the code exceeds the available memory.
The issue is not present on GCC 5.4, that is bundled with the Microchip Studio.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.