Skip to main content
ColaChugger
Associate II
November 5, 2019
Question

#include apparently not working; file format not recognized; a lot of confusion

  • November 5, 2019
  • 2 replies
  • 3713 views

I used cubeMX to generate code for the USB init. Somehow some #include calls are not working. They can't find the file. But if I ctrl+click I get directed to the correct file. I tried refreshing, rebuilding the index, open as admin and specificly adding the files as an include option in the preferences. Nothing worked. Then all of a sudden all hal-driver files produced errors. At some point it resolved itself(?) and then "core_cm7.h" gave me an error message because of a #error. And now I get this message:

0690X00000ArhCQQAZ.png

file format not recognized. What is happening?

I work on CubeIDE 1.1.0 and STM32h743.

This topic has been closed for replies.

2 replies

Ozone
Principal
November 5, 2019

When posting build errors, better include ALL output.

There is not much visible from the small screenshot you posted.

I hope you don't try to include object files (*.o) within C code.

Tesla DeLorean
Guru
November 5, 2019

The error isn't complaining about an #include file.

Don't screen-shot errors when you can cut-n-paste, or access the log output directly. Edit/redact as required.

Look at the object files enumerated in the objects.list file, and perhaps go and inspect the Core/Src/adc.o file and confirm it is a valid file, is of non-zero size, and has an ELF header. Use a File Manager to inspect the file, or dump it to the console.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
ColaChugger
Associate II
November 5, 2019

the objects.list seems like the root of the cause. Can I force Cube to remake that file or do I have to edit it manually?

Tesla DeLorean
Guru
November 5, 2019

Not using CubeMX or CubeIDE here.

adc.o is not an unreasonable name for an object for the linker to be pulling, why the object is missing/broken is another issue. Not sure if the makefile or the tool generates the object list, or if that is a one time thing, or dynamic. These things might become more apparent with some digging..

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..