Skip to main content
Associate II
February 20, 2025
Solved

adding external source file to touchGFX porject

  • February 20, 2025
  • 2 replies
  • 1220 views

Hi Team,

"I'm working on a TouchGFX project that was generated using the TouchGFX Designer. I need to add source files for USB functionality. I tried adding the .c and .h files to the Core/Src and Core/Inc directories, but I'm getting an error stating that the files cannot be found. How can I properly add .c and .h files to a TouchGFX project?

Also, I am highlighting the place where I want my source file in a screenshot."

usb prob.png

 

I have a folder named TCOMP that contains .c and .h files. I also tried adding this folder to my project by updating Paths and Symbols under Properties > C/C++ General, but I'm still encountering the same error. How can I correctly include these files in my project?


Thanking you in advance

    This topic has been closed for replies.
    Best answer by Elhem_ZAY

    hello,
    to add file source file .c in STM32CubeIDE you can add it manually :
    - right click on USB_HOST 
    - select New > File

    Elhem_ZAY_0-1740063325158.png

    - select "<<Advanced" and check "link to file in the file system" 

    - after that you can Browse your file source  that you want 

    Elhem_ZAY_2-1740063562570.png

    Best regards.
    Elhem.

     

    2 replies

    Elhem_ZAYBest answer
    ST Employee
    February 20, 2025

    hello,
    to add file source file .c in STM32CubeIDE you can add it manually :
    - right click on USB_HOST 
    - select New > File

    Elhem_ZAY_0-1740063325158.png

    - select "<<Advanced" and check "link to file in the file system" 

    - after that you can Browse your file source  that you want 

    Elhem_ZAY_2-1740063562570.png

    Best regards.
    Elhem.

     

    naveenAuthor
    Associate II
    February 21, 2025

    hello, thank you for the response. i have followed the step as you mentioned, now iam not getting error where file not found. but small issue again here.

    after added that source file i been calling a function from that source to in "USBH_UserProcess", when iam doing this USB is not detecting. debugger not even crossing the break pointer, but if i removed that calling function then everything is working as expected. can you tell me whats happing here.

    I Have added some screen short for your reference.
    Screenshot 2025-02-21 104819.png

    also i have observed one thing,

    you can see those two highlighted places in my code in which case called "HOST_USER_CONNECTION",

    working fine when i call the same function dummyfile() in this case, but if i call the dummyfile() function in any another case the interrupt is not triggering. can you tell me anything i been missing here.
    thanking you 
    Regards,
    Naveen Palle.