cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to change peripheral instance name?

PMach.3
Associate II

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 discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
KnarfB
Principal III

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