2020-02-07 02:12 AM
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
2020-02-07 03:54 AM
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
2020-02-07 06:28 AM
2020-02-07 06:42 AM
> 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
2020-02-07 07:29 AM
I have checked with just connect multimeter.
It is same....
If there isn't enough power, how can i learn ?
2020-02-07 07:46 AM
Instrument your code - place code changing output pins state to various places (reset, fault vector), and observe.
JW
2020-02-07 08:11 AM
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.
2020-02-07 08:18 AM
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 ???
2020-02-09 01:43 AM
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......
2020-02-09 03:39 AM
@Danish and @Community member have asked you a questions and you have ignored them, making it impossible to help.