Help for installing custom board

Hello. I’m trying to install package of a custom uno r4 minima and use it on platformio, but without success.
With arduino IDE, I put the custom board package folder on “Arduino15/packages/myCustomBoard” (in customBoard we can find all ‘bootloader’, ‘core’, ‘viriants’, ‘libraray’ etc folder)
And it works fine like this.

So to do the same on platformio, I tried to follow this link steps https://docs.platformio.org/en/stable/platforms/creating_platform.html

but I get stuck on “Installation step 4” → I can’t find any the custom board created with the pio platform search cmd on the CLI.

Even if I create and add the exact same file as mentionned on the link, I can’t see the myplatform on the pio platform search list.

So need help to understand why please.

Oh you should not need to create your own platform. PlatformIO already has https://github.com/platformio/platform-renesas-ra/ as the base Platform supporting the Uno R4 Minima.

All you should need to do is

  1. Duplicate uno_r4_minima.json as boards/my_custom_minima.json in the project folder (that can be created by creating a new project for the regular Uno R4 Minima)
  2. If you only added a new folder to variants/ to support your board, add that same folder, e.g. myCustomBoard to <user home folder>\.platformio\packages\framework-arduino-renesas-uno\variants
  3. Edit the my_custom_minima.json in regards to the variant field, this must match the name of the folder you added to variants (e.g., myCustomBoard). CHange Name and macros as needed too.
  4. Change your platformio.ini to reference that new board
[env:my_custom_minima]
platform = renesas-ra
framework = arduino
board = my_custom_minima

That’s it.

Thank you @maxgerhardt but I’m not sure to understand all you said.

1st: I need to create a new project IO by selecting uno r4 minima as board and save the project for example in “download” folder?

2nd: Put inside the folder created, the file uno_r4_minima.json ?

3th : Go to .platformio\packages\framework-arduino-renesas-uno\variants and copy my variant folder name inside ?

Can I copy framework-arduino-renesas-uno folder and rename it as I want ?

4th : For modifying my_custom_minima, what do you mean by ‘variant’ ? do you mean the file variant.cpp" I can find in the ‘variant\MINIMA’ folder ?