Modify a CMakeLists.txt that is managed automatically

jimmi2
Posts: 1
Joined: Tue Mar 26, 2024 12:45 pm

Modify a CMakeLists.txt that is managed automatically

Postby jimmi2 » Tue Mar 26, 2024 1:50 pm

I'm trying to get the i80_controller example running on a proprietary system using a AVD-TT35HV-NN-002-S TFT. This TFT uses the ST7796 display controller and the FT6536 capacitive touch controller. I'm using idf v2.5.1 and idf.py from the Ubuntu command line.
I have successfully added the ST7796 component to my project and the TFT is working.
I have used the FT5x06 to configure the project's touchscreen but there are some control position issues so I thought to use the ESP registry's "fasani/ft6x36-l58^1.3.0" component in hopes of clearing this up.

I used the ESP Registry's suggested command, idf.py add-dependency "fasani/ft6x36-l58^1.3.0". I modified the ../main/Kconfig.projbuild to include a EXAMPLE_LCD_TOUCH_CONTROLLER_FT6X36 in the choice EXAMPLE_LCD_TOUCH_CONTROLLER block. I used idf.py menuconfig to get the FT6x36 defined in the project and then modified the i80_controller_example_main.c to make use of it.

When I did a idf.py build, I got the following error:
In file included from /home/jim/esp/v5.2.1/i80_controller_2/managed_components/fasani__ft6x36-l58/L58Touch.cpp:4:
/home/jim/esp/v5.2.1/i80_controller_2/managed_components/fasani__ft6x36-l58/include/L58Touch.h:8:10: fatal error: driver/gpio.h: No such file or directory
8 | #include "driver/gpio.h"
| ^~~~~~~~~~~~~~~
compilation terminated.

I understand that I have to use a REQUIRES driver in the:
.../managed_components/fasani_ft6x36-i58/CmakeLists.txt for the idf_component_register command and I have done that.

However, when I build with this modified /managed_components/fasani_ft6x36-i58/CmakeLists.txt, I get the following error:
Processing 9 dependencies:
[9/9] lvgl/lvgl (8.3.11)CMake Error at /home/jim/esp/v5.2.1/esp-idf/tools/cmake/build.cmake:544 (message):
ERROR: Some components (fasani/ft6x36-l58) in the "managed_components"
directory were modified on the disk since the last run of the CMake.
Content of this directory is managed automatically.

If you want to keep the changes, you can move the directory with the
component to the "components"directory of your project.

I.E. for "fasani__ft6x36-l58" run:

mv
/home/jim/esp/v5.2.1/i80_controller_2/managed_components/fasani__ft6x36-l58
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58

Or, if you want to discard the changes remove the ".component_hash" file
from the component's directory.

I.E. for "fasani__ft6x36-l58" run:

rm
/home/jim/esp/v5.2.1/i80_controller_2/managed_components/fasani__ft6x36-l58/.component_hash


Call Stack (most recent call first):
/home/jim/esp/v5.2.1/esp-idf/tools/cmake/project.cmake:605 (idf_build_process)
CMakeLists.txt:5 (project)

My question is, How do I modify and maintain the modifications to a CMakeLists.txt that is managed automatically?

When I create a components directory and move fasani__ft6x36-l58 into it, a build results in:

/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp: In member function 'TPoint L58Touch::scanPoint()':
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp:176:31: error: 'esp_timer_get_time' was not declared in this scope
176 | _touchStartTime = esp_timer_get_time()/1000;
| ^~~~~~~~~~~~~~~~~~
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp:179:29: error: 'esp_timer_get_time' was not declared in this scope
179 | _touchEndTime = esp_timer_get_time()/1000;
| ^~~~~~~~~~~~~~~~~~
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp: In member function 'void L58Touch::writeRegister8(uint8_t, uint8_t)':
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp:230:49: error: 'portTICK_RATE_MS' was not declared in this scope; did you mean 'portTICK_PERIOD_MS'?
230 | i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS);
| ^~~~~~~~~~~~~~~~
| portTICK_PERIOD_MS
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp: In member function 'uint8_t L58Touch::readRegister8(uint8_t, uint8_t*)':
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp:256:65: error: 'portTICK_RATE_MS' was not declared in this scope; did you mean 'portTICK_PERIOD_MS'?
256 | esp_err_t ret = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS);
| ^~~~~~~~~~~~~~~~
| portTICK_PERIOD_MS
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp: In member function 'void L58Touch::readBytes(uint8_t*, int)':
/home/jim/esp/v5.2.1/i80_controller_2/components/fasani__ft6x36-l58/L58Touch.cpp:278:65: error: 'portTICK_RATE_MS' was not declared in this scope; did you mean 'portTICK_PERIOD_MS'?
278 | esp_err_t ret = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS);
| ^~~~~~~~~~~~~~~~
| portTICK_PERIOD_MS

I don't understand why the ESP Registry's fasani/ft6x36-l58^1.3.0 would be this difficult to integrate into a project. Do I have to figure out these errors or am I doing something wrong with adding a componet to managed_components?

chegewara
Posts: 2240
Joined: Wed Jun 14, 2017 9:00 pm

Re: Modify a CMakeLists.txt that is managed automatically

Postby chegewara » Wed Mar 27, 2024 3:51 am

Hi,
did you read description of this library?
ATTENTION!
Only basic functionality is currently implemented. Has been tested only on ESP32 using a 2.7" e-ink display (GDEW027W3-T). This will work only as a compoment in the ESP-IDF framework. If you are looking for an arduino-esp32 version check the original FT6X36 library This was tested and works correctly with ESP-IDF v. 4.2 on 4.4 there is still some I2C configuration bug that needs to be addressed. It could not instantiate correctly I2C in 4.4 giving a strange error that SDA & SDL pins are the same (They are not). Updating the idf branch to release/v4.2 it worked again as expected.
It is not working with esp-idf 5.2, because there is many break changes in esp-idf which are not addressed by library.

Who is online

Users browsing this forum: No registered users and 165 guests