<< return to Pixycam.com

source code compiling error

I tried to use keil uVision5 to compiling the source codes got from https://github.com/charmedlabs/pixy, but i always got a error

main_m4.cpp(41): error: #5: cannot open source input file “m0_image.c”: No such file or directory

where i can find the m0_image.c file as the main_m4.cpp need to included it #include “m0_image.c”

Thank you

The order in which you compile the sub-projects matters. I’m not at my dev computer so I can’t tell you for sure, but I believe the order is:

  1. libpixy_m0
  2. libpixy_m4
  3. m0
  4. video

Also, make sure you’re using the uVision project files in the repo, there are some very important configurations in there.

The m0 project generates m0_image.c, which is required for the video project. This is due to the way code is loaded on to the m0 side. For some reason the designers thought it would be a good idea to load the m0 machine code from a string in C code on the m4 side and transfer it to the m0 side. That might not make sense, so I’d suggest looking at “main_m4.cpp”:https://github.com/charmedlabs/pixy/blob/5cd4c6ba4b8080c1381af82c8dce89063687465e/device/video/main_m4.cpp and the “pixyInit”:https://github.com/charmedlabs/pixy/blob/d19c619a1234cb067ebd4aebfbbaa04b618d611e/device/libpixy/pixy_init.cpp that gets called in main. Notice how m0_image.c is included in main_m4.cpp, this is where the m0 code is stored.

Scott

Hi Scott,

Thank you, i fixed it :slight_smile:

Best regards,