cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need EXTI?

Ala
Senior
16 REPLIES 16

EXTI is an *input* interrupt, it has nothing to do with USART Tx.

Did you observe the given Tx pin using oscilloscope or logic analyzer?

Make sure there is no peripheral on the Discovery board connected to the pin you intend to Tx on.

You should perhaps start with a simple polled implementation, then move on to DMA.

I don't use Cube/CubeMX.

JW

> I don't use Cube/CubeMX.

Me neither.

The shown code expects the HAL_USART_Transmit_DMA() function to be synchronous and blocking. Check this is actually the case.

Dear waclawek.jan

yes I checked the pin on oscilloscope, it shows the data being transferred. but I don't see the output results.

what do you mean by "polled implementation"?

dear Ozone

yes, HAL_USART_Transmit_DMA() is synchronous, but what do you mean by "blocking"?

> it shows the data being transferred. but I don't see the output results.

What do you mean by "output results"? From the STM32 point of view, for Tx, if the data are output onto the pin, there's nothing more to be done.

"Polled implementation" is non-DMA, non-interrupt, i.e. after writing one byte into the UART_DR, waiting in a loop, until USART signals in its status register that that byte has been transmitted.

JW

Quit with the casting a character byte as a pointer​ nonsense, that ain't gonna work.

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

by "not seeing the out put results" I mean I don't see the data being printed on the paper.

yes I've tried HAL_USART_Transmit() first, then I thought maybe I should get rid of "timeout", so I switched to HAL_USART_Tranmit_DMA(), but I'm still confused...

I keep staring the monitor to find out the problem but I get nothing...:sad_but_relieved_face:

I just want to send a HEX data, what should I do then? please help me!!!! I'm really confused...

Use a subroutine, pass it a char variable, and then pass a pointer to that to the transmit function. ie &ch, 1

Using (char *)0x32 passes an address of 0x32 to the routine. It is not 8 bytes wide either.

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