Skip to content
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

Staging AVR toolchain 3.6.0 (with 328pb support files) #47

Merged
merged 25 commits into from
Aug 24, 2018
Merged

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Aug 2, 2017

Some bash magic to apply only needed files from atpack.
The file won't be downloaded automatically but must be obtained from Atmel (explicitly accepting the license).

For the braves:
the toolchains can be tested by adding
https://downloads.arduino.cc/packages/package_avr_3.6.0_index.json
to the "Additional json" under Preferences.
This will prompt an update to avr core to version 1.6.200 (really 1.6.19 with only the new toolchain).

Please report any problem you may encounter since it has only been tested on Linux64 ATM.

@facchinm
Copy link
Member Author

facchinm commented Aug 2, 2017

Solves #46 and #36
@salkinium @awatterott @PaoloP74

@PaoloP74
Copy link

PaoloP74 commented Aug 2, 2017

Thank you. 👍

@awatterott
Copy link

awatterott commented Aug 2, 2017

I have tested it under Windows with our Pro Mini PB and everything is working.
Thank you.

PS: Could you also update the avrdude.conf with the m328PB signature.

@per1234
Copy link

per1234 commented Aug 16, 2017

I believe this also fixes https://github.com/arduino/Arduino/issues/5286

I've been using it for the last two weeks on Windows 7 without any problems but I haven't done any extensive testing and am not using ATmega328PB.

@facchinm
Copy link
Member Author

@per1234 Yes, I double checked and the shipped version of avr-libc contains this fix indeed

@NicoHood
Copy link

@facchinm Please do not post http links if https is available. https://downloads.arduino.cc/packages/package_avr_3.6.0_index.json. Since the toolchain is executed by the local user, one could compromise the user account by providing a modified json file with a link to an external, faked core which has malware inside instead of compiler tools.

@facchinm
Copy link
Member Author

@NicoHood you are right, sorry, link modified.

@MCUdude
Copy link

MCUdude commented Aug 22, 2017

How about ATmega48PB/88PB/168PB; are they added as well? Planning to add support for the whole family with MiniCore.

@facchinm
Copy link
Member Author

facchinm commented Sep 4, 2017

@MCUdude the supported mcus are (attention, long list)

atxmega128a1u
atmega88
atmega6490p
attiny261a
at90usb1286
atmega3290a
ata6613c
attiny4
atmega256rfr2
atmega1284
at90s8515
atmega64
attiny40
atmega32u6
ata6286
atmega88a
atmega48a
atmega6490
atmega165a
atxmega64a1u
atmega644a
attiny2313
atmega64hve2
atmega64a
atmega1280
atxmega64d3
at90s2323
atmega3290
atmega3250
at90usb647
avr5
atmega16m1
attiny167
atmega128a
attiny15
attiny26
at90pwm81
atmega168p
atxmega192a3
atxmega64d4
atxmega256a3b
attiny841
atxmega32d3
atxmega32a4
atmega164pa
avr2
attiny87
atmega16hva2
atmega3250a
atmega325p
atmega163
atxmega16a4u
atmega16u2
atxmega16a4
atmega2560
atxmega32e5
attiny2313a
attiny461
at90can32
atmega168pa
attiny861a
atmega48p
ata5790n
atxmega192c3
atmega3290p
atxmega128d4
avrxmega7
atmega169pa
atmega169a
atmega8
at43usb320
atmega649a
atmega162
atxmega256a3u
atmega325pa
atmega406
atmega323
atmega325a
atmega128rfa1
attiny84a
atmega6450p
avrxmega5
attiny13
atmega329a
atmega328p
atmega48pa
atxmega64c3
atmega6450
atmega645a
atmega169
atmega329p
atmega16hvb
ata6614q
attiny10
atmega2564rfr2
atxmega128c3
avrxmega2
at90pwm1
atmega2561
avr31
atmega16
attiny461a
atmega168
at90pwm3b
atxmega64a1
atxmega256a3
attiny84
atmega324p
atmega649p
atmega164a
at90usb646
at90usb162
atmega16u4
atxmega32a4u
attiny13a
attiny25
ata664251
atxmega8e5
at76c711
atmega165pa
atmega16hva
atmega168a
avr25
attiny861
atmega161
atmega48
at90pwm316
at90c8534
ata5782
ata5831
atmega3250pa
attiny828
atmega32m1
atxmega16c4
at90pwm2
ata6617c
atmega644
atmega128rfr2
ata8210
ata6289
at90can128
atmega644pa
atmega165
atmega1284rfr2
attiny1634
atxmega256a3bu
attiny22
atmega64m1
atmega640
attiny28
at90pwm161
at90can64
ata6612c
attiny45
avr1
ata8510
atmega325
atmega64c1
atmega8hva
atmega645p
m3000
atmega88pa
attiny43u
atmega1281
atmega64hve
atmega169p
atxmega64a3
atxmega128a3
at90pwm2b
ata5702m322
atxmega64b3
attiny5
atmega164p
atmega645
atmega8515
atmega88p
attiny44
at86rf401
atmega8535
attiny441
ata5791
atmega32hvbrevb
atmega329pa
atxmega128a1
atxmega64a3u
attiny44a
atxmega16e5
atmega64rfr2
atmega6450a
at94k
atxmega256c3
atxmega32c4
attiny4313
at90s4414
avr51
atmega32u4
ata5790
atxmega128d3
at43usb355
atmega644p
atmega103
atmega8u2
atmega88pb
atmega48pb
attiny20
atmega32a
atmega3290pa
at90s4434
attiny261
ata5795
atxmega64a4u
ata5272
attiny12
ata6616c
at90s2313
atmega16a
ata6285
atmega328
atmega3250p
atmega16hvbrevb
atmega328pb
atmega128
atmega32hvb
attiny24
attiny85
attiny88
avr3
attiny11
at90pwm216
attiny24a
avrxmega4
atmega165p
atxmega128a4u
atmega168pb
atxmega256d3
avr4
atmega32u2
atmega8a
atxmega64b1
at90usb1287
atxmega32c3
atmega32c1
atxmega384d3
atxmega128a3u
attiny48
atmega1284p
atxmega192d3
atxmega128b1
atxmega32d4
atmega324a
avr6
at90s4433
atmega32
atmega329
at90s2333
avrxmega6
at90s2343
attiny9
at90pwm3
avrtiny
atxmega16d4
atxmega192a3u
avr35
atmega644rfr2
at90scr100
atmega6490a
atmega324pa
atxmega128b3
atmega649
atxmega384c3
at90s1200
ata5505
at90usb82
at90s8535

