Is sprintf() supposed to support uint64_t numbers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 9:52 AM
This compiles with no warnings or errors:
char buf[256];
uint64_t bignum = 0x123456789;
sprintf(buf,"bignum: 0x%016llx, %llu\r\n",bignum,bignum);
HAL_UART_Transmit_DMA(&huart1,(uint8_t *)buf, strlen(buf));
This comes out the terminal:
bignum: 0x000000000000000lx, lu
%I64d does not compile.
Solved! Go to Solution.
- Labels:
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 2:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 12:26 PM
It depends on the libc used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 12:41 PM
Thanks
How do I change the libc in STM32CubeIDE?
And which one should I use?
Where can I find the documentation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 1:16 PM
googling STM32 libc does not get me anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 2:13 PM
Select this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-24 5:36 PM
I got it!
You have to select the project, then File->Properties. To get to that screen.
Thanks, that fixed it.
