Loading...
 
Skip to main content

System Workbench for STM32


__io_getchar implementation for getchar() has a problem

I gave up completely on using syscalls.c and the standard print functions and wrote my own (files attached below).

I did run into a interesting problem trying to get blocked input using DMA on the UART.

I tried waiting for the UART Recevie Data Not Empty flag to be set and then calling HAL_UART_Receive_DMA() for a single byte but apparently HAL_UART_Receive_DMA() flushes the UART prior to reading the UART so for input I use blocking input.

For completeness a String_GetsN() could be added to get a string/buffer of known length from the UART using DMA but I didn't need it so I didn't write it. 😊

Please note: I have not fully tested the interrupt driven code.

Since this only seems to allow attaching a single file the MyString.c and MyString.h files can be found here: https://www.dropbox.com/sh/wz300bkp0yfpg49/AABP0b3PVVNa2MXG_UIDX6xba?dl=0

 
Collapse/expand modules below