cancel
Showing results for 
Search instead for 
Did you mean: 

USART1 Transmit function not work using true studio but same code worked on keil compiler.

vivek
Associate II

I am init all function related to usart1.Transmit flag also set but data not transmit.

3 REPLIES 3

Lots to work with there.

What STM32?

Show Code

Check IRQ handler

Check pin configuration

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Jack Peacock_2
Senior III

When you step through with the debugger, stop at the point just after you expect the USART to start sending. Check the status register for the USART and the DMA channel, assuming you are using block DMA output (that's the most efficient way to send a block of data out the USART). Also check the NVIC registers to make sure the right vectors are enabled. Set breakpoints at the start of your USART and DMA interrupt handlers to verify the handler is being reached properly.

Above all make sure you are trapping system faults, especially hard fault, otherwise you won't have a clue as to what's happening.

If debugging is too complicated...keep using the Keil compiler since you know it works.

Jack Peacock

vivek
Associate II

thank you for solutions,problem solve by changing crystal 8MHz to 25MHz.