Add support for NUCLEO-G491RE

As of today the NUCLEO-G491RE isn’t supported in mbed, support for the mcu already exists (TARGET_STM32G491xE) so adding board support shouldn’t be too complex.
Would someone from ST be able to add support? I could try adding the board target myself but not 100% sure how to do that.

Hello,

you could see - mbed-os/targets/TARGET_STM at master · ARMmbed/mbed-os (github.com)
There you will find all necessary things for how to do that like custom target.

BR, Jan

Oops, I didn’t saw that README, thanks!

Sorry to bother you again, I tried that; specifically I ran python targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py -t M43_Nucleo_NUCLEO-G491RE_STM32G491RE_Board_AllConfig.ioc and my custom_targets.json looks like this:

{
  "NUCLEO_G491RE": {
    "inherits": [
      "MCU_STM32G491xE"
    ],
    "supported_form_factors": [
      "ARDUINO_UNO"
    ],
    "device_name": "STM32G491RETx"
  }
}

But mbedtools compile -m NUCLEO_G491RE -t GCC_ARM fails with fatal error: mbed_rtx.h: No such file or directory.
The board definition is more or less copied from NUCLEO_G474RE, that board builds fine though.
Do you have any clues on what I’m doing wrong?
Thanks in advance,
Augusto

I don’t know how your custom target project looks like, but it must look like this

custom

In your case the folder name Custom will be you project name and TARGET_TEST folder name will be replaced by TARGET_NUCLEO_G491RE. This folder need to be filled with all 3 files what you see.
Files around pins you have from the .py script, but these files still need a correction. But because TARGET_STM32G491xE target folder does not contain clock settings, then you need to make also clock settings. As a template you can use a system_clock.c file from another Nucleo-G4xx, but correct clock settings you need to take from STM32CubeMX.

BR, Jan

I think I got it to compile finally, I was missing a add_subdirectory(TARGET_NUCLEO_G491RE EXCLUDE_FROM_ALL) in my projects CMakeLists.txt, I’ll be doing more tests tomorrow probably.

Oh, you use Cmake, I did not know that.

BR, Jan

hi Augusto Zanellato,

IS it possible to share the final working steps so that I can revalidate the steps and get it working on my setup too. Thanks in advance.