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

PSoC™ Creator & Designer Forum Discussions

joshm
Level 3
5 likes given 25 sign-ins 5 questions asked
Level 3

I have a project based on CE220960, and I am trying to debug some issues with my custom App0, but the uart printf is not working. After spending a bunch of time trying to figure that out, I realized the printf in App0 of the original example doesn't work either. Uart printf works fine in the other apps. 

Anybody solve this issue?

I am using Creator 4.4, PDL 3.1.2, on CY8CKIT-062-BLE.

Josh

0 Likes
1 Solution
Yugandhar
Moderator
Moderator 5 likes given First comment on blog 750 replies posted
Moderator

Hello, 

Please add the below code in DFU_APP0 project.
******************************************************************************
#define UART_DEB_PUT_CHAR(ch) while(0UL == UART_1_Put(ch))

/* For GCC compiler revise _write() function for printf functionality */
int _write(int file, char *ptr, int len)
{
int i;
file = file;
for (i = 0; i < len; i++)
{
UART_DEB_PUT_CHAR(*ptr);
++ptr;
}
return len;
}

******************************************************************************

Thanks,

P Yugandhar. 

View solution in original post

1 Reply
Yugandhar
Moderator
Moderator 5 likes given First comment on blog 750 replies posted
Moderator

Hello, 

Please add the below code in DFU_APP0 project.
******************************************************************************
#define UART_DEB_PUT_CHAR(ch) while(0UL == UART_1_Put(ch))

/* For GCC compiler revise _write() function for printf functionality */
int _write(int file, char *ptr, int len)
{
int i;
file = file;
for (i = 0; i < len; i++)
{
UART_DEB_PUT_CHAR(*ptr);
++ptr;
}
return len;
}

******************************************************************************

Thanks,

P Yugandhar.