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-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-26 11:44 PM
Hi I have not looked at your code, but please look at this video and the channel. He uses the F746G disco board as well. This might really help you. If not I'll try to have a look when I have more time sorry.
/Romain
2020-04-27 02:13 AM
I've made a video series on exactly this functionality. they're based on the same tutorial you were following:
https://www.youtube.com/watch?v=43qQhrXc3n4&list=PLibkEAAdgBQ-d4LvImVNNDlYKCX0tj6aH
Especially look at video 4 and 5 in the playlist, the describe how to update the GUI from other tasks (using a queue) and updating other tasks from the GUI (using the same queue structure.
2020-04-27 02:17 AM
Also you could try to set a few breakpoints during the init process. how far do you go before you get an error?
How bit is your total stacksize in the RTOS config? it have to be larger than the combined size of your tasks (equal is not enough)
2020-04-27 02:59 AM
Hi,
@Romain Dieleman (ST Employee) and @HP (Community Member)
Many of Thanks for Update and video links. I have already seen that videos .
First Let you know I am able to PC send UART to TextArea ,
ADC analog values to to TextArea with Semaphores..
I am trying to do as per below but with STM32MXCube .
https://www.youtube.com/watch?v=jQO7zhX0e0Q&t=2062s
Only with Queues Generated by STM32MXCube
@HP (Community Member)
In the video, I think you have not used STM32Cube for defining or configuring Tasks and Queues . Right ??
@HP (Community Member)
Yes, I can try .. I have not seen/configure stack size RTOS Config. But Sending Value UART and ADC are working perfectly without changing and looking in Total Stack Size.
--
Karan
2020-04-27 04:03 AM
Hi,
After doing some experiment , I found with
if ( xQueueReceive(ButtonQueueHandle, &msg , (TickType_t)10) == pdTRUE)
{
// Queue is used as a flag, so don't check msg.
// Full = PRESSED, Empty = Do nothing.
btnPressed() ;
}
Cause HardFault or MemFault..
And Queue is created in main.c and not in Modal.c inside the Model::Model().
--
Karan
2020-04-27 04:10 AM
Which line causes a hardfault? What does btnPressed() do? Later versions of EWARM have the ability to tell you the offending instruction following a hard fault
/Martin
2020-04-27 04:34 AM
@Martin KJELDSEN (ST Employee)
Thanks for Update ..
1) When I Button Hardware Button HardFault Occurs.
2) When I TouchGFX Toggle NO Response from LED .
3) I am using STM32CubeIDE 1.3.0 .
Can you review my extracted code as attached Msg #1 .. ?
--
Karan
2020-04-27 06:36 AM
@Martin KJELDSEN (ST Employee)
1) When I used Toggle Button from TouchGFX - LED ON , OFF Worked
Actually, I missed interaction part from your webinar.
2) When I pressed HardButton - HardFault Still Occurs.
(Hardware Button Just Increment the value in TextArea WildCard )
Can you review my extracted code as attached Msg #1 .. ? Do I need to set / Increase total stacksize in the RTOS config ?
Thanks
--
Karan
2020-04-27 08:00 AM
Hi,
When I pressed Hardware Button - Hard Fault Still presists.
(Hardware Button - Just Increments the value in TextArea WildCard )
But Code worked on simulator Updating TextArea WildCard Perfectly ..
I have made some changes/correction in code attached at Msg #1.
Is there any issue in code or bug..? Specifically Below line responsible Hard Fault or Memory Fault.
if ( xQueueReceive(ButtonQueueHandle, &msg , (TickType_t)10) == pdTRUE)
{
// Queue is used as a flag, so don't check msg.
// Full = PRESSED, Empty = Do nothing.
btnPressed() ;
}
--
Karan