Stack Pointer Alignment ? (printf float problem)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-22 8:30 AM
Hello,
I am observing variables of my application with IAR Terminal I/O while debugging.But when trying to printf() float values, like; printf(''%f '', myFloat); Terminal I/O gives %f as output.After checking over internet, crossed that technical note on IAR's support site:So, how can I align Stack Pointer in my code at 8 bytes? Thanks already!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-22 9:16 AM
It's far more probable that you are linking against a library which doesn't support floating point scanf/printf.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-22 9:20 AM
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F3%2c%20IAR6.4%20how%20to%20printf%28%29%20floating%20point&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=292]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FSTM32F3%2C%20IAR6.4%20how%20to%20printf%28%29%20floating%20point&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=292
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-22 9:34 AM
Thanks for help!
From http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf''Choosing formatters for printf and scanf funcitons''
section says;''To use any other formatter than the default (Full), choose Project>Options and selectthe General Options category. Select the appropriate option on the Library options
page.''
Changed settings to Full and now it works!So, are there any disadvantages of this to MCU?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-22 9:44 AM
If you don't used floating point, or just don't print out values, you can significantly reduce your code foot-print. This can make a difference if it allows you to keep your code in a lower cost device.
Up vote any posts that you find helpful, it shows what's working..
