Hello.
I just started using Embedded Wizard and I have been having some trouble getting a few things to work.
I am developing some code for STN32F769-DISCO and I followed the tutorial at: Getting Started with STM32F769 Discovery.
Then I created my own EmWi and used the Generated Code with the Template to upload it to the board. So far so good.
Now I tried to create a second thread to run a simple code. Unfortunately I didn't get this part to work. Here are a few steps I followed.
1- I have set the EW_USE_FREE_RTOS to 1.
2- Created the function for my secondary thread. (Just print something with Putty).
static void myMainLoop ( const void* arg )
{
while(1)
{
EwPrint( "[myMainLoop - Task]\n" );
}
}
3- Created the new task right after the UI Thread (and before osKernelStart).
EwPrint( "Create my thread... " );
osThreadDef( MyThreadHandle, myMainLoop, osPriorityNormal, 0, semtstSTACK_SIZE );
osThreadCreate( osThread( MyThreadHandle ), (void*)0 );
EwPrint( "[OK]\n" );
4- I compiled and download this to the board.
The behavior was not what I expected. My secondary Thread doesn't run ever. Actually, only the first thread I defined and created runs. If I switch the order of the creation of the EmWiThreadHandle thread and mine (MyThreadHandle), the code will just execute my thread.
Is the template configured in a way that this won't work? Am I doing something wrong with the RTOS?
PS: I know the GUI application has to be in only one thread. That is why I didn't change the EmWiMainLoop function.