Skip to main content
YAY.1
Senior
February 7, 2020
Question

Why (stm32 discovery) pins are resetting ?

  • February 7, 2020
  • 8 replies
  • 2934 views

When i use iar embeded workbench its work correctly with out f11 .

While it works by itself , its pins are resetting.

I want to learn what happening here .

Even power is enough.

Model : stm32f429

COD:

CONTROLREAD

LDR R0, =USART2_DR        

LDR R1, [R0]      

MOVE               

                LDR R2, =0x31 ;forward "1" signal 

                LDR R3, =0x32 ;back "2" signal 

                LDR R4, =0x33 ;right "3" signal 

                LDR R5, =0x34 ;left "4" signal  

                CMP R1, R2

                BEQ   FORWARD

                CMP R1, R3

                BEQ   BACK

                CMP R1, R4

                BEQ   RIGHT

                CMP R1, R5

                BEQ   LEFT

                B    CONTROLREAD

FORWARD 

                LDR R0, =GPIOD_ODR

                LDR R1, =(BIT0|BIT1|BIT4)

                STR R1, [R0]

                B    CONTROLREAD

This topic has been closed for replies.

8 replies

Danish1
Lead III
February 7, 2020

Most of us don't do much assembly-code programming. Once a program gets over a certain size, I find C or C++ much easier.

Do you manage to set the pins "while it works by itself"?

Which pins are resetting? All of them or just some? When does it happen?

Do you have a watchdog running? (That can, after a while, reset the processor and thereby reset the bits).

How strongly do you know the program gets as far as CONTROLREAD?

You don't show the code for BACK, RIGHT, LEFT. Do they all set specific pins in GPIOD_ODR then branch back to CONTROLREAD?

It might be good practice to check there's something worth reading in USART2_DR (by looking at the RXNE bit of USART2_SR) before reading it, although I don't think that's your problem.

Hope this helps,

Danish

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

The problem is when i send a messege to go forward , it is going some then it is stopping but it should go forever.

All cod:

waclawek.jan
Super User
February 7, 2020

> i send a messege to go forward , it is going

Do you have some motor connected?

Try disconnecting it and then run the code, observe outputs by connecting LEDs on them.

JW

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

I have checked with just connect multimeter.

It is same....

If there isn't enough power, how can i learn ?

Tesla DeLorean
Guru
February 7, 2020

Single step with debugger, inspect RCC, GPIO etc with peripheral view.

Should perhaps check USART RXNE to see if data is actually available.

Could also output messages to USART so you have some feedback on the terminal.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
waclawek.jan
Super User
February 7, 2020

Instrument your code - place code changing output pins state to various places (reset, fault vector), and observe.

JW

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

I have just checked again with no connection.

It is same...

The problem is it is resseting completely.

What do you suggest ???

What should i do now ???

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

I have tried to make loop , the voltage is fall down a bit then rise up .

So it is resetting again but it is very fast.

In my program , it is same but falling down is big because it is complicated than loop.

The main question is why it is resetting and if board is broken , how can i learn this ????????????

Pls , i need help......

Danish1
Lead III
February 9, 2020

How are you powering your board?

How are you measuring to say "I have tried to make loop , the voltage is fall down a bit then rise up ."? Multimeter? Oscilloscope? LED?

Be more specific.

Be aware that interrupting power for even the tiniest moment will cause the processor to reset because microcontrollers are absurdly fast. What is too small for you to spot is a lifetime for one of them!

How long are the cables from your power-supply? What is the voltage?

Is it a battery (that might be about to go flat).

Please hang a voltmeter between Vdd and Vss and tell us what it reads - while you try to run your code.

Similarly at the input of the voltage regulator.

And on the Reset pin of the microcontroller.

We (probably) can help. But you do have to cooperate and answer all the questions we ask as fully as you can. We ask specific questions as the answers give us clues as to what might be wrong.

"It doesn't do what I want" is useless without telling us (a) what you're trying to do and (b) what it actually is doing - as quantitatively as you can.

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

Connected bluetooth module Hc06

Voltage regulator input = 4.7v

The cable is very short and there is no problem in cable.

I am measuring 2.9 volt with multimeter but it is falling to 0 volt when I stop sending signals.

NRST - GND = 2.9 volt (stable)

VDD - GND = 2.9 volt (stable)

Thank you to all of you who helped...

The cod is here:

Piranha
Principal III
February 9, 2020

@Danish​ and @Community member​ have asked you a questions and you have ignored them, making it impossible to help.

YAY.1
YAY.1Author
Senior
July 27, 2020

I tried everything but i am sure that it is broken completely.