Closed YaoweiFan closed 4 months ago
You copied way too much from the test project. It may be better to check these files as a good starting points for a "real" project (as opposed to the test application used for development):
https://github.com/DISTORTEC/distortosTemplateSubfolder/blob/master/CMakeLists.txt (a bare minimum of what is needed) https://github.com/DISTORTEC/STM32F7-ETH-LAN8720A-lwIP-MQTT/blob/master/CMakeLists.txt https://github.com/DISTORTEC/STM32F7-USB-host-ME906-lwIP-MQTT/blob/master/CMakeLists.txt
The main problem in the file you posted is here:
add_executable(my-project EXCLUDE_FROM_ALL
The executable is excluded from "all" ("all" target is built when you don't specify any specific target - as in your case). If you would run ninja my-project
instead of just ninja
, then CMake would try to build this executable, along with the *.hex
file.
But even if you would remove that EXCLUDE_FROM_ALL
, it may still not build, because you include sources of the test application (all the include(distortos/test/...
lines and also all the *.cpp
files you copied from the test app), so there may be some issues in the sources.
Generally the test application is not the best example of how to use distortos in a real project. If the examples I posted above are also not helpful, let me know, post what you have and I'll help you with any issues you may face (;
I have followed the article -- Configuring and building a distortos-based project to build my project. The content of 'CMakeLists.txt' file is as follows:
I successfully build this project. The output of command 'ninja' is:
My problem is why I can't find '.hex' file in my ’output‘ directory? How can I burn the program to the chip? I am a newbie in this area. Could you give me some advice to quickly get familiar with it? Thank you very much.