sinadarvi / SemiHosting_ac6_STM32

using printf() and scanf() function without any interface!!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SemiHosting_ac6_Workbench

SemiHosting using printf() and scanf() function without any interface!!

if you remember, I taught you a way to use printf() function by UART interface, but how we can use printf() and scanf() without any interface ???

first you should get to know with SemiHosting, Semihosting is a neat way to redirect STDOUT and STDIN from an embedded system to a debug window on a PC. This allows you to output messages using printf functions without having to use/configure an RS232 or USB Virtual COM Port, and can also read input from the PC's keyboard via scanf functions.But how??

for simplicity we assume i made a project in ac6 and then i just go in the debugger Configuration i had made for my debug mode and then in "Startup" tab i add these like this picture below :

monitor arm semihosting enable

StartUp_tab after that we should add Project, Properties, C/C++ Build, Settings, MCU GCC Linker, Miscellaneous, Linker flags like this :

-specs=nosys.specs -specs=nano.specs -specs=rdimon.specs -lc -lrdimon

Miscellaneous and then you can just simply look at my main.c code that you can see above and then you can use this function to do as like this. and then your result would be like this : (printf and SD_printf from SD_HAL_UART Library) printf - SD_printf

(and scanf and printf together ) scanf

here we are !! and you can see this is very easy but so helpful... Come and visit our site :) Have Good Day ;)

About

using printf() and scanf() function without any interface!!


Languages

Language:C 100.0%