- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To all,
I have working PSoC Creator that I ported to MTB.
It is generally working however trying to use snprintf() on a 64-bit variable (long long) is not working.
Here is the code fragment:
...
uint64 uid;
uint16_t tstr_sz[50]
#if (CYDEV_CHIP_FAMILY_USED == CYDEV_CHIP_FAMILY_PSOC6)
uid = Cy_SysLib_GetUniqueId();
#else
CyGetUniqueId((uint32 *)uid);
#endif
snprintf(tstr, sizeof(tstr), "Unique Silicon ID: %.8llX\r\n", uid);
UART_PutString(tstr);
...
When compiled from PSoC Creator I get:
Unique Silicon ID: ED2F482D69619DA
When compiled from MTB I get:
Unique Silicon ID: llX
Using PSoC Creator I needed to set to get 64-bit vars to work:
Is there a similar setting in MTB?
Len
"Engineering is an Art. The Art of Compromise."
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Len,
You have to do the same thing in MTB as well. You need to switch to newlib instead of newlib-nano to print long long which is default disabled in nano specs.
The way to achieve this is: Migrate to <your_app>/libs/psoc6make/make/toolchains/GCC_ARM.mk and modify the CY_TOOLCHAIN_LDFLAGS in the following manner.
Let me know if this does not work help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Len,
You have to do the same thing in MTB as well. You need to switch to newlib instead of newlib-nano to print long long which is default disabled in nano specs.
The way to achieve this is: Migrate to <your_app>/libs/psoc6make/make/toolchains/GCC_ARM.mk and modify the CY_TOOLCHAIN_LDFLAGS in the following manner.
Let me know if this does not work help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RaktimR,
Thank you. That worked.
Len
"Engineering is an Art. The Art of Compromise."