Pumpkin User Forums
  Service Bulletins
  SB-21: Salvo: Task Problems with AVR-GCC

Post New Topic  
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   SB-21: Salvo: Task Problems with AVR-GCC
Salvo Tech Support
Moderator
posted December 19, 2003 14:43     Click Here to See the Profile for Salvo Tech Support     Edit/Delete Message   Reply w/Quote
Applies To

All Salvo for Atmel AVR and MegaAVR users who are using the AVR-GCC compiler.

Description of Problem

The runtime behavior of a task is not what is expected. For example, the <flag> variable in this task will not be set to the proper value:

code:
void TaskCount( void )
{
static unsigned int flag;

for (;;)
{
counter++;
if ((counter % 2) == 0)
{
OS_Yield(TaskCount99);
flag = 0;
}
}
}


The problem is due to a register allocation / filling optimization that the AVR-GCC compiler is applying to the task. This optimization is incompatible with Salvo's task structure due to the fact that Salvo tasks can be (re-)entered after every context switch.

Suggested Workaround

Replace OS_Yield() in salvo\inc\portgccavr.h with:

code:
#define OS_Yield(label) do { OSCtxSw(); __asm__ __volatile__(" nop"::); } while (0)

Fixed In

v3.2.4

------------------
--------
Salvo Technical Support
Please request all tech support through the Forums.

IP: 63.203.232.106

All times are ET

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  
Hop to:

Contact Us | Pumpkin Home Page

2000-2008 Pumpkin, Inc. All Rights Reserved. Pumpkin and the Pumpkin logo, Salvo and the Salvo logo, The RTOS that runs in tiny places, CubeSat Kit and the CubeSat Kit logo are all trademarks of Pumpkin, Inc. All other trademarks are the properties of their respective owners.


Ultimate Bulletin Board 5.46a