CMSIS RTOS Variable Problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-07-02 8:56 AM
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-07-02 11:18 AM
Posted on July 02, 2013 at 20:18
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-07-30 1:40 AM
Posted on July 30, 2013 at 10:40
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.
