2022-09-18 08:36 PM
This is the sample error that pops up. How can I fix this? I'm very new to this so I'm not very familiar with this error. Hope that someone could help me with this. Tell me what else I need to provide so you can help me better.
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:96: undefined reference to `HAL_GPIO_Init'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:98: undefined reference to `HAL_GPIO_WritePin'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:99: undefined reference to `HAL_Delay'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:100: undefined reference to `HAL_GPIO_WritePin'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:102: undefined reference to `HAL_GPIO_WritePin'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:104: undefined reference to `HAL_GPIO_WritePin'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:129: undefined reference to `HAL_GPIO_WritePin'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /Users/nyo/STM32CubeIDE/workspace_1.10.1/0_testagain/Debug/../Src/gpio.c:131: undefined reference to `HAL_GPIO_WritePin'
2022-09-20 03:55 AM
Welcome, @Niño Adrian Pineda, to the community!
obviously there are calls to the HAL in your project, but the HAL is not referenced to the project or not yet accessible. You should consult the board manufacturer's documentation, which probably contains instructions on how to create a project for your board or how to include the HAL.
Regards
/Peter
2022-09-25 10:04 PM
Hello Peter,
It is already resolved thank you!
But I have another problem encountered. I will attach a picture of the error. I'm using STMcubeIDE on macOS.
2022-09-26 12:10 AM
Presumably this is an already prepared project that has been set up on a Windows computer. The person had inserted a command to create a HEX from the ELF file that uses a Windows executable, which of course does not work on your Mac.
However, it is not necessary to do this there as a post-build command (already because of the platform dependency), so you can simply delete that command:
Project > Properties > C/C++ Build > Settings > Build Steps > Post-build steps > Command
The STM32CubeIDE offers a dedicated option for this:
Project > Properties > C/C++ Build > Settings > Tool Settings > MCU Post build options
and tick Convert to Intel Hex file
Good luck!
/Peter