No code upload options working

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 - WARNING - Check failed - WARNING - Check failed
Traceback (most recent call last):
  File "c:\users\paul\appdata\local\programs\python\python39\lib\", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\paul\appdata\local\programs\python\python39\lib\", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Paul\AppData\Local\Programs\Python\Python39\Scripts\pymcuprog.exe\", line 7, in <module>
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\", line 285, in main
    return pymcuprog_main.pymcuprog(arguments)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\", line 80, in pymcuprog
    status = _start_session(backend, device_selected, args)
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\", line 549, in _start_session
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\", line 363, in start_session
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\", 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\", 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\", 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\", line 81, in __init__
  File "c:\users\paul\appdata\local\programs\python\python39\lib\site-packages\pymcuprog\serialupdi\", 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

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

monitor_flags = 
upload_protocol = custom
upload_speed = 115200
upload_port = COM3
upload_flags = 
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
;  -u
;  -c
;upload_command =  pymcuprog write $UPLOAD_FLAGS -f $SOURCE

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.

1 Like