CE220960 uart printf not working on App0

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

cross mob
joshm
Level 4
Level 4
25 replies posted 50 sign-ins 10 questions asked

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
Moderator
500 solutions authored 1000 replies posted 5 likes given

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
Moderator
500 solutions authored 1000 replies posted 5 likes given

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.