FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2013 Threads] Issue with sprintf in STR9 IAR projectPosted by soufien on January 24, 2013 I have an issue where sprintf sometimes printing an unexpected string. The call: sprintf(str_my_string, "%#.1f", 0.0); is made from inside a function called from a task. Most of the time, the expected string is printed (0.0) and it only occurs every minute or two. This issue started occurring after adding the FreeRTos to our existing project and has never happened before. What might cause this issue? How should I go about troubleshooting this? Thanks for you help
RE: Issue with sprintf in STR9 IAR projectPosted by MEdwards on January 24, 2013 http://www.freertos.org/FreeRTOS_Support_Forum_Archive/January_2013/freertos_sprintf_breaking_under_new_FreeRTOS_6647463.html
RE: Issue with sprintf in STR9 IAR projectPosted by soufien on January 25, 2013 I did some more troubleshooting and found that it only occurs when I have a 1ms timer interrupt enabled and that if I let the same code run in a while loop, it happens so often (seems to be more than 2 times a second). Then, I switched from the version that we are using V5.0.2 to the newer version V7.3.0 and it works fine so far. I am still not sure what caused the issue but I am starting to think that it has to do with saving and restoring the context although the save/restore context assembly macros of the two versions are the same. I am still concerned that somehow the new version is masking other problems somewhere else. I will keep working on it.
RE: Issue with sprintf in STR9 IAR projectPosted by soufien on January 25, 2013 Problem solved!!! It was caused by a bug in version V5.0.2 that was not handling memory alignment properly in xCreateTask function. Version V7.3.0 works. V5.0.2 create task function does this: pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - ( unsigned short ) 1 ); It should also do this: pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|