2013-07-02 08:56 AM
2013-07-02 11:18 AM
I cannot say why it is hanging. perhaps your stack size is way to small?
osThreadDef(Funct, osPriorityNormal, 1, 256);
Waking a thread every 1ms is pretty harsh. Try every 50ms and increment count by 50.I can say that you have two threads nakedly accessing the same variable. That access is not thread safe,First, the variable should use the keyword ''volatile''second, there should be a mutex that each thread calls to gain access to the variable. Only one thread at a time can ''hold'' the variable, to read or modify and then, the thread releases the mutex.NOTE: in this simple example it might not matter to much, since one thread is the consumer and the other thread is the provider. But naked access will cause problems.2013-07-30 01:40 AM
Details in STM32 Discovery forum:
. Replies should be given there. -Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.