so all the ones you mention should be there 😉

@MCUdude
Copy link

MCUdude commented Sep 4, 2017

Great! So why isn't the ATmega324PB on the list? Just curious 🙂

@awatterott
Copy link

Are there any news when the new toolchain will be used?
There is also a new version 3.6.1 available.

build.conf Outdated
@@ -15,6 +16,10 @@ MPC_SOURCES="http://www.multiprecision.org/mpc/download"
# MPFR_VERSION=3.0.0
# MPC_VERSION=0.9

ATMEL_ATMEGA_PACK_VERSION=1.2.132
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest pack version is 1.2.150.

@matthijskooijman
Copy link
Collaborator

You are disabling the gcc-patches code, why is that? No patches are needed anymore? If so, why not remove the last patch and let the code check for a non-empty directory? Now, there's a risk of later adding a patch again, which will not be applied. Also, a casual observer might look at this repo and expect the last patch present to be applied, which it is not.

Also, the build flags are changed, and now no longer include lto. Is lto disabled now, or is it enabled by default in this gcc version? If the latter, it might be good to mention this in the commit message.

I assume the commit history will get some cleanups before this is merged?

@facchinm
Copy link
Member Author

@matthijskooijman it will need a cleanup for sure. LTO is enabled by default on gcc 5+ so there is no need to specify it in the config.

@MCUdude
Copy link

MCUdude commented Feb 17, 2018

I just installed 1.6.205 and compiled AnalogReadSerial for ATmega328B using MiniCore. Same error when using Watterott's 328PB core.

It compiles fine on ATmega328P and ATmega48PB/88PB/168PB. Seems like the hardware isn't defined when compiling for 328PB. Here's the error:

Output before the error occurs:

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/Hans/Library/Arduino15/packages -hardware /Users/Hans/Documents/Arduino/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/Hans/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/Hans/Documents/Arduino/libraries -fqbn=MiniCore:avr:328:bootloader=true,variant=modelPB,BOD=2v7,LTO=Os,clock=16MHz_external -ide-version=10805 -build-path /var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556 -warnings=all -build-cache /var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_cache_435973 -prefs=build.warn_data_percentage=75 -verbose /Applications/Arduino.app/Contents/Java/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/Hans/Library/Arduino15/packages -hardware /Users/Hans/Documents/Arduino/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/Hans/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/Hans/Documents/Arduino/libraries -fqbn=MiniCore:avr:328:bootloader=true,variant=modelPB,BOD=2v7,LTO=Os,clock=16MHz_external -ide-version=10805 -build-path /var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556 -warnings=all -build-cache /var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_cache_435973 -prefs=build.warn_data_percentage=75 -verbose /Applications/Arduino.app/Contents/Java/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino
Using board '328' from platform in folder: /Users/Hans/Documents/Arduino/hardware/MiniCore/avr
Using core 'MCUdude_corefiles' from platform in folder: /Users/Hans/Documents/Arduino/hardware/MiniCore/avr
Build options changed, rebuilding all
Detecting libraries used...
"/Users/Hans/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino1/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega328pb -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_ATmega328 -DARDUINO_ARCH_AVR   "-I/Users/Hans/Documents/Arduino/hardware/MiniCore/avr/cores/MCUdude_corefiles" "-I/Users/Hans/Documents/Arduino/hardware/MiniCore/avr/variants/pb-variant" "/var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/sketch/AnalogReadSerial.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Users/Hans/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino1/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega328pb -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_ATmega328 -DARDUINO_ARCH_AVR   "-I/Users/Hans/Documents/Arduino/hardware/MiniCore/avr/cores/MCUdude_corefiles" "-I/Users/Hans/Documents/Arduino/hardware/MiniCore/avr/variants/pb-variant" "/var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/sketch/AnalogReadSerial.ino.cpp" -o "/var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/Users/Hans/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino1/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328pb -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_ATmega328 -DARDUINO_ARCH_AVR   "-I/Users/Hans/Documents/Arduino/hardware/MiniCore/avr/cores/MCUdude_corefiles" "-I/Users/Hans/Documents/Arduino/hardware/MiniCore/avr/variants/pb-variant" "/var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/sketch/AnalogReadSerial.ino.cpp" -o "/var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/sketch/AnalogReadSerial.ino.cpp.o"

