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\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\cli.py", line 71, in invoke
    return super().invoke(ctx)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\commands\install.py", line 67, in package_install_cmd
    install_project_dependencies(options)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\commands\install.py", 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\install.py", 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\install.py", line 166, in _install_project_env_custom_platforms
    pm.install(
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\package\manager\platform.py", line 52, in install
    p = PlatformFactory.new(pkg)
  File "C:\Users\rafae\.platformio\penv\lib\site-packages\platformio\platform\factory.py", line 77, in new
    platform_cls = getattr(
AttributeError: module 'platformio.platform.avr128da' has no attribute '
Avr128daPlatform'

============================================================

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
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

Once you rename the platform, you need to give it that expected class name in platform.py 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!