Skip to main content
PMach.3
Associate
March 30, 2023
Question

Is it possible to change peripheral instance name?

  • March 30, 2023
  • 1 reply
  • 1149 views

Hi,

 

I'm developing some firmware having in mind a possible future need for portability. Being so, I thought about labeling pinouts on the Device Configuration Tool (DCT) and generate code (in the future, giving the same pin names to different pin groups should work).

 

However, I can't see a way to do the same with peripheral instances. For example, if I choose TIM6 on some uC and would like to choose (for whatever reason) TIM2 on another uC and with the same configuration, I would like to label them the same (MY_TIMER, or so) so I could adapt the firmware more easily.

 

In short, I wanted to generate from DCT or Cube MX the same peripheral configurations, with the ability to change the peripherals without changing the label.

 

Is this possible?

 

Thanks in advance

This topic has been closed for replies.

1 reply

KnarfB
Super User
March 30, 2023

Don't think that this is possible for generated code. Some board support package (BSP) drivers demonstrate how it could be done with hand-written code: https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/BSP/STM32F4-Discovery/stm32f4_discovery.h

hth

KnarfB