I’m trying to compile the native-blink
demo for the avr128db28
on the atmelmegaavr
platform, but I am getting an error about missing device specs.
I have the following packages installed:
Resolving AVR128DB28 dependencies...
Platform atmelmegaavr @ 1.9.0 (required: atmelmegaavr)
├── framework-arduino-megaavr-dxcore @ 1.5.6 (required: framework-arduino-megaavr-dxcore @ ~1.5.6)
└── toolchain-atmelavr @ 1.70300.191015 (required: platformio/toolchain-atmelavr @ ~1.70300.0)
Here is the contents of my platformio.ini:
[env:AVR128DB28]
platform = atmelmegaavr
;framework = arduino
board = AVR128DB28
upload_speed = 115200
upload_flags =
--tool
uart
--device
avr128db28
--uart
$UPLOAD_PORT
--clk
$UPLOAD_SPEED
upload_command = pymcuprog write --erase $UPLOAD_FLAGS --filename $SOURCE
The error I get is as follows:
Compiling .pio\build\AVR128DB28\src\main.o
avr-gcc: error: device-specs/specs-avr128db28: No such file or directory
*** [.pio\build\AVR128DB28\src\main.o] Error 1
If I uncomment the framework = arduino
option, it will compile successfully; however, I don’t want to do that, because if I do, it compiles the Arduino framework every time in addition to my own code, even though I’m not using it.
If I look in the .platformio\packages
directory, I have toolchain-atmelavr
and toolchain-atmelavr@1.70300.191015
directories. If I navigate to the lib\gcc\avr\7.3.0\device-specs
subdirectory beneath each of those package directories, the toolchain-atmelavr
directory has the spec files for the avr Dx parts, but the toolchain-atmelavr@1.70300.191015
directory doesn’t.
I was able to get past the spec error by copying all the missing spec files to the toolchain-atmelavr@1.70300.191015
, but then it complains about missing includes:
Compiling .pio\build\AVR128DB28\src\main.o
In file included from src\main.c:6:0:
c:\users\jblan\.platformio\packages\toolchain-atmelavr@1.70300.191015\avr\include\avr\io.h:695:33: fatal error: avr/ioavr128db28.h: No such file or directory
# define __AVR_DEVICE_HEADER__ <avr/__header1__(io,__AVR_DEV_LIB_NAME__).h>
^
compilation terminated.
*** [.pio\build\AVR128DB28\src\main.o] Error 1
Then if I copy all the missing include files, it complains about missing libraries:
c:/users/jblan/.platformio/packages/toolchain-atmelavr@1.70300.191015/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: cannot find crtavr128db28.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\AVR128DB28\firmware.elf] Error 1
If I copy all the missing libraries, then it finally compiles successfully without using the arduino
library.
I understand that gcc doesn’t include these files by default, but if platformio claims to support native development on these chips, shouldn’t these files be included in the toolchain-atmelavr
package you distribute, so it just works out of the box?
I’m new to platformio so I’m not sure where I should file a bug for this. I found the package on the registry but it didn’t have an obvious link to a github repo or bug tracker.