Explore my side projects and work using this link

Upsidedown is a WordPress theme design that brings blog posts rising above inverted header and footer components.

STM32CubeIDE printf() 사용하기

Written in

by

Advertisements

이게 기본인데, 머가 어렵다 임베디드는

아래글을 꼭 참고하자. 나는 2번째 방법을 사용했다.

https://wiki.loliot.net/docs/mcu/stm32/stm32-printf-usage-stm32cubeide/

#ifdef __cplusplus
extern “C” int _write(int32_t file, uint8_t *ptr, int32_t len) {
#else
int _write(int32_t file, uint8_t *ptr, int32_t len) {
#endif
if( HAL_UART_Transmit(&huart1, ptr, len, len) == HAL_OK ) return len;
else return 0;
}

Advertisements

Tags