Issue to add sprintf in my code in cube ide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-24 4:09 AM
Hai, I am using stm32h743zi nucleo board in that I am send and receiving float via UART using sprintf but facing hard fault error while running , help me to sort ​this issue would be appreciated.
- Labels:
-
DEBUG
-
STM32CubeIDE
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-24 4:44 AM
First of all, normally sprintf is used for writing something into a string.
Second, maybe you need to set these checkboxes in the project settings:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-24 6:57 AM
Also note that printf/sprintf (and maybe sscanf, not sure) use the heap and a failed allocation can cause a crash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-24 9:42 PM
Thanks,I have this done in my code still I am facing the same issue.​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-01 8:22 AM
I have same Error. Did you solve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-04 9:03 PM
Just add
#include<cstdio>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-05 1:13 AM - edited ‎2023-11-05 1:16 AM
I'm not sure but I think you may send or receive some data is not char or not ascii.
Or you may send or read data oversize from your buffer so you had write in some address which it's may affect to another function and then that function is fail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-05 2:05 AM
Would it be possible to share the part of the code you changed yourselves?
This way we will be more able to assist.
