Skip to main content
Karan 123
Senior
May 14, 2020
Question

TouchGFX integration with Middlewares : USB Mass Storage and microSDCard.

  • May 14, 2020
  • 17 replies
  • 3918 views

Hi,

I am working on below setup:

Software Tool Chain:

STM32CubeMX 5.6.0

TouchGFX 4.13.0 Designer

STM32CubeIDE 1.3.0

STM32F746G Discovery Kit v3.0.1 (AT)

Hardware:

STM32F746G-DISCO (Discovery Board)

USB Mass Storage Drive (32 GB)

microSDCard (64 GB)

I have gone through below link studied and implemented examples given there.

https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/backend-communication/

with ADC and UART with TouchGFX.

I got (think) the most efficient way is to use TouchGFX Ecosystem with FreeRTOS MVP .

Now I have to integrate Middleware like USB Mass Storage Device , SDCARD FAT32 +exFAT

with TouchGFX GUI.

Unfortunately, There is no example so for on touchgfx.com.

In my application, I have to copy File from USB Mass Storage to SDCard with TouchGFX GUI (Scroll List) with Add/remove feature .

USB Mass Storage and SDCard with FATFS + exFAT works well without TouchGFX .

How to I transfer "File Names" from USB Mass Storage to TouchGFX GUI scroll list?

So for simplicity, I have created array in main.c then try to transfer to GUI Scroll List Items.

But so far there is no example I have seen on touchgfx website, Is this the prefect/right method of not ?

I have written some steps as attachment .

Please advice how to proceed this ..

Thank in advance ..

--

Karan

This topic has been closed for replies.

17 replies

Karan 123
Karan 123Author
Senior
May 14, 2020

I mean to say that how to propagate data (Array -2D) File Name in my case :

From

Application data (File Names) -> Model -> Presenter -> view -> Scroll List Items(Custom Container)

and

Scroll List Item -Select any one) (Custom Container) -> view -> Presenter -> Model -> Application

For further processing..

Alexandre RENOUX
Visitor II
May 18, 2020

Hello,

I don't completely understand your problem.

Can you read from your USB storage and write to your SDCard ? Can you access the names of the files stored in the USB storage ?

If you can, then the documentation you linked yourself should help you bring this information to your UI (https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/backend-communication/).

You are talking about if it's the perfect method but does your method works ? Why do you think your method is not correct ?

/Alexandre

Karan 123
Karan 123Author
Senior
May 18, 2020

Thanks for your time and reply.

"I don't completely understand your problem."

->The problem is integration with Middleware with TouchGFX . I have worked on GUI application development with some others MCUs (not ST) and their libraries but without RTOS .

Can you read from your USB storage and write to your SDCard ? Can you access the names of the files stored in the USB storage ?

->Yes , I am able to read files names from USB storage and then save the SDCard perfectly with Serial Terminal as Output and mechanical Push Button without TouchGFX.

https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/backend-communication/

The above is good reference interfacing TouchGFX with Mechanical User button , LED only exchange single bit only with FreeRTOS Queue .

I have also managed to interface LED and Hardware Push Button with TouchGFX Button and ​TextArea Successfully with FreeRTOS Queue.

I am seeking example program or How I can do

To propagate data (Array -2D) File Name in from Application data (File Names) -> Model -> Presenter -> view -> Scroll List Items(Custom Container). 

and Scroll List Item -Select any one) (Custom Container) -> view -> Presenter -> Model -> Application

For further processing..

"You are talking about if it's the perfect method but does your method works ? Why do you think your method is not correct ?"

->But I don't have any experience on RTOS ( FreeRTOS in this case ) . Quite new for propagating the data (Array -2D) File Name in my case.

Because of no experience , I have not tested yet.

Thanks for your concern..Hope Now I am clear to you..

--

Karan

Alexandre RENOUX
Visitor II
May 19, 2020

Hello,

Yes I think I understand your problem more.

From what I can see the only thing that is not explained in the Backend Communication Documentation page ( https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/backend-communication/ ) is the sending of strings in a queue from your secondary task to your Model::tick() because the examples show only simple data communication like a button state or a led state.

We don't have any examples where we send arrays of strings from one task to another.

Therefore, to send a string you need to create your queue accordingly like:

xQueueCreate(9, sizeof(char)); // 9 corresponds to size of string
 
const char *fileName1=�?Hello.png�?;
 
/* Queue a pointer. */
 
xQueueSend(gui_msg_q, &fileName1, 0);

For an array of strings, I guess doing as follows would work:

xQueueCreate(MaxStringNamelength, sizeof(char));
 
const char fileNames[nbOfFiles][MaxStringNamelength]={�?Hello.png�?, "TouchGFX.txt",...};
 
/* Queue a pointer. */
 
for(...)
{
 xQueueSend(gui_msg_q, &fileNames[i], 0);
}

Anyway you should also try your approach nonetheless and see if it reports any errors.

You can also remove FreeRTOS if you are more comfortable like this. TouchGFX can run on bare metal.

/Alexandre