Error:

In file included from /Users/Hans/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino1/avr/include/avr/pgmspace.h:90:0,
                 from /Users/Hans/Documents/Arduino/hardware/MiniCore/avr/cores/MCUdude_corefiles/Arduino.h:28,
                 from /var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/sketch/AnalogReadSerial.ino.cpp:1:
/Users/Hans/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino1/avr/include/avr/io.h:623:6: warning: #warning "device type not defined" [-Wcpp]
 #    warning "device type not defined"
      ^
In file included from /Users/Hans/Documents/Arduino/hardware/MiniCore/avr/cores/MCUdude_corefiles/USBAPI.h:25:0,
                 from /Users/Hans/Documents/Arduino/hardware/MiniCore/avr/cores/MCUdude_corefiles/Arduino.h:289,
                 from /var/folders/2f/bk0yr6zx4290kvkss8ty0gxc0000gn/T/arduino_build_678556/sketch/AnalogReadSerial.ino.cpp:1:
/Users/Hans/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino1/avr/include/avr/eeprom.h:41:3: warning: #warning "Device does not have EEPROM available." [-Wcpp]
 # warning "Device does not have EEPROM available."
   ^
/Applications/Arduino.app/Contents/Java/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino: In function 'void setup()':
AnalogReadSerial:16: error: 'Serial' was not declared in this scope
   Serial.begin(9600);
   ^
/Applications/Arduino.app/Contents/Java/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino: In function 'void loop()':
AnalogReadSerial:24: error: 'Serial' was not declared in this scope
   Serial.println(sensorValue);
   ^
exit status 1
'Serial' was not declared in this scope

@per1234
Copy link

per1234 commented Feb 17, 2018

AnalogReadSerial compiles fine for me with Arduino AVR Boards 1.6.205, MiniCore, ATmega328PB, Arduino IDE 1.8.5, Windows 10. I wonder if it's still an macOS-specific issue like #48? The Travis CI build of MiniCore didn't have any problem compiling (other sketches) for ATmega328PB w/ Arduino AVR Boards 1.6.205 either so that indicates Linux is fine too.

@per1234
Copy link

per1234 commented Jul 20, 2018

There's a problem at line 532-533 of https://downloads.arduino.cc/packages/package_avr_3.6.0_index.json. The filename is wrong for the arm-linux-gnueabihf version of avr-gcc 5.4.0-atmel3.6.1-arduino2.

@@ -524,18 +524,18 @@
         {
           "name": "avr-gcc",
           "version": "5.4.0-atmel3.6.1-arduino2",
           "systems": [
             {
               "size": "30644597",
               "checksum": "SHA-256:b4e2ce5c70b88d3a0f7e303a0a3cc7e5a39a96a5e7f9ea7ea0af3ccfda0f60cc",
               "host": "arm-linux-gnueabihf",
-              "archiveFileName": "avr-gcc-5.4.0-atmel3.6.1-arduino1-armhf-pc-linux-gnu.tar.bz2",
-              "url": "http://downloads.arduino.cc/tools/avr-gcc-5.4.0-atmel3.6.1-arduino1-armhf-pc-linux-gnu.tar.bz2"
+              "archiveFileName": "avr-gcc-5.4.0-atmel3.6.1-arduino2-armhf-pc-linux-gnu.tar.bz2",
+              "url": "http://downloads.arduino.cc/tools/avr-gcc-5.4.0-atmel3.6.1-arduino2-armhf-pc-linux-gnu.tar.bz2"
             },
             {
               "size": "31894498",
               "checksum": "SHA-256:abc50137543ba73e227b4d1b8510fff50a474bacd24f2c794f852904963849f8",
               "host": "i386-apple-darwin11",
               "archiveFileName": "avr-gcc-5.4.0-atmel3.6.1-arduino2-i386-apple-darwin11.tar.bz2",
               "url": "http://downloads.arduino.cc/tools/avr-gcc-5.4.0-atmel3.6.1-arduino2-i386-apple-darwin11.tar.bz2"
             },

@matthijskooijman
Copy link
Collaborator

\o/

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

Successfully merging this pull request may close these issues.

None yet

7 participants