cancel
Showing results for 
Search instead for 
Did you mean: 

Using STM32CubeIDE when I configure the TIM pins in a certain way, activating TIM22_CH2 and TIM3_CH4 I can't compile the generated code. Is there something I have done wrong or is this a bug?

HDuns
Associate

I have attached the .ioc file I use with my STM32L071RBTx chip if you try to compile the generated code from the .ioc file you should be able to reproduce the issue.

This is the error message I'm getting:

16:16:20 **** Clean-only build of configuration Debug for project test222 ****

make -j12 clean 

rm -rf *

16:16:20 Build Finished. 0 errors, 0 warnings. (took 316ms)

16:16:20 **** Incremental Build of configuration Debug for project test222 ****

make -j12 all 

arm-none-eabi-gcc -mcpu=cortex-m0plus -g3 -c -I../ -x assembler-with-cpp --specs=nano.specs -mfloat-abi=soft -mthumb -o "Startup/startup_stm32l071rbtx.o" "../Startup/startup_stm32l071rbtx.s"

arm-none-eabi-gcc "../Src/gpio.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/gpio.d" -MT"Src/gpio.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/gpio.o"

arm-none-eabi-gcc "../Src/main.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/main.d" -MT"Src/main.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/main.o"

arm-none-eabi-gcc "../Src/stm32l0xx_hal_msp.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/stm32l0xx_hal_msp.d" -MT"Src/stm32l0xx_hal_msp.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/stm32l0xx_hal_msp.o"

arm-none-eabi-gcc "../Src/stm32l0xx_it.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/stm32l0xx_it.d" -MT"Src/stm32l0xx_it.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/stm32l0xx_it.o"

arm-none-eabi-gcc "../Src/syscalls.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/syscalls.d" -MT"Src/syscalls.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/syscalls.o"

arm-none-eabi-gcc "../Src/sysmem.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/sysmem.d" -MT"Src/sysmem.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/sysmem.o"

arm-none-eabi-gcc "../Src/system_stm32l0xx.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/system_stm32l0xx.d" -MT"Src/system_stm32l0xx.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/system_stm32l0xx.o"

arm-none-eabi-gcc "../Src/tim.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/tim.d" -MT"Src/tim.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Src/tim.o"

arm-none-eabi-gcc "../Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.d" -MT"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.o"

arm-none-eabi-gcc "../Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.d" -MT"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_cortex.o"

arm-none-eabi-gcc "../Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.d" -MT"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.o"

arm-none-eabi-gcc "../Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32L071xx -c -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.d" -MT"Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash.o"

../Src/tim.c: In function 'MX_TIM3_Init':

../Src/tim.c:60:37: error: 'TIM3_TI4_GPIOC9_AF2' undeclared (first use in this function); did you mean 'TIM3_TI2_GPIOB5_AF4'?

  if (HAL_TIMEx_RemapConfig(&htim3, TIM3_TI4_GPIOC9_AF2) != HAL_OK)

                   ^~~~~~~~~~~~~~~~~~~

                   TIM3_TI2_GPIOB5_AF4

../Src/tim.c:60:37: note: each undeclared identifier is reported only once for each function it appears in

../Src/tim.c: In function 'MX_TIM22_Init':

../Src/tim.c:97:38: error: 'TIM3_TI4_GPIOC9_AF2' undeclared (first use in this function); did you mean 'TIM3_TI2_GPIOB5_AF4'?

  if (HAL_TIMEx_RemapConfig(&htim22, TIM3_TI4_GPIOC9_AF2) != HAL_OK)

                   ^~~~~~~~~~~~~~~~~~~

                   TIM3_TI2_GPIOB5_AF4

make: *** [Src/subdir.mk:53: Src/tim.o] Error 1

make: *** Waiting for unfinished jobs....

"make -j12 all" terminated with exit code 2. Build might be incomplete.

16:16:21 Build Failed. 4 errors, 0 warnings. (took 1s.120ms)

I'm using the GNU11 compiler and STM32CubeIDE v1.0.2

3 REPLIES 3
APavl.10
Associate

Hi, HDuns!

I met the same problem. Did you solve it?

Cartu38 OpenDev
Lead II

Works like a charm if 1.6.1 based on shared .ioc file.

0693W00000BaFebQAF.jpg 

@APavl.10​ which release are you relying on ... @Hampus Dunström​ post is quite old one (1.0.2 release based ...)

Based on promoted .ioc file I've selected migration path allowing to rely on most up to date material what's definitively solving trouble (able to reproduce initial issue if selecting 'Continue')

0693W00000BaFfGQAV.jpg

Mike_ST
ST Employee

Hello,

It seems like there was a problem in 1.11.x, a TIM3 define was under USB switch:

stm32l0xx_hal_tim_ex.h:

#if defined(TIM3)

#if defined(USB)

#define TIM3_TI4_USB_NOE                 0x00000000U                              /*!< USB_NOE selected selected for PC9 (AF2) remapping */

#define TIM3_TI4_GPIOC9_AF2              TIM3_OR_TI4_RMP                          /*!< TIM3_CH4 selected for PC9 (AF2) remapping */

#endif /* USB */

In 1.12.0 it has been moved:

stm32l0xx_hal_tim_ex.h:

#if defined(TIM3)

#if defined(USB)

#define TIM3_TI4_USB_NOE                 0x00000000U                              /*!< USB_NOE selected selected for PC9 (AF2) remapping */

#endif /* USB */

#define TIM3_TI4_GPIOC9_AF2              TIM3_OR_TI4_RMP                          /*!< TIM3_CH4 selected for PC9 (AF2) remapping */