Pumpkin, Inc.

Pumpkin User Forums

SB-21: Salvo: Task Problems with AVR-GCC

Service Bulletins -- outlining known problems and how to handle them -- are posted here.

SB-21: Salvo: Task Problems with AVR-GCC

Postby Salvo Tech Support » Fri Dec 19, 2003 2:43 am

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 salvoincportgccavr.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.

--------
Salvo Technical Support
Please request all tech support through the Forums.
Salvo Tech Support
 
Posts: 173
Joined: Sun Nov 19, 2000 12:00 am

Return to Service Bulletins

Who is online

Users browsing this forum: No registered users and 1 guest

cron