Comments (4)
Reason is that Binutils works on emulation level, i.e. is knows -mavrxmega2
or -mavr51
, and the layout of MEMORY regions comes from the emulation default. For example, the top of the default linker scripts read something like (here from avr51.x
):
__TEXT_REGION_ORIGIN__ = DEFINED(__TEXT_REGION_ORIGIN__) ? __TEXT_REGION_ORIGIN__ : 0;
__TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : 128K;
__DATA_REGION_ORIGIN__ = DEFINED(__DATA_REGION_ORIGIN__) ? __DATA_REGION_ORIGIN__ : 0x800100;
__DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH__ : 0xff00;
...
MEMORY
{
text (rx) : ORIGIN = __TEXT_REGION_ORIGIN__, LENGTH = __TEXT_REGION_LENGTH__
data (rw!x) : ORIGIN = __DATA_REGION_ORIGIN__, LENGTH = __DATA_REGION_LENGTH__
...
}
Hence, when symbols like __TEXT_REGION_LENGTH__
are not defined, the core specific defaults are used which are large enough so that all MCUs in that core family will fit.
A canonical place to define these symbols is in the startup code. Stock AVR-LibC currently does not define respective symbols, but there is avrdudes/avr-libc#936 to (weakly) define respective symbols.
crt*.o
from atpacks has these symbols defined, so it makes a difference which crt you are using. See avr-nm crt*.o | grep REGION
.
For the time being, you can define the symbols on the command line, e.g. -Wl,--defsym,__TEXT_REGION_LENGTH=64k
or in the device-specs file, for example:
*link_text_start:
--defsym __TEXT_REGION_LENGTH=64k
from avr-gcc-build.
Update: the issue goes away when using the Atmel DFP (-B ...
flag)
from avr-gcc-build.
Did also run into this problem. The -B flag does not work for me. What flags exactly you use?
Furthermore the SysProgs compiler (only for Windows) works out of the box with correct region size. So somehow it must be possible to get the correct behavior also on Linux.
from avr-gcc-build.
@mobacon Did you pass the right argument to -B
? I point it to the extracted DFP like this:
-B _deps/atmegadfp/gcc/dev/atmega640
from avr-gcc-build.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avr-gcc-build.