Reputation: 11
I'm trying to do the project from this video but my first include for gpio.h keeps getting the error
"include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/cole/bare-metal-series/app/src/firmware.c).C/C++(1696) cannot open source file "libopencm3/stm32/gpio.h"C/C++(1696)"
I downloaded the libopencm3 file declared it the submodule and activated the makefile so I'm not sure what else I'm supposed to do.
enter image description here enter image description here
It works if I do it using platformIO but then it gives me an error where it says my 99-platformio-udev.rules is out of date even though I just downloaded it. I think its because I'm on an Ubuntu which I have found to be very weird with usb-c (my labtop doesn't have a regular usb) permissions.
Upvotes: 1
Views: 101
Reputation: 41
This problem solving with two step ;
Step one :
This problem occurs cause of include problems. U should find
c_cpp_properties.json
file. u canctrl
+shift
+p
in Visual Studio Code, then searchC/C++ : Edit Configurations (JSON)
Then add
"${workspaceFolder}/libopencm3/include"
this in the"includePath"
array. I will attach a image for you.
And after that your error goes on but problem did not solved clearly.
Step two
If you check rcc.h from github and gpio.h you will see only macro definitions for
board
-library
. So if you did not define any board in your code you should do#include<libopencm3/stm32/f4/rcc.h>
and#include <libopencm3/stm32/f4/gpio.h>
in your working C file. And you can use all things from library. I will attach one more photo below that. Good luck
Upvotes: 0