CYPD3171-24LQXQ_pb add printf, but build fail

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HuEd_3452391
Level 3
Level 3
25 sign-ins First like received 10 sign-ins

Hello

I want to use

https://www.cypress.com/documentation/code-examples/ce224431-psoc-4-uart-printf

on CYPD3171-24LQXQ_pb. Here my steps

1. Modify the Heap size from 0x80 to 0x380 -> build successful

2. Add some code in main.c

#if defined (__GNUC__)

   

    /* Add an explicit reference to the floating point printf library to allow

       use of floating point conversion specifier. */    

    asm (".global _printf_float");

    ...

#endif /* (__GNUC__) */

0 Likes
1 Solution

Hi ,

CCGx firmware is not support printf directly.

Kindly refer the threads we have been offered in the community to debug the firmware with software UART.

Re: printf

Best Regards,

Lisa

View solution in original post

0 Likes
3 Replies
HuEd_3452391
Level 3
Level 3
25 sign-ins First like received 10 sign-ins

3. Add below in main.c  - -> build fail

#include <stdio.h>

4. Add below in main.c  -> build fail

    int32 integerNum = -212121;

    float floatNum = 37.37f;   

    printf("Testing printf function. long: %ld , float: %f \r\n", integerNum, floatNum);

   

5. build fail log as below, is it the .text region is not enough to accommodate the printf?

\CYPD3171-24LQXQ_pb.elf section `.text' is not within region `rom'ERROR:

\CYPD3171-24LQXQ_pb.elf section `.eh_frame' will not fit in region `rom'ERROR: address 0x14024 of \CYPD3171-24LQXQ_pb.elf section `.text' is not within region `rom'ERROR: address 0x14024 of \CYPD3171-24LQXQ_pb.elf section `.text' is not within region `rom'ERROR: Firmware binary overlaps with metadataERROR: section .cyloadablemeta loaded at [0000ffc0,0000ffff] overlaps section .text loaded at [00001000,00014023]ERROR: region `rom' overflowed by 0 bytesc:/program files (x86)/cypress/psoc creator/4.2/psoc creator/import/gnu/arm/5.4.1/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv6-m\libg_nano.a(lib_a-sbrkr.o): In function `_sbrk_r':

sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'

c:/program files (x86)/cypress/psoc creator/4.2/psoc creator/import/gnu/arm/5.4.1/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv6-m\libg_nano.a(lib_a-writer.o): In function `_write_r':

writer.c:(.text._write_r+0x10): undefined reference to `_write'

Thanks

0 Likes
HuEd_3452391
Level 3
Level 3
25 sign-ins First like received 10 sign-ins
0 Likes

Hi ,

CCGx firmware is not support printf directly.

Kindly refer the threads we have been offered in the community to debug the firmware with software UART.

Re: printf

Best Regards,

Lisa

0 Likes