Forums Microcontroller Boards ARM LPC2929 simulation Problems

LPC2929 simulation Problems

Link to this post 10 Jul 14

Hey Pantec
I was browsing through Youtube when I came across this video from Pantec which uses a LPC2929 (ARM968 architecture) for a simple uVision build and hardware debug session:
I'm working on the same micro-controller. I want to simulate the simple "blinky" example which is part of the uVision examples for my board. I use the MCB2929 from Keil. I am able to build the project and debug the hardware using uLink2 without any problems. Now, when I want to simulate it to use uVision's performance analysis tools, I get the "Error65: access violation" message. I resolve it with the "map" command. When the code starts to execute, it gets stuck in the PLL_LOCK loop located in the startup.s file. When I check the RDET register for clock detection, it shows nothing. The simulation has no clock. I checked the VTREG variables, CLOCK and XTAL and they are both set to 12Mhz. What am I doing wrong here?? Do you have any experience with LPC2929 simulation in uVision? Any help would appreciated. Oh, and by the way,I use MDK4.54 and uVision4. Thanks.

Link to this post 11 Jul 14

Hi Charles black,
Can you send the screen shot image of Error message when during simulation.

Link to this post 11 Jul 14

The Line might be for cross checking the PLL Lock and is not required for simulation. So just comment that line and execute your simulation.

Link to this post 11 Jul 14

Hey Pantech!
Thanks for the speedy reply. As requested by Siva, I attached an image from my simulation environment. Just to add a few notes. As shown in the picture, in the disassembly window, the code starts from address 0x00000000, which is as expected. With reference to the LPC29xx user manual, the EXCEPTION VECTORS should be loaded at address 0x00000000 after reset; in my simulation, there is nothing!!! The startup code is located at address 0x20000000, which happens to be the start of the flash. I manually have to set the PCto the start of the flash and then execute.
To anser Sukumar, I've encircled the PLL_LOCK loop, where the code gets stuck. If I skip it, it gets stuck in the FIDV_LOOPS. These are the frequency divider outputs. There are 6 or 7 of them. If I skip them and reach main, the code doesn't work; none of the peripherals get set and the code just loops and loops forever. To investigate this, I examined the REDET (0xFFFF8018) or Clock detection register. It's contents, which I've encircled in the memory window, show no clock.
For further investigation, I ran the MCB1700 blinky example from the Keil installation folder. The MCB1700 is a Keil evaluation board which has a LPC1768 Coretex-M3 MC. The simulation was excellent!! I located the clock detection loop, it's located in the LPC1768_system.c file, and observed the reference register.It really detects a clock and waits for it to be set. All the peripheral registers are set and the simulation seems to be valid. Has Keil "forgotten" to add ARM968 support to uVision?? Or am I way off the mark?? Any suggestions would be of great help.
Again, thanks for you replies and sorry for the long post.

  1. jpg
Link to this post 13 Jul 14

hi charles just update your keil software there is no other option. Before choosing the version just check whether it will support ulink2. Many pirated ulink2 will not work on latest versions. And let me try to simulate the code at the same keil version. We at pantech not often used the simulation for LPC2929. Why dont you try your own code instead of blinky?

Link to this post 15 Jul 14

Hey Sukumar
I updated my uVision to uVision5. The problem still exists. As for why I'm trying to simulate, I need to use the performance analysis tools that are available in uVision. These include Code Coverage, the Logic analyzer and etc. These facilities are only available in simulation. Other than that, the blinky example works on the hardware.
P.S This is the link that I used for updating uVision:

Link to this post 15 Jul 14

Hi Charles,

I did some small tricks and documented it.And I simulated my own LED code attached here. The same can be applied to blinky also. Just Check it Whether it is useful?

  1. LPC2929_LED.rar
  2. Simulation.pdf