IDE Environment: Windows
Development board: AVR mega2560
Development Source Code: Marlin
Framework: Arduino
[platformio]
src_dir = Marlin
boards_dir = buildroot/share/PlatformIO/boards
default_envs = mega2560
include_dir = Marlin
This setup with PlatformIOI IDE previously worked until recently. Something has changed, but I don’t know what or why. I’m unable to Upload firmware to the development board via USB. Source code compiles successfully but fails to upload.
Terminal Output Errors:
Archiving .pio\build\mega2560\libFrameworkArduino.a
Indexing .pio\build\mega2560\libFrameworkArduino.a
Linking .pio\build\mega2560\firmware.elf
Checking size .pio\build\mega2560\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [====== ] 62.5% (used 5120 bytes from 8192 bytes)
Flash: [====== ] 65.0% (used 165054 bytes from 253952 bytes)
Building .pio\build\mega2560\firmware.hex
Configuring upload protocol…
AVAILABLE: wiring
CURRENT: upload_protocol = wiring
Looking for upload port…
*** [upload] AssertionError :
Traceback (most recent call last):
File “C:\Users\Dell Customer.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Action.py”, line 1318, in execute
result = self.execfunction(target=target, source=rsources, env=env)
File “C:\Users\Dell Customer.platformio\platforms\atmelavr\builder\main.py”, line 54, in BeforeUpload
env.AutodetectUploadPort()
File “C:\Users\Dell Customer.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Util.py”, line 737, in call
return self.method(*nargs, **kwargs)
File “C:\Users\Dell Customer.platformio\penv\lib\site-packages\platformio\builder\tools\pioupload.py”, line 113, in AutodetectUploadPort
UPLOAD_PORT=SerialPortFinder(
File “C:\Users\Dell Customer.platformio\penv\lib\site-packages\platformio\device\finder.py”, line 144, in find
device = self._find_known_device()
File “C:\Users\Dell Customer.platformio\penv\lib\site-packages\platformio\device\finder.py”, line 221, in _find_known_device
for board_config in p.get_boards().values():
File “C:\Users\Dell Customer.platformio\platforms\atmelsam\platform.py”, line 105, in get_boards
result[key] = self._add_default_debug_tools(result[key])
File “C:\Users\Dell Customer.platformio\platforms\atmelsam\platform.py”, line 148, in _add_default_debug_tools
assert openocd_chipname
AssertionError
============================== [FAILED] Took 104.33 seconds ==============================
Environment Status Duration
mega2560 FAILED 00:01:44.333
========================= 1 failed, 0 succeeded in 00:01:44.333 =========================
- The terminal process “C:\Users\Dell Customer.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload’” terminated with exit code: 1.
- Terminal will be reused by tasks, press any key to close it.
What I have tried:
- Updated Windows USB Device Driver, no change.
- Tried rolling VS Code back to Version: 1.70.2 and reinstalling PlatformIO, no change.
What I used PlatformIO for prior to Arduino upload problem:
I loaded maxgerhardt’s github repository “T-962-improvements” which is for platform NXPlpc ( lpc2134 microcontroller ), with platformIO.ini includes these settings:
[upload_settings]
; value will be read by python script. analogous to Makefile
FLASH_BAUD = 57600
MCU_CLOCK = 11059
[env:lpc2134_01]
platform = nxplpc
; use custom board definition for NXP LPC 2134/01
board = lpc2134_01
; use same linkerscript as Makefile uses
board_build.ldscript = T-962-controller.ld
; remove default thumb mode flag
build_unflags = -mthumb
; reproduce build flags from Makefile
build_flags = -DNDEBUG -D__NEWLIB__ -fno-builtin -fmessage-length=0 -flto -ffat-lto-objects -Wl,-u_printf_float -Wl,-u_scanf_float
; add -nostdlib to linkerflags via script; cannot be done via build_flags in this case
; see Redirecting...
; also creates additional HEX file (otherwise only .elf and .bin are there, but uploader needs .hex)
; reproduce creation of version.c file, as Makefile does (could also work without, but why not…)
extra_scripts =
fix_linkflags.py
pre:create_version.py
custom_upload.py
; upload via custom lpc21isp program.
; precompiled binaries for Windows and Linux exist in this directory. Assume Windows by default
upload_protocol = custom
;if explicit upload port is needed (will be auto-detected otherwise)
;upload_port = COM1
Not sure what to try next. Any help appreciated.