Topic : Problem with hardware reset

Forum : ST7/STM8

Original Post
Post Information Post
May 11, 2007 - 3:00pm
Guest

Hi,

I just recently started embedded programming. I am wrinting a programm using a REva board wit a ST7LiteUS5 daughter board. The programming environment is the RIDE Version 06.10.22, Buildnumber BN746-ST7-ARM-80C51 and I am using the Raisonance toolchain.

After some experimenting I got most of my programm to work. But one problem remains, which I am unable to fix.

If I enable the watchdog on the board an let it generate a reset, or if I reset the board with the resetbutton, my application stops. If I try to start it again with the GO-button, it immediately stops again and I get the following error message:

OPI Driver: Unable to retrieve context from the monitor.

and after I confirm that dialog I get the following message:

OPI Driver: No response from the DCT. Terminating Debug session.

After that the debug session stops and I have to start the program again by pressing CTRL+D.

I implemented several interrupt routines in my program, using the following syntax:
void Interrupt_Routine_Name (void) interrupt Interrupt_Number{}
Those routines work fine. But I was unable to implement an interrupt routine for the reset event, since reset does not have an interrupt number associated to it, according to the interrupt mapping table.

So at first I thought the problem was due to missing routine associated with the reset event. But after taking a look at the dissassembly code I saw, that the Interruptvector for Reset, located at address FFFEh does contain an address for a reset routine. At the designated address I see a function named CST7_START_V which seems to contain two address calls. One calls a routine, with the Symbolname ?C?InitData, the other points to the address, where the main routine of my program starts.

I assume this is generated by the RIDE-environment in order to assure a correct startup and reset of the MCU. Is that assumption correct?

The corresponding routine CST7_START_V looks fine to me. But for some reason I just can not figure out, after a reset the programm jumps to an address in reserved memory (DF6Bh) where it then hangs, instead of running through the ?C?InitData routine and then starting my main routine again.

For your help on helping me understand why the reset doesn't work as intended and fixing that problem I would be very grateful.

With kind regards,
Stephan

Replies
Post Information Post
+1
0
-1
May 11, 2007 - 3:32pm
Raisonance Support Team

Hi,

Due to the internal implementation of the debug using ICC, the watchdog will always make the debugger crash. (we have to patch the reset vector for it to point to the monitor, etc.) This is specified in the "Getting Started ST7" documentation, section "limitations of RLink".

The doc does not say it, but the same reason applies to the "hot reset".

There is nothing you, Raisonance or ST can do about this problem. You have to disable the watchdog during debug, and you cannot use the hot reset either. Sorry.

Please note that you can still reset the device using the reset command from RIDE. It will act just like the reset button on your board would.

Best Regards,

Vincent

+1
0
-1
May 11, 2007 - 4:49pm
Guest

Hi Vincent,

thanks a lot for the quick reply and the help.

I must have missed the entry for the Watchdog in the "limitations of RLink" section of the "Getting Started ST7" documentation. And since it is not mentioned in the documentation that the same limitation also applies to the "hot reset" I can not say for sure that I would have realised that, even if I had not missed the entry (I might have, but I can not say for sure).

In any case, it is good to know that a limitation of the debugger is the cause for the crash and that everything should be working if debugging ist disabled. In that case my work on the current part of the program is done and I can continue with the next part of the project.

Have a nice weekend and thanks again for the help.

With kind regards,
Stephan