Hello I use printf for sending out data from USART ports.
struct __FILE { int handle;} ; FILE __stdout; FILE __stdin; FILE __stderr; int fputc(int ch, FILE *f) { while(!USART_GetFlagStatus(USART1,USART_FLAG_TXE)); USART_SendData(USART1,ch); return ch; }
It works fine when I use printf function. Unfortunately when I want to use Ethernet library from cmsis this command "printf" hangs my mcu and when I change printf with USART_SendData(USART1,ch); my mcu works fine.
I have added this libraries.
(RTOS->keil RTX) (CMSIS Driver->ethernet MAC(API)) (CMSIS Driver->ethernet PHY(API)) Device(GPIO) Network(core + interface + socket->TCP/UDP)
what is my mistake?
Your code busy-loops waiting for the USART to be ready for the next character.
How have you implemented your code so it will still multitask the network stack even while your printf() hangs waiting for room in the USART?
Dear Per Westermark Thanks for your help Unfortunately I could not find out what is my problem when I use Ethernet library and I was hurry too much and I wrote a new function to send char with USART_SendData function. But thanks anyway