0

I recently installed cubeMX to use freeRTOS on STM32 controller.

HAL_GPIO_TogglePin(GPIOB, GPIO_Pin_12);

If I type out the above I get an error. If I have Eclipse auto complete the code I get the same error. If I type out the code in visual studio and copy it into Eclipse everything works ok.

Error:

../Core/Src/main.c:296:30: error: 'GPIO_Pin_12' undeclared (first use in this function); did you mean 'GPIO_PIN_12'?

296 | HAL_GPIO_TogglePin(GPIOB, GPIO_Pin_12); //Generated by cubeMX

enter image description here

ROVguy
  • 13
  • 4
  • After posting, I noticed that the auto generated code has Pin and not PIN at the end. The working version is all uppercase. – ROVguy Sep 15 '22 at 01:13
  • So just a typo, right? Are there reasons to keep the question and that you don't delete it? – howlger Sep 15 '22 at 07:30
  • Yes it's a typo, but it's an Eclipse(cubeMX) generated typo. Is there a way to fix that? – ROVguy Sep 30 '22 at 17:19
  • I don't know CubeIDE. You might ask here https://community.st.com/s/topic/0TO0X000000y2j7WAA/stm32cubeide – howlger Oct 01 '22 at 11:31

0 Answers0