cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

PSoC creator 4.1, cyc8ki-042-BLE pioneer board, 222014 plugged in. USB connected to PC. teraterm running connected to the provided com port.

Create new project for the above.

in main, add printf("hello world\n");

build, debug, run. program hangs up (printf never returns). no output on teraterm.

Whiskey Tango Foxtrot?

0 Likes
1 Solution
himam_31
Employee

Kindly refer to the code examples for PSoC-4 BLE. Most of them have printf implemented usng UART component. Have a look at the file "debug.c" in which _write function which is required to redirect the strings to UART.

Please make sure that you connect the UART TX and RX pins to the appropriate pins, so that the kitprog USB-UART bridge can display the UART data properly.

Thanks,

Hima

View solution in original post

6 Replies
himam_31
Employee

Can you attach the project ?

Thanks,

Hima

0 Likes
JoMe_264151
Expert II

A PSoC hasn't got an operating system, so it does not know about interfaces to send your text to when using printf().

Easiest way out:

Use spirntf(buffer,... and then send the resulting string to your interface with the standard APIs, in your case probably USBUART_PutString(Buffer)

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob. how do I add a USBUART device so that call is defined?

0 Likes
JoMe_264151
Expert II

Read the Kitprog manual, your PSoC4 hasn't got an USB. You need to use an UART and the pins which are connected to the Kitprog as serial to USB bridge, see kit's schematic under C:\Program files (x86)\Cypress\...

Bob

0 Likes
himam_31
Employee

Kindly refer to the code examples for PSoC-4 BLE. Most of them have printf implemented usng UART component. Have a look at the file "debug.c" in which _write function which is required to redirect the strings to UART.

Please make sure that you connect the UART TX and RX pins to the appropriate pins, so that the kitprog USB-UART bridge can display the UART data properly.

Thanks,

Hima

View solution in original post

rola_264706
Honored Contributor II

Here is program that works for printf debug. It is set for the PSOC ble module . It should work for all of the modules however.

0 Likes