Morning All,
I’m seeing exactly this problem on a PlatformIO project created with pio init --board uno --ide qtcreator
and containing a very basic “blink” sketch. As I’m using QTCreator as my IDE, and definitely not using Emacs (It’s usually vi for me!
), I don’t think that the problem is related to Emacs.
I build a small blink project as follows:
mkdir testQT
cd testQT
pio init --board uno --ide qtcreator
cd ..
mkdir testCB
cd testCB
pio init --board uno --ide codeblocks
In either test directory, pio run -e uno
works fine, no problems at all.
In the CodeBlocks test, both the Debug and Release targets build fine too. Looking at the build options, the compiler is my 64bit g++, but when compiling, it actually calls out to pio run
so builds fine. This is interesting as there is a compiler listed - the AVR version of g++ so it could be used.
In the QTCreator IDE, there is no AVR specific version of g++ found in the compilers listed under Options, and compiling is carried out using the default g++ compiler - for 64bit x86 style environments. QTCreator projects don’t appear to call out to pio run
.
So, I suspect your Emacs setup is calling the wrong compiler?
FYI, my platformio.ini
file is this:
[env:uno]
platform = atmelavr
board = uno
;framework = arduino
I commented out the framework line.
And the test source, main.cpp
is this:
#include <avr/io.h>
#include <util/delay.h>
int main ()
{
// setup
DDRB |= (1 << DDB5);
// loop
while (1) {
PINB |= (1 << PINB5);
_delay_ms(1000);
}
return 0;
}
HTH
Cheers,
Norm.