Hi guys,
I need your help
Until now, I was using Atom with the PlatformIO extension to build my project.
But I would like to switch to Visual Studio Code, as I prefer the editor. I saw that the PlatformIO extension for VSC had made big steps forward, so I tried to switch today.
First of all, I want to say, that my project is completely working in Atom. I can build and upload it to the device.
The target is a Arduino Mega 2560 compatible board (Atmega 2560).
My project structure is quite simple.
Besides the main.cpp/h files, I packed everything is libraries. I am using 14 libs. All are placed in the libs folder and the suggested structure.
I am not sure if it’s directly related to the project.
On the one hand, I’ve created a small test project within VSC. This project can be build.
But on the other hand the project is compiling in Atom.
I am just getting an cryptic error message:
avr-g++ -o .pioenvs\megaatmega2560\FrameworkArduino\HardwareSerial1.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -g -Os -Wall -ffuncti
on-sections -fdata-sections -flto -mmcu=atmega2560 -DF_CPU=16000000L -DPLATFORMIO=30500 -DARDUINO_ARCH_AVR -DARDUINO_AVR_MEGA2560 -DARDUINO=10619 -IC:\Users\pho
ef\.platformio\packages\framework-arduinoavr\cores\arduino -IC:\Users\phoef\.platformio\packages\framework-arduinoavr\variants\mega C:\Users\phoef\.platformio\p
ackages\framework-arduinoavr\cores\arduino\HardwareSerial1.cpp
avr-g++ -o .pioenvs\megaatmega2560\FrameworkArduino\HardwareSerial2.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -g -Os -Wall -ffuncti
on-sections -fdata-sections -flto -mmcu=atmega2560 -DF_CPU=16000000L -DPLATFORMIO=30500 -DARDUINO_ARCH_AVR -DARDUINO_AVR_MEGA2560 -DARDUINO=10619 -IC:\Users\pho
ef\.platformio\packages\framework-arduinoavr\cores\arduino -IC:\Users\phoef\.platformio\packages\framework-arduinoavr\variants\mega C:\Users\phoef\.platformio\p
ackages\framework-arduinoavr\cores\arduino\HardwareSerial2.cpp
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python27\Lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\util.py", line 92, in run
self.outcallback(line)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\managers\platform.py", line 382, in on_run_out
self._echo_line(line, level=1)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\managers\platform.py", line 397, in _echo_line
click.secho(line, fg=fg, err=level > 1)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\termui.py", line 417, in secho
return echo(style(text, **styles), file=file, nl=nl, err=err, color=color)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\utils.py", line 314, in echo
file.write(message)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\_compat.py", line 560, in _safe_write
return _write(s)
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 40, in write
self.__convertor.write(text)
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 141, in write
self.write_and_convert(text)
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\_compat.py", line 97, in write
return self.buffer.write(str(x))
IOError: [Errno 0] Error
PlatformIO extension and core are of course up to date.
pio upgrade
You're up-to-date!
PlatformIO 3.5.0a4 is currently the newest version available.
Python is also up to date (2.7.13).
I even get this error, when trying to update pio:
pio update
Updating tool-scons @ 3.20501.2 [Up-to-date]
Updating tool-unity @ 1.20302.1 [Up-to-date]
Updating pysite-pioplus @ 0.4.2 [Up-to-date]
Updating contrib-piohome @ 0.1.2 [Up-to-date]
Updating tool-pioplus @ 0.10.2 [Up-to-date]
Platform Manager
================
Platform Atmel AVR
--------
Updating atmelavr @ 1.7.0 [Up-to-date]
Updating toolchain-atmelavr @ 1.40902.0 [Up-to-date]Error: Traceback (most recent call last):
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\__main__.py", line 104, in main
cli(None, None, None)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\core.py", line 680, in main
rv = self.invoke(ctx)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\core.py", line 508, in invoke
return callback(*args, **kwargs)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\decorators.py", line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\commands\update.py", line 46, in cli
ctx.invoke(cmd_platform_update, only_check=only_check)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\core.py", line 508, in invoke
return callback(*args, **kwargs)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\commands\platform.py", line 376, in platform_update
platform, only_packages=only_packages, only_check=only_check)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\managers\platform.py", line 125, in update
p.update_packages(only_check)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\managers\platform.py", line 286, in update_packages
self.pm.update(manifest['__pkg_dir'], version, only_check)
File "c:\users\phoef\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 722, in update
click.echo("[%s]" % (click.style("Up-to-date", fg="green")))
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\utils.py", line 314, in echo
file.write(message)
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\_compat.py", line 560, in _safe_write
return _write(s)
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 40, in write
self.__convertor.write(text)
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 141, in write
self.write_and_convert(text)
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "c:\users\phoef\.platformio\penv\lib\site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "c:\users\phoef\.platformio\penv\lib\site-packages\click\_compat.py", line 97, in write
return self.buffer.write(str(x))
IOError: [Errno 0] Error
============================================================
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
`pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
http://docs.platformio.org/page/faq.html
* Report this problem to the developers
https://github.com/platformio/platformio-core/issues
============================================================
Any ideas, how I can fix this error?
Thanks in advance