PSoC 6 BLE - printf function

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

cross mob
lock attach
Attachments are accessible only for community members.
PhDi_1589426
Level 3
Level 3
First like received First like given

Hi,

I tried to implement the stdio.h library to use the printf function.

The way I have done it, it first seemed to work, but after adding BLE functionallity the printf function doesn't work any more.

I attached the project. Could you please review it?

Thanks and best regards

Philipp

0 Likes
1 Solution
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

Hi Philipp,

Firstly, please select "Dual core" option to allocate the BLE stack to both cores to eliminate the building error.

Then you can add "\r\n" in each printf() function, as below:

printf("%d \r\n",i);

View solution in original post

4 Replies
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

Hi Philipp,

Firstly, please select "Dual core" option to allocate the BLE stack to both cores to eliminate the building error.

Then you can add "\r\n" in each printf() function, as below:

printf("%d \r\n",i);

Hi fwan,

thank you for the fast reply.

It works.

Could you tell me where the failure was?

Was it the missing \r\n or the BLE Stack?

Would be good to know to avoid similar failures.

Best regards

Philipp

0 Likes

Philipp,

Your project is not building because in top design you have selected Single Core (CM4) but you were trying to initialize the BLE controller from CM0+.

In case of 'printf', if you want to output the string then '\n' is needed to output the data.

Thanks,

Ajay

You can refer to below link for the clarification of this issue:

c - When does printf fail to print? - Stack Overflow