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

How to see C code when using ULINK2 with Atmel AT91RM9200

I'm using a Keil Ulink2 ICE debugger with an Atmel AT91RM9200 (ARM 9) powered board.
My problem is that it doesn't look like I'm benefiting from all the features of the debugger.
For example, in the Disassembly window, I don't see the C code mixed with the assembly instructions, like in the following picture:

http://www.keil.com/uvision/db_view_disasm.asp

Also, the Debug Settings from the Debug menu is not active.

When I use the simulator from uVision, I can use both of these features. But the simulator doesn't help me too much, as I need the hardware.

Are there some hidden settings in order to fully use the ICE debugger?
Thanks

  • UPDATE

    I link the code at address 0x10000000 but when I start the ICE debugger it shows me the code at address 0x0. If I go to address 0x10000000 I can see the C code (with comments), but the assembly code from that address is junk. My assembly code is at address 0x0.

    Why?

    I don't see this problem with the simulator.

    My scatter file looks like this:

    BOOT_MEM 0x10000000 0x10000

    {

    BOOT_RO +0

    {

    cstartup_keil_new.o (reset, +First)

    * (+RO)

    }

    BOOT_RW +0

    {

    * (+RW)

    }

    BOOT_ZI +0

    {

    * (+ZI)

    }

    ARM_LIB_HEAP 0x10005000 EMPTY 0xB000-0x400{}

    ARM_LIB_STACK 0x10010000 EMPTY -0x400{}

    }

  • UPDATE

    OK. Sorry for the ambiguous previous posts. My code is at the address I linked it, where it should be, not at address 0x0, as I said. I got confused, because at address 0x0 it is mapped the ROM code with the original Vector table. I have my own vector table and I thought the one from 0x0 was mine. So I did manage to find my assembly code interleaved with the commented source code.

    The problem that I still face is that the code doesn't get executed. I tried with a step by step execution and the instructions remain gray (they don't get turn into green or something else), as if they were not executed. The PC is incremented and the registers get modified (I looked in the register window) but the instructions are not executed.
    BL, BX instructions are just ignored and the PC is not updated with the address of the called functions. It is incremented by 4 and that's it. Eventually the code gets into a prefetch abort or in a loop from the ROM code, depending on how I link it.

    Why is this happening and how can I solve it?
    Thanks.

  • Have you looked at the PC value? Where is the processor running? Where your application is downloaded?

    What reason would your processor have to know where you have downloaded your program? What would make it jump to the start address of your program?

  • Hello Valeriu,

    You asked:

    It is incremented by 4 and that's it. Eventually the code gets into a pre-fetch abort or in a loop from the ROM code, depending on how I link it

    To test your hardware configuration, please run one of these examples, found on your hard drive at:

    \Keil\ARM\Boards\Atmel\AT91RM9200-EK

    There are multiple targets for these examples. You can switch between these with the 'Select current Target' pull-down in the build toolbar. See:

    http://www.keil.com/support/man/docs/uv3/uv3_ui_project.htm

    You may not have your retarget.c file configured correctly. Try using the one in these examples.

    Also, when you post any code, including a semihosting file, please place source code source code between 'pre' and '/pre' tags.

    For more information please read the 'Tips for Posting Messages' link in the reply message window.