Skip to main content
YAY.1
Senior
January 31, 2020
Solved

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

  • January 31, 2020
  • 14 replies
  • 3507 views

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 ???

This topic has been closed for replies.
Best answer by YAY.1

NOW, every thing is fine.

It is working...

Final cod that is working :::grinning_face:

14 replies

Ozone
Principal
January 31, 2020

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
YAY.1Author
Senior
January 31, 2020

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...

Tesla DeLorean
Guru
February 1, 2020

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
YAY.1
YAY.1Author
Senior
February 4, 2020

How can i that ?

Can you explain ?

berendi
Principal
February 1, 2020

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.

Piranha
Principal III
February 1, 2020

> 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.

Ozone
Principal
February 4, 2020

I agree.

It's not about C or assembler, it's about self-documenting coding style.

BTW, you can try to loop back the UART for testing, i.e. connecting Rx to Tx.

waclawek.jan
Super User
February 1, 2020

> USART_SR         EQU GPIOD_BASE + 0x00

+1 for using the debugger.

JW

YAY.1
YAY.1Author
Senior
February 1, 2020

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
YAY.1Author
Senior
February 4, 2020

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

YAY.1
YAY.1Author
Senior
February 4, 2020

It doesn't work again ....

Even , i have tried to change usart.

Is there a problem in this ?

New cod is here:

YAY.1
YAY.1Author
Senior
February 4, 2020

I think there is no hardware problem ..

What is alternative function low register or high register   ?

I did not touch this settings , can the problem be because of this ???

New cod and this is bluetoth rc car project:

YAY.1
YAY.1Author
Senior
February 4, 2020

It doesn't work again.

Pls help.........

Final cod: