No code upload options working

Hi,
as per a previous post re pyUPDI not working here I now have a problem with pymcuprog as below, any help much appreciated:

PS C:\Users\Paul\Documents\PlatformIO\Projects\Arduino-code-blinkled> pymcuprog write -d atmega4809 -t uart -u COM3 -c 250k -f .pio\build\ATmega4809\firmware.hex
pymcuprog.serialupdi.link - WARNING - Check failed
pymcuprog.serialupdi.link - WARNING - Check failed
Traceback (most recent call last):
  File "c:\users\paul\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\paul\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Paul\AppData\Local\Programs\Python\Python39\Scripts\pymcuprog.exe\__main__.py", line 7, in <module>
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\pymcuprog.py", line 285, in main
    return pymcuprog_main.pymcuprog(arguments)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\pymcuprog_main.py", line 80, in pymcuprog
    status = _start_session(backend, device_selected, args)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\pymcuprog_main.py", line 549, in _start_session
    backend.start_session(sessionconfig)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\backend.py", line 363, in start_session
    self.programmer.setup_device(
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\programmer.py", line 78, in setup_device
    self.device_model = get_nvm_access_provider(self.transport,
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\nvm.py", line 44, in get_nvm_access_provider
    accessprovider = NvmAccessProviderSerial(transport, device_info, baud=frequency, options=options)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\nvmserialupdi.py", line 51, in __init__
    self.avr = UpdiApplication(port, baud, self.dut)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\serialupdi\application.py", line 81, in __init__
    datalink.init_datalink()
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\serialupdi\link.py", line 60, in init_datalink
    raise PymcuprogError("UPDI initialisation failed")
pymcuprog.pymcuprog_errors.PymcuprogError: UPDI initialisation failed

platformio.ini below

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:ATmega4809]
board = ATmega4809
platform = atmelmegaavr
framework = arduino
board_build.variant = 40pin-standard
board_build.f_cpu = 20000000L

monitor_flags = 
	--echo
upload_protocol = custom
upload_speed = 115200
upload_port = COM3
upload_flags = 
	-d
	atmega4809
	-c
	$UPLOAD_PORT
	-b
	$UPLOAD_SPEED
upload_command = pyupdi $UPLOAD_FLAGS -f $SOURCE
monitor_port = COM6
monitor_speed = 19200
lib_deps = qub1750ul/SoftwareReset@^3.0.0


;upload_protocol = custom
;upload_speed = 115200
;upload_port = COM4
;upload_flags =
;  -t
;  uart
;  -d
;  $BOARD_MCU
;  -u
;  $UPLOAD_PORT
;  -c
;  $UPLOAD_SPEED
;upload_command =  pymcuprog write $UPLOAD_FLAGS -f $SOURCE


[platformio]
description = The integrated Azimuth Encoder


ok, I found it, I swapped out the FTDI board and Pymcuprog now reports that it loads the code.

I still have the pyupdi problem though and if anyone has any ideas on that I’d appreciate, as it takes circa one minute to upload my code with pymcuprog.
thanks.

1 Like