platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
405 stars 312 forks source link

Request support for GENERIC STM32G4 mcu's. #711

Open darkomenz opened 1 year ago

darkomenz commented 1 year ago

Hello Team,

Can we add support for the STM32G4 line of MCU's? No generic board profiles seem to exist for these at this time.

Regards

jcw commented 1 year ago

It looks like this is ok by now:

$ pio boards g4

Platform: ststm32
=====================================================================================
ID                  MCU            Frequency    Flash    RAM    Name
------------------  -------------  -----------  -------  -----  ---------------------------------
nucleo_g431kb       STM32G431KBT6  170MHz       128KB    32KB   Nucleo G431KB
nucleo_g431rb       STM32G431RBT6  170MHz       128KB    32KB   Nucleo G431RB
nucleo_g474re       STM32G474RET6  170MHz       512KB    128KB  Nucleo G474RE
disco_b_g431b_esc1  STM32G431CBU6  170MHz       128KB    32KB   ST B-G431B-ESC1 Discovery
genericSTM32G431CB  STM32G431CBU6  170MHz       128KB    32KB   STM32G431CB (32k RAM. 128k Flash)
darkomenz commented 11 months ago

@jcw I see only one generic stm32g4 listed. There are many more in the product range.

darkomenz commented 11 months ago

image image

jcw commented 11 months ago

It's not hard to support other variants:

  1. fetch and rename https://github.com/platformio/platform-ststm32/blob/master/boards/genericSTM32G431CB.json
  2. adjust info to match you project's requirements
  3. place it in a boards/ directory inside your project

See also https://docs.platformio.org/en/latest/projectconf/sections/env/options/platform/board.html