Skip to content

Not able to compile for ATmega3209/3208/1609/1608/809/808 using the latest toolchain #67

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

Closed
MCUdude opened this issue Apr 27, 2020 · 8 comments

Comments

@MCUdude
Copy link

MCUdude commented Apr 27, 2020

I stumbled across this weird issue today. I'm not able to build for any of the mentioned targets using the latest 7.3.0-atmel3.6.1-arduino6 toolchain. It does work for ATmega4809/4808 though. This is the error I'm getting:

/Users/hans/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino6/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: address 0x803066 of /var/folders/6l/ypg6qbw172v1s4vtt6g990tw0000gn/T/arduino_build_493085/230V_trigger.ino.elf section `.bss' is not within region `data'
/Users/hans/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino6/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: address 0x803066 of /var/folders/6l/ypg6qbw172v1s4vtt6g990tw0000gn/T/arduino_build_493085/230V_trigger.ino.elf section `.bss' is not within region `data'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board ATmega3209.

It works flawlessly with 7.3.0-atmel3.6.1-arduino5. Any idea what may cause this?
If you want to try it yourself, you can install MegaCoreX 1.0.2 from the boards manager. Note that 1.0.2 has a bug that prevents the 32-pin pinout from building (will fix it very soon). If you want to test this on ATmega3208/1608/808 you will have to select the 28-pin pinout.

@SpenceKonde
Copy link
Contributor

That error sounds super familiar.... IIRC it was also something silly - like, it didn't stick in my head enough for me to remember the details

@MCUdude
Copy link
Author

MCUdude commented Apr 28, 2020

@SpenceKonde something silly with the toolchain, or something stupidly simple you had to do to fix it?

@SpenceKonde
Copy link
Contributor

SpenceKonde commented Apr 28, 2020 via email

@MCUdude
Copy link
Author

MCUdude commented Apr 29, 2020

@facchinm do you know what's causing this? Are there other changes to *arduino6 other than an updated pack?

@SpenceKonde
Copy link
Contributor

In recent ATpacks, DATAMEM_SIZE has changed - looking at the latest atpacks, almost everything is else is a simple fix or correction, plus some changed to how reserved registers are shown... but DATAMEM_SIZE has grown, and for many chips is now 2^16. I can't say I know exactly what this macro means - but I'm pretty sure this change is what's making everything barf here....

@MCUdude
Copy link
Author

MCUdude commented May 1, 2020

This seems to be a known issue with the latest pack. It's caused by the linker script

https://www.avrfreaks.net/forum/failing-linker-new-device-pack-attiny-0-series

@MCUdude
Copy link
Author

MCUdude commented May 1, 2020

this link explains what went wrong:

https://www.avrfreaks.net/comment/2803036#comment-2803036

SpenceKonde added a commit to SpenceKonde/toolchain-avr that referenced this issue May 3, 2020
See info.txt in alsoneeded directory for more information on this.

These files need to replace the standard versions of them in order to
fix arduino#66, arduino#67, and an issue with eeprom_is_ready() in eeprom.h that
manifests on the newer parts. Unfortunately I'm not good enough at shell
scripting to make the build scripts slip these fixes in
facchinm pushed a commit to facchinm/toolchain-avr that referenced this issue May 26, 2020
See info.txt in alsoneeded directory for more information on this.

These files need to replace the standard versions of them in order to
fix arduino#66, arduino#67, and an issue with eeprom_is_ready() in eeprom.h that
manifests on the newer parts. Unfortunately I'm not good enough at shell
scripting to make the build scripts slip these fixes in
@MCUdude
Copy link
Author

MCUdude commented Sep 7, 2020

Whoops, forgot to close this!

@MCUdude MCUdude closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants