2020-04-26 09:55 PM
Hi,
I am working on below setup:
Software Tool Chain:
STM32CubeMX 5.6.0
STM32CubeIDE 1.3.0
TouchGFX 4.13.0 Designer
Application Template STM32F746G Discovery Kit v3.0.1
I am trying to do send/receive messages with Message Queues.
1) From TouchGFX Toggle Button to LED.
2) From Hardware Button to Text Area
as per below thread.
Program Successfully Build . But Still not succeeded to Work on Actual Hardware.
1) From TouchGFX Toggle Button to LED.
LED is not OFF/ON with TouchGFX Toggle Button
2) From Hardware Button to Text Area Update
HardFault and/or MemManage_Handler
Because I have changed priorities and Heap .
Can anybody look attachment ? Guide me What needs to be correct ?
To solve the problem .
--
Karan
Solved! Go to Solution.
2020-04-27 06:36 PM
This is not due to a bug, it's a hardware/OS configuration issue - we just have to find it. The GUI isn't even in play yet here.
2020-04-27 06:39 PM
To make things a bit easier, maybe check out some of the CubeFW GPIO examples or even the example i made for the "Integratiing UI and Hardware" webinar in the top sticky.
E.g. start by sampling directly in the GUI Task ( Model::tick() ) before FreeRTOS is in play. Then move on to interrupt based / FreeRTOS Queue based.
/Martin
2020-04-27 09:08 PM
Hi,
@Martin KJELDSEN (ST Employee) Thanks for update ..
The below code without TouchGFX Works well..
while(1)
{
if ( HAL_GPIO_ReadPin (BUTTON_GPIO_Port, BUTTON_Pin) == GPIO_PIN_SET )
{
HAL_GPIO_TogglePin(LED_GPIO_Port , LED_Pin) ;
HAL_Delay(300) ;
printf("HELLO \r\n") ;
}
}
But Code worked on simulator Updating TextArea WildCard Perfectly ..
I have made some changes/correction in code attached at Msg #1.
After doing some experiments cause to Fault Situations.
( xQueueReceive(ButtonQueueHandle, &msg , (TickType_t)10) == pdTRUE)
Please Find updated files as works on simulator and touchgfx simulated short video..
as below method.. as per you webinar "Integratiing UI and Hardware"
Please Find attachment ..
--
Karan
2020-04-27 09:10 PM
2020-04-28 09:32 AM
2020-04-28 09:54 AM
I think there is an error in your model.cpp
I'm referring to my own example in this video: https://www.youtube.com/watch?v=majcfxr3u2E
The model looks something like this:
extern "C"
{
xQueueHandle messageQ;
}
Model::Model() : modelListener(0)
{
messageQ = xQueueGenericCreate(1,1,0);
}
So I can see two things different in your setup:
Lastly you wait 10 ticks for your messages. I don't think that it is needed or it helps anything. I can't recall if the waiting is a blocking call or not. If it is you have reduced your framerate a bit.
2020-04-28 10:10 AM
@HP (Community Member)
Many of Thanks for your time , code and link.
1) The Code successfully build .. Without any issue(s) and error(s).
2) From TouchGFX Button to LED .. Works well on Simulator and Board as well .
3) From Hardware Button to TouchGFX TextArea WildCard.. Works well on Simulator but NOT on Board ( Hardfault ) .
I have Listen Integratiing UI and Hardware" webinar from @Martin KJELDSEN (ST Employee) ..
Technically, Your approach in youtube video and mine approach as same (I think).
Did you run your code with Hardware Button on STM32746G-DISCO Board.?
--
Karan
2020-04-28 10:26 AM
well, I didn't use a button but I did use a queue. your button sampling code looks fine.
Did you try and change the code with my suggestions?
The simulator and hardware is similar but not completely similar so there's a pitfall.
Looking at your model..
walk through it with me.. if you get a message you call btnPressed()
Inside that method you do what? I think you intend to call the 'IncrementUpdate' method in the presenter, but you don't. you call the btnPressed() again? is that right?
2020-04-28 10:48 AM
Here are Code snapshots..
Please check updated One
The I did also use xQueueReceive(LEDQueueHandle , &led_msg , 0) worked well on Hardware LED in same (this) application ..
My ADC , UART code working fine with Semaphore (without Queue).
I will check your code suggestion tomorrow.
Thanks
--
Karan
2020-04-29 01:38 AM
Hi,
@HP (Community Member)
This method works.. Thanks for that ...
@Martin KJELDSEN (ST Employee)
1) Is it mandatory to create "Queue" inside the Model::Model() in Model.c ?
2) If Yes, Why cmsis syntax complied but same HardFault ...
osMessageQDef(ButtonQueue, 1, uint16_t);
ButtonQueueHandle = osMessageCreate(osMessageQ(ButtonQueue), NULL);
Or Any other Issue .. Please Update..
Any Way Thanks..
--
Karan