Custom Platform no attribute for 'platformio.platform...'

  • I’m trying to create a custom platform.
  • I’m using the atmelmegaavr and starting to modify it.
    Initially targeting the AVR128DA48 device (in the Curiosity Nano of the same name)
  • Here’s my platform.json
  • Then I ran pio pkg install --platform file://path_to_avr128da as in the documentation to install from local folders

Then the output I get is that the installation was successful, but some of the further configuration has some errors.

Resolving AVR128DA48 dependencies...
Platform Manager: Installing file://C:\Users\rafae\OneDrive\Documents\platform-avr128da  
Platform Manager: avr128da@0.0.1 has been installed!
Error: Traceback (most recent call last):
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\", line 71, in invoke
    return super().invoke(ctx)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\commands\", line 67, in package_install_cmd
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\commands\", line 106, in install_project_dependencies
    already_up_to_date = not install_project_env_dependencies(env, options)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\commands\", line 118, in install_project_env_dependencies
    _install_project_env_custom_platforms(project_env, options)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\commands\", line 166, in _install_project_env_custom_platforms
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\manager\", line 52, in install
    p =
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\platform\", line 77, in new
    platform_cls = getattr(
AttributeError: module 'platformio.platform.avr128da' has no attribute '


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

* Report this problem to the developers


Once you rename the platform, you need to give it that expected class name in too. Leaving it at

will not work.

1 Like

hahaha sounds like it (so simple and yet I didn’t see it).
Let me try that

Thank you for the very swift response!