Last active
November 18, 2021 10:00
-
-
Save KunYi/f4ad55b91ef9841d8adff6ab9563d5e1 to your computer and use it in GitHub Desktop.
use standard C library and printf redirection to USART/ITM for debugging need disable semihosting mode on Keil MDK ARM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * add the below code snippt into your project | |
| */ | |
| #include <stdio.h> | |
| #pragma import(__use_no_semihosting) | |
| struct __FILE | |
| { | |
| int handle; | |
| }; | |
| FILE __stdout; | |
| /** | |
| * @brief define _sys_exit() to avoid using semihosting mode | |
| * @param void | |
| * @return void | |
| */ | |
| void _sys_exit(int x) | |
| { | |
| x = x; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment