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
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:

void TaskCount( void )
static unsigned int flag;

for (;;)
if ((counter % 2) == 0)
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:

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

Fixed In


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


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