cancel
Showing results for 
Search instead for 
Did you mean: 

Why cortex m4 (stm32 discovery) usart3 is not working ??? (SOFTWARE)

YAY.1
Senior

Hello,

I have a problem,i wrote this program but it dosen't work.

It doesn't read its rx pin.

Can you help me pls ???

1 ACCEPTED SOLUTION

Accepted Solutions
YAY.1
Senior

NOW, every thing is fine.

It is working...

Final cod that is working ::😀

View solution in original post

14 REPLIES 14
Ozone
Lead

Which discovery board ? There are several one's fitting into the "M4" category.

Have you checked the schematics ?

Perhaps the pin is connected to other onboard peripherals interfering with UART functionality ?

Don't want to wade through uncommented assembler code with permanently cross-referencing the RefManual.

YAY.1
Senior

Pins are correct (stm32f429ZI).

I try to use Reference manual.

I don't like c language , i want to use assembly language.

Is this program correct ?

And

I will try other pins like uart not usart...

berendi
Principal

Both the software and the hardware has problems. It's quite hard to tell what, when neither the program workings nor the intention is documented.

Using the UART to read from the onboard RAM or what?

Know your board first, use the documentation available from the vendor, then document your code adequately before asking help from others.

Can you use a debugger?

Use the Peripheral Viewer to walk through the RCC, GPIO and USART configurations and bits, with respect to the Reference Manual.

Output a 'U' 0x55 pattern repeatedly, and use a scope to confirm the signal and the baud/bit rate.

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

> I don't like c language , i want to use assembly language.

I'm all for performance, compactness and understanding of hardware, but writing everything in assembly is just ineffective. It's better to write most of the code in C and leave assembly for hardware specific instructions, performance critical code, startup code etc. Not only you get cross platform decently optimized (for all platforms) reusable code, but also a possibility to change per project optimization for speed or size with a single parameter.

> USART_SR         EQU GPIOD_BASE + 0x00

+1 for using the debugger.

JW

YAY.1
Senior

USART_SR         EQU GPIOD_BASE + 0x00

This is maybe wrong .

not GPIOD_BASE

it would be this, 0x4000 4800 - 0x4000 4BFF USART3 

I will try this

Thanks a lot.

YAY.1
Senior

IT doesn't work again......

YAY.1
Senior

It doesn't work again ....

Even , i have tried to change usart.

Is there a problem in this ?

New cod is here: