Firmware compile error Raspberry and visual studio


#1

I tried to compile and flash the firmware on Windows with Visual Studio. When I try to build firmware I get the following error

_> Executing task in folder Firmware: make -j4 <_

_Het systeem kan het opgegeven pad niet vinden._
_Middlewares/Third_Party/FreeRTOS/Source/list.c:238:1: fatal error: opening dependency file .dep/list.o.d: No such file or directory_
_ }_
_ ^_
_compilation terminated._
_make: *** [build/list.o] Fout 1_
_make: *** Wachten op onvoltooide taken..._
_Middlewares/Third_Party/FreeRTOS/Source/event_groups.c:714:1: fatal error: opening dependency file .dep/event_groups.o.d: No such file or directory_
_ }_
_ ^_
_compilation terminated._
_make: *** [build/event_groups.o] Fout 1_
_Middlewares/Third_Party/FreeRTOS/Source/queue.c:2351:2: fatal error: opening dependency file .dep/queue.o.d: No such file or directory_
_  } /*lint !e818 xQueue could not be pointer to const because it is a typedef. */_
_  ^_
_compilation terminated._
_make: *** [build/queue.o] Fout 1_
_Middlewares/Third_Party/FreeRTOS/Source/tasks.c:4801:1: fatal error: opening dependency file .dep/tasks.o.d: No such file or directory_
_ }_
_ ^_
_compilation terminated._
_make: *** [build/tasks.o] Fout 1_
_The terminal process terminated with exit code: 2_

Then I tried the .elf file (subject :looking for compiled firmware) and placed it in the build directory

After trying to flash I got in then openocd.log

_Info : Listening on port 6666 for tcl connections_
_Info : Listening on port 4444 for telnet connections_
_Info : Unable to match requested speed 2000 kHz, using 1800 kHz_
_Info : Unable to match requested speed 2000 kHz, using 1800 kHz_
_Info : clock speed 1800 kHz_
_Error: libusb_open() failed with LIBUSB_ERROR_ACCESS_
_Error: open failed_
_in procedure 'init' _
_in procedure 'ocd_bouncer'_

Possibly the visual studio release is too new (2018-01-18)

I have also a raspberry pi. I was able to create an .elf file but uploading wouldn’t work. Somewhere I read that someone had the same kind of problems due to an old version of linux. I renewed the Linux version from jessie to stretch.
Trying to run make got the following error

In file included from MotorControl/commands.cpp:9:0:
MotorControl/commands.h:9:22: fatal error: functional: No such file or directory
compilation terminated.
Makefile:166: recipe for target 'build/commands.o' failed
make: *** [build/commands.o] Error 1

Just for the hack I commented out that line, and the I got

MotorControl/commands.h:10:18: fatal error: limits: No such file or directory
compilation terminated.

Probably there are more files missing

Is there a better way to go?


#2

I have the same errors with VS Code on windows. As on linux I don’t have any problem to compile and flash I took the folder with the .elf on VS Code and after I can modify the code and build/flash without error.
I don’t know the reason of this errors but now I can use VS Code and not stay blocked. I hope that it can help you… and I am interested too to know why the compilation crash on VS Code windows.


#3

Can you please try to run make clean then make -j4 in the Firmware folder with a bash terminal (such as Git Bash)?


#4

More or less the same problem. It must be the RPI version because I made a bootable USB-memory stick with Ubuntu, and all worked like a charm. So my problem is solved for now.

I still have to test if actually works but compiling and uploading is ok.
Just for the sake of it, is there anyone who could compile and upload it with VS?

pi@raspberrypi:~/ODrive/Firmware $ make clean
rm -fR .dep build
pi@raspberrypi:~/ODrive/Firmware $ make -j4
mkdir -p build
In file included from MotorControl/commands.cpp:9:0:
MotorControl/commands.h:10:18: fatal error: limits: No such file or directory
compilation terminated.
Makefile:166: recipe for target ‘build/commands.o’ failed
make: *** [build/commands.o] Error 1
make: *** Waiting for unfinished jobs…
pi@raspberrypi:~/ODrive/Firmware $


#5

Sorry, I meant to ask if you can get compilation in bash to work on Windows. I’m glad you got it to work somehow though ;D


#6

Ok, I did, and that worked fine. It was even possible to use Visual Studio to debug after compiling and flashing Thank you. I still have problems with using the controller but I have to learn how it works. I have to study the community’s discussions first but if I can’t find a solution I’ll start a new thread.