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

Simulation Problem

All:

I have been working on projects using both the MCB2300 board (using NXP LPC2378 ARM7) and the MCBSTR9 (using the ST STR912 ARM9)

Example code seems to run okay on the board(s), but when I run the same code in the simulator, the code hangs in a small loop of assembler code that is waiting for the oscillator to stabilize. For the ARM7, the code is this:

OSC_Loop        LDR     R3, [R0, #SCS_OFS]    ; Wait for main osc stabilize
                ANDS    R3, R3, #OSCSTAT
                BEQ     OSC_Loop

I'm guessing that the reason the code never exits the loop is that there is nothing to cause the simulated oscillator to "stabilize".

Any ideas on how to get the code to run in the simulator? I guess I could comment out the block of code, but that seems like a crude "hammer" approach!

Any ideas appreciated,

-=Rich=-

Parents
  • I just thought there might be ... a way I could get uVision to "simulate" a stabilized oscillator (through a script, dialog box, etc.).

    You thought right.

    You can create a signal function that waits for a read of SCS_OFS and, when triggered, sets or clears the appropriate bits. For example:

    signal void watch_SCS (void) {
      while (1) {
      rwatch(SCS_OFS);             // Wait for read of SCS_OFS
      _WDWORD(SCS_OFS, OSCSTAT);   // Write new value to SCS_OFS
      }
    }
    

    This should get you started. Note that this is not complete or even tested code. But, I think it's enough to demonstrate the concept.

    Refer to the following knowledgebase article for more information about rwatch:

    http://www.keil.com/support/docs/1815.htm

    Jon

Reply
  • I just thought there might be ... a way I could get uVision to "simulate" a stabilized oscillator (through a script, dialog box, etc.).

    You thought right.

    You can create a signal function that waits for a read of SCS_OFS and, when triggered, sets or clears the appropriate bits. For example:

    signal void watch_SCS (void) {
      while (1) {
      rwatch(SCS_OFS);             // Wait for read of SCS_OFS
      _WDWORD(SCS_OFS, OSCSTAT);   // Write new value to SCS_OFS
      }
    }
    

    This should get you started. Note that this is not complete or even tested code. But, I think it's enough to demonstrate the concept.

    Refer to the following knowledgebase article for more information about rwatch:

    http://www.keil.com/support/docs/1815.htm

    Jon

Children
No data