2024-03-14 12:44 AM
Hi all,
Im having problems with my IDE, I cant seem to add the stm32f407xx.h library to my project, which is an internal library provided by ST. I added it to the linker GCC both the path to the file directory and the file itself and its still not accepted by the compiler.
Solved! Go to Solution.
2024-03-14 06:43 AM
Hello,
Is that possible to attach your project?
2024-03-14 07:19 AM
2024-03-14 08:53 AM
Your project structure is missing the drivers: CMSIS and HAL:
I invite you to look at one of the examples provided by STM32CubeF4:
example: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI to show how a project is structured.
Or simply generate the code with CubeMx. It will generate all the needed drivers' files.
PS: looking at your main.c file: I don't recommend to start with direct access to the registers from the beginning. Start by using HAL then switch for an optimization as you did.
2024-03-14 09:11 AM
Meanwhile, I tried to let your project compile (in attachment). This doesn't mean it the project will run well as I didn't test it.
Again, this is not the common structure of an STM32. Just I added the missed files under \Inc folder.
Hope it helps.
PS: if the attached example does not run as expected, please open a new thread.
2024-03-14 11:43 PM
Thanks for the support.
I started using direct access because I simply taught thats how most embedded C developers work. I dont know if companies prefer to use the HAL drivers or they directly write data to the registers.
I'm currently a test engineer in electronics, and would like to be a embedded C developer, if you have any tips I would appreciate it!
Thank you,
Best Regards