How to create a new project based on a chip type, not based on a demo board?

When I use PIO in my project, I want to create a project based on a chip but in the window of creating a project there only have choice based on board?

I want to choose generic chip?

How to do it?

By chip you mean microcontroller ?

What is the chip that you want to use ?

I got an example of a generic microcontroller used with a custom board.

Custom board using ATmega 328

platform = ${common_env_data.platform}

board = ATmega328P

board_hardware.oscillator = external ; added

board_build.f_cpu = 4000000L ;added 4 MHz

framework = ${common_env_data.framework}

monitor_port = ${env:ATmega328P.upload_port}

build_flags = -DDEBUG -DBoard_1_8V

upload_speed = 9600 ;recommended for 4 MHz

upload_port = COM3

upload_protocol= custom

upload_flags =











; -c stk500v2

upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

For Example,
I want to use a microcontroller named STM32L476RG, I design a PCB for it, but when I use the PIO, I have to create a project based on NUCLEO-L476, it can not choose chip like MDK-KEIL
How should I do?

Okay, I am a bit new to platformio so maybe someone can correct me if needed :slight_smile:

I think the better solution for you, would be to create a json file for your custom board : Custom Embedded Boards — PlatformIO latest documentation

You can choose your chip/mcu by creating your custom json file.
For instance when picking NUCLEO-L476 as board, it chooses stm32l476rgt6 as mcu.

PlatformIO currently always needs a board definitionto work with. You cannot just choose a single MCU. However, many platforms have a genericXXX board variant that is pretty close to MCU-only. I’ve read on some github issue some time ago that PlatformIO thinks about making it able to create MCU-based projects, but I can’t find that comment anymore… I think you might want to open a formal issue in Issues · platformio/platformio-core · GitHub though.

I think creating new projects based on specified chips is a useful feature and it seems that the people who create Platform IO projects don’t understand the mindset of electronics engineers.
We electronic engineers always start with the design of PCB system based on the specified chip, we don’t care much about sample boards.