Printf issue

I was developing my whole project at the mBed online compiler and everything was ok until I exported my project to Keil because I need to change the memory map and the mbed online compiler does not allow this change.

I am able to compile the project at Keil but when I flash the binary into W7500P I am not able to debug because the printf function goes crazy (prints “▒▒▒▒J▒▒▒” or “▒FOFO▒OVO” or “▒▒OVF▒▒RO” instead of “[INFO: /src/main.cpp:1320]”). I am including the retarget.cpp file to the project and the serial speed at the client is the same as the one set in the program). It is worthy of note that exactly the same project works fine in the mbed online compiler. Have someone faced the same issue?


Hello, pherig

Thank you for your interest.

And so sorry about late reply…

I think there is no critical issue with your porting.

But unfortunately, I can not catch the point

So, I linked example porting to keil from mbed.


If it is hard to find the differences between linked project and your, please ask again.

Thank you,


Thanks Lawrence, your example code was exactly what I was looking for. This printf issue has been resolved.

Could you please also take a look at my other post: Disable socket buffer. Increase available SRAM

Even though it was important for me to migrate to Keil, which you just helped me, I am still struggling with the memory remap, which is a much bigger issue for my project, and I have’t been able to understand how to do it based on the documentation provided.

Hope to hear soon from you.