How to create "complex" project structures ?
Posted: Fri Sep 06, 2019 10:05 pm
Hi,
I am practically a newbie in the esp32 world and i am starting with esp-idf.
I am trying to learn make, cmake and esp-idf projects structure at least 2 weeks and i couldn't make the "complex structure" project compile yet.
The hello_world and sdio/host example compile just fine, and i was even able to integrate esp-idf into visual studio code.
Until jtag, openocd, gdb i managed to make it work inside the visual studio code and in my hardware.
All "process" below are working fine:
"build app"
"clean app"
"flash app"
"monitor"
"menuconfig"
"openocd"
At the beginning off all these learning curve, i was mixing document version, because i download the stable version v3.2.2 and i was searching by googling, which led me to different espressif documentation pages in each new search(latest idf version for example).
So i was mixing component.mk with CMakeLists.txt.
After the penny has dropped(i understant), i uninstalled all the old files of version v3.2.2 and all other tools and started a new installation from scratch with the latest version: v4.1-dev-141-ga7e8d87d3.
I am only using now the latest documentation on espressif site link: https://docs.espressif.com/projects/esp ... ystem.html, and trying to follow the project structure, but the documentation is complicated to me, because dont have examples.
I dont know what write inside the CMakeLists.txt(beyond the minimum) or in component.mk if i need yet this file.
The link site show "commands" but dont show command sintax with examples and where applicable, etc.
The hello_world example has a CMakeLists.txt in the main directory, but in the link above don't exists this file in project structure.
I am very confused.
I download a third party component and i am trying to adapter the component inside the espressif suggested structure.
The third party component has a "little long" subdirectory structure that makes sense to me.
How to tell the compiler the path or files to add to the compiling ?
There is a simple command like: add all subdirectory from "x" path ?
I need component.mk files yet or only CMakeLists.txt or i need both files in the project(dir and/or subdir) ?
Where to put this files and what write on them ?
Attached follows my entire project without the build directory.
I hope someone gives me a light at the end of the tunnel.
PS:
Why espressif doesn't adopt any open platform like netbeans and does everything "graphical" like MPLAB from microchip for example.
When i need to add a new file, the ide does all the work of adding whatever is needed to build files like makefile,
from what i understand, without the user having to understand the whole complex compilation process.
I know that understanding compilation tools is very powerful learning but it is a pain.
It is almost getting easier to program in assembly .
Thank's.
I am practically a newbie in the esp32 world and i am starting with esp-idf.
I am trying to learn make, cmake and esp-idf projects structure at least 2 weeks and i couldn't make the "complex structure" project compile yet.
The hello_world and sdio/host example compile just fine, and i was even able to integrate esp-idf into visual studio code.
Until jtag, openocd, gdb i managed to make it work inside the visual studio code and in my hardware.
All "process" below are working fine:
"build app"
"clean app"
"flash app"
"monitor"
"menuconfig"
"openocd"
At the beginning off all these learning curve, i was mixing document version, because i download the stable version v3.2.2 and i was searching by googling, which led me to different espressif documentation pages in each new search(latest idf version for example).
So i was mixing component.mk with CMakeLists.txt.
After the penny has dropped(i understant), i uninstalled all the old files of version v3.2.2 and all other tools and started a new installation from scratch with the latest version: v4.1-dev-141-ga7e8d87d3.
I am only using now the latest documentation on espressif site link: https://docs.espressif.com/projects/esp ... ystem.html, and trying to follow the project structure, but the documentation is complicated to me, because dont have examples.
I dont know what write inside the CMakeLists.txt(beyond the minimum) or in component.mk if i need yet this file.
The link site show "commands" but dont show command sintax with examples and where applicable, etc.
The hello_world example has a CMakeLists.txt in the main directory, but in the link above don't exists this file in project structure.
I am very confused.
I download a third party component and i am trying to adapter the component inside the espressif suggested structure.
The third party component has a "little long" subdirectory structure that makes sense to me.
How to tell the compiler the path or files to add to the compiling ?
There is a simple command like: add all subdirectory from "x" path ?
I need component.mk files yet or only CMakeLists.txt or i need both files in the project(dir and/or subdir) ?
Where to put this files and what write on them ?
Attached follows my entire project without the build directory.
I hope someone gives me a light at the end of the tunnel.
PS:
Why espressif doesn't adopt any open platform like netbeans and does everything "graphical" like MPLAB from microchip for example.
When i need to add a new file, the ide does all the work of adding whatever is needed to build files like makefile,
from what i understand, without the user having to understand the whole complex compilation process.
I know that understanding compilation tools is very powerful learning but it is a pain.
It is almost getting easier to program in assembly .
Thank's.