This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with simulator-reset in µVision 3

Hi,

I've got a problem with the simulator of uVision3 and an AGSI-peripheral.
In function AgsiEntry in case nCode == AGSI_RESET all components of the peripheral are reset. Some write data to certain memory addresses - that are later used in the firmware on the controller to detect options.
The problem seems to be that if the application is downloaded to the controller (in the simulator) and the reset is performed the data is not written to the memory. Only after pressing the "Reset"-button in the simulator again are the values written to the memory - and the firmware can read them out correctly.

I'll try to give an example:
Lets say that the reset-function writes a value of 0xFD to memory address 0x4003. After downloading the application to the controller this value is not written into the memory (can be verified by using the memory window). If the firmware is started it goes wrong because the value was not written into the memory.
But if I press "Reset" after downloading the application the value is written into the memory and all goes well.

What I tried: I set a breakpoint into the reset-routine to make sure it is executed after downloading the application. And the breakpoint was hit. Actually there were two resets (which would be in accordance to application not 154). But why is the value not written into the memory?

I hope my post was somewhat understandable and maybe someone is able to help me.

Thanks in advance

  • Hi,

    I solved the problem. If anyone is interested in the solution just read on.
    The problem really is inside of Keil. As mentioned above some components of the simulation write to certain memory addresses for the firmware. This data is not written to the addresses when downloading the application.
    What I did was to cause a second reset with the help of an AGSI-timer. In the callback function of the timer all components are resetted again.
    What strikes me as kind of weired is, that the delay of the timer may be 0 ticks. But anyway, it works now.
    Hope I was able to help someone if he/she has the same problem.

    Regards