avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #28921] pointer to function > 128k flash


From: Stu Bell
Subject: [avr-libc-dev] [bug #28921] pointer to function > 128k flash
Date: Fri, 19 Feb 2010 22:12:48 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)

Follow-up Comment #2, bug #28921 (project avr-libc):

Wow, I am humbled.  The option that Joerg suggested has been in my Make file
for years now but I have insisted that all function pointer targets must
reside in flash < 128KiB.  After recompiling without my little hack to force
function pointer targets to < 128K (and verified in the map that more than a
few targets are indeed above the 128K boundary), my application appears to be
working fine.

Now, just one more little request: When I pass the pointer to a task function
to the FreeRTOS task creation routine, gcc passes a 16-bit pointer, as I
expect.  Unfortunately, there is not a direct "function pointer" reference to
the task function, so the linker has no need to put the task into the
trampoline (or, more to the point, it has no need to keep it there).

Example:

typedef void (*pdTASK_CODE)( void * );

portBASE_TYPE xTaskCreate(
       pdTASK_CODE pvTaskCode,
       const char * const pcName,
       unsigned short usStackDepth,
       void *pvParameters,
       unsigned portBASE_TYPE uxPriority,
       xTaskHandle *pvCreatedTask
     );

/* The focus servo task. */
void vFocusTask( void* pvParameters );

void 
vStartFocus( uint8_t uxPriority )
{
 . . .
    xTaskCreate( vFocusTask, (signed portCHAR*) taskName , FOCUS_STACK_SIZE,
NULL, uxPriority, ( xTaskHandle * ) NULL );
 . . .

Is there some way to force the linker to keep some names in the trampoline
even though the -Wl,--relax is specified in LDFLAGS?  For now, I will leave my
"put the function in lower 128K" hack in place for the task functions.

Stu Bell

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?28921>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]