2007-03-13 08:39 PM
2007-02-14 12:55 AM
Hello,
I am trying to make a software reset, after reprograming the flash. But it is not working every time. The function look like this: __ramfunc void Reset(void) { RCCU->CCR |= RCCU_EN_HALT | RCCU_SRESEN; RCCU->SMR |= 0x02; } Interupts are disabled. Best regards, Frank2007-02-14 06:02 AM
Just a shot in the dark: try putting a small delay (a few NOPs) between the two lines of code.
There is another way to reset the MCU in software: the watchdog timer. - mike2007-02-15 07:34 PM
I need to reset an STR711 too. I tried setting those bits in RCCU_CCR,
then Halt in RCCU_SMR, but it doesn't appear to work. It just looks dead - no LEDs, and the USB stack can't communicate with it. I say doesn't appear to, because the firmware I have would possibly give the same result if a message were sent over USB after the recovery from reset. I shut down the controlling USB application immediately it has issued the command to restart, so I'm not voluntarily sending any message, but USB stacks are complex and I don't know if mine is doing something. I'm going to try the watchdog method next - thanks for the creative idea! Dave2007-02-15 11:40 PM
Following up my own posting: I have tried the watchdog method of resetting
the STR711, but I can't even get that to work. I have: // Set the watchdog timer going in order to generate a reset // The clock prior to the prescaler is 32 MHz; the // prescaler divides by 256, so the prescaler's output // is at 125 kHz (8 us period) WDG_CntReloadUpdate (10000); // 80 000 us = 80 ms // Having set the reload value, restart the watchdog WDG_CntRefresh (); // Now enable it WDG_Enable (); GPIO0->PD = GPIO0_INIT_MASK & 0xFFF0; while (TRUE); The ''GPIO0->PD = GPIO0_INIT_MASK & 0xFFF0;'' lights up some LEDs to let me know that the code has got there - and it has. That's beyond doubt. But the thing doesn't reset; it just sits there with some other LEDs cycling, which is how I left it prior to trying to induce the reset. As far as I can see, it's impossible for that code to fail; it MUST cause the chip to reset. But it doesn't. Any ideas would be gratefully received! Dave2007-02-21 07:51 PM
What exactly do Software Reset and Watchdog Reset do within the STR711?
Do they reset all the peripherals, as if the hardware reset line had been asserted? This isn't clear to me from the Reference Manual. Dave2007-02-22 05:52 AM
Quote:
What exactly do Software Reset and Watchdog Reset do within the STR711? Do they reset all the peripherals, as if the hardware reset line had been asserted? This isn't clear to me from the Reference Manual. I have the reference manual revision 8, and to me it's clear that software reset and watchdog reset have the same effect as hardware reset. At least on paper they do. You never know what actually happens in real hardware :) - mike2007-03-02 08:30 AM
hello,
Ys Software reset and Watchdog Reset have the same effect as hardware reset. an example of watchdog generating a reset is provided with the STR71x software library. what is confusing in refrence manual? ;)2007-03-12 05:38 AM
Hi.
I noticed this post was started a month ago so I don't know if my input will be of any use, but have you tried to jump to start of your code instead of a reset. i.e. define void (*jump_function) (void); and in your 'reset' function: jump_function = (void*) 0x40000000; jump_function(); or wherever it is your code is stored. Regards Neil2007-03-13 04:56 PM
Yes, I'm always using assembly code to do software reset and it works fine.
soft_reset mov pc, #0x40000000