Skip to main content
vivek
Associate III
Aug 22, 2019 10:04 AM UTC
Question

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

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

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
Aug 22, 2019 12:39 PM UTC

Lots to work with there.

What STM32?

Show Code

Check IRQ handler

Check pin configuration

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Jack Peacock_2
Associate II
Aug 22, 2019 5:24 PM UTC

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
vivekAuthor
Associate III
Sep 14, 2019 9:58 AM UTC

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