这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » Multi,ICE,XXX,ICE,LPC2000,MCU 请教用Multi-I

共2条 1/1 1 跳转至

Multi,ICE,XXX,ICE,LPC2000,MCU 请教用Multi-ICE或XXX-ICE调过LPC2000系列MCU的朋友!

院士
2006-09-17 18:14:16     打赏
Multi,ICE,XXX,ICE,LPC2000,MCU 请教用Multi-ICE或XXX-ICE调过LPC2000系列MCU的朋友!



关键词: Multi     LPC2000     请教     Multi-IC    

院士
2006-12-22 22:43:00     打赏
2楼
问 我在使用techorICE V5调试LPC2000系列MCU时出现了Data Abort的错误。

调试环境如下: Windows2000 Profession + ADS V1.2 (build with 844 and 848)
硬件环境为  : 周立功的EasyARM2104板(板载LPC2106)/ Keil公司的MCB2130(板载LPC2138) + techorICE V5
调试例程全部用汇编写,如下:

;*******************************************************************************
;                            Code Section TargetInit
;*******************************************************************************

                    AREA    TargetInit, CODE, READONLY
                    CODE32
                    ENTRY

Reset_Handler                                               ; Reset handler
InitPLL                                                     ; ----- Setup PLL -----
        IF (PLL_EN /= 0)
                    LDR     R0, =PLL_BASE
                    MOV     R1, #0xAA
                    MOV     R2, #0x55

                    ; Configure and enable PLL
                    LDR     R3, =PLLCFG_VAL
                    STR     R3, [R0, #PLLCFG_OFS]
                    MOV     R3, #PLLCON_PLLE
                    STR     R3, [R0, #PLLCON_OFS]
                    STR     R1, [R0, #PLLFEED_OFS]
                    STR     R2, [R0, #PLLFEED_OFS]

                    ; Wait and PLL locked
PLL_Loop            LDR     R3, [R0, #PLLSTAT_OFS]
                    ANDS    R3, R3, #PLLSTAT_PLOCK
                    BEQ     PLL_Loop

                    ; Switch to PLL clock
                    MOV     R3, #(PLLCON_PLLE + PLLCON_PLLC)
                    STR     R3, [R0, #PLLCON_OFS]
                    STR     R1, [R0, #PLLFEED_OFS]
                    STR     R2, [R0, #PLLFEED_OFS]
        ENDIF                                               ; ----- End of Setup PLL -----


InitMAM                                                     ; ----- Setup MAM -----
        IF (MAM_EN /= 0)
                    LDR     R0, =MAM_BASE
                    MOV     R1, #MAMTIM_VAL
                    STR     R1, [R0, #MAMTIM_OFS]
                    MOV     R1, #MAMCR_VAL
                    STR     R0, [R0, #MAMCR_OFS]
        ENDIF                                               ; ----- End of Setup MAM -----


REMAP                                                       ; ----- Setup Interrupt Remap -----
        IF (RAM_REMAP_EN /= 0)
                    MOV     R0, #0x40000000
                    LDR     R1, =Vectors
                    LDMIA   R1!, {R2-R9}
                    STMIA   R0!, {R2-R9}
                    LDMIA   R1!, {R2-R9}
                    STMIA   R0!, {R2-R9}

                    LDR     R0, =MEMMAP                     ; Do remap
                    MOV     R1, #0x02
                    STR     R1, [R0]
        ENDIF                                               ; ----- End of Setup Interrupt Remap -----


InitStack                                                   ; ----- Setup Stack for Each Mode -----
                    MOV     R0, LR

                    ; Enter Supervisor mode and set its stack pointer
                    MSR     CPSR_c, #(MODE_SVC :OR: CPSR_IRQ_BIT :OR: CPSR_FIQ_BIT)
                    LDR     SP, Stack_SVC

                    ; Enter IRQ mode and set its stack pointer
                    MSR     CPSR_c, #(MODE_IRQ :OR: CPSR_IRQ_BIT :OR: CPSR_FIQ_BIT)
                    LDR     SP, Stack_IRQ

                    ; Enter FIQ mode and set its stack pointer
                    MSR     CPSR_c, #(MODE_FIQ :OR: CPSR_IRQ_BIT :OR: CPSR_FIQ_BIT)
                    LDR     SP, Stack_FIQ

                    ; Enter Abort mode and set its stack pointer
                    MSR     CPSR_c, #(MODE_ABT :OR: CPSR_IRQ_BIT :OR: CPSR_FIQ_BIT)
                    LDR     SP, Stack_ABT

                    ; Enter UNDEF mode and set its stack pointer
                    MSR     CPSR_c, #(MODE_UND :OR: CPSR_IRQ_BIT :OR: CPSR_FIQ_BIT)
                    LDR     SP, Stack_UND

                    ; Enter User mode and set its stack pointer
                    MSR     CPSR_c, #MODE_SYS
                    LDR     SP, Stack_USR

                    MOV     R0, #(MODE_USR :OR: CPSR_IRQ_BIT :OR: CPSR_FIQ_BIT)
        IF (FIQ_EN = 1)
                    BIC     R0, R0, #CPSR_FIQ_BIT
        ENDIF
        IF (IRQ_EN = 1)
                    BIC     R0, R0, #CPSR_IRQ_BIT
        ENDIF
                    MSR     CPSR_c, R0

                    B       .

Stack_USR           DCD     UsrStackSpace + (USR_Stack_Size - 1) * 4
Stack_SVC           DCD     SvcStackSpace + (SVC_Stack_Size - 1) * 4
Stack_IRQ           DCD     IrqStackSpace + (IRQ_Stack_Size - 1) * 4
Stack_FIQ           DCD     FiqStackSpace + (FIQ_Stack_Size - 1) * 4
Stack_ABT           DCD     AbtStackSpace + (ABT_Stack_Size - 1) * 4
Stack_UND           DCD     UndStackSpace + (UND_Stack_Size - 1) * 4


;*******************************************************************************
;                            Data Section MyStacks
;*******************************************************************************

                    AREA    MyStacks, DATA, NOINIT, ALIGN = 3

UsrStackSpace       SPACE   USR_Stack_Size * 4
SvcStackSpace       SPACE   SVC_Stack_Size * 4
IrqStackSpace       SPACE   IRQ_Stack_Size * 4
FiqStackSpace       SPACE   FIQ_Stack_Size * 4
AbtStackSpace       SPACE   ABT_Stack_Size * 4
UndStackSpace       SPACE   UND_Stack_Size * 4


                    END


出现的问题是:如果首先用Multi-ICE Server或板上的复位按键复位系统,向AXD中Load调试映象文件后,调试时总是出现Data Abort的错误,AXD一句都调试不下去。我对照了ARM公司的Multi-ICE User Guide和我的仿真器供应商给出的FAQ,还是找不出原因。


一个细节的问题是:如果我的代码中使能了地址重映射,那么在首次将该代码load进入目标系统的RAM后退出AXD,再启动AXD并load该image后,便可以进行调试了;如果在代码中没有使能地址重映射,那么无论将对应的image载入多少次,都无法调试,错误都是Data Abort。




在此请教众位用过Multi-ICE或国产XXX-ICE的朋友,在调LPC2000时是否遇到过这个问题?

谢谢! 1: 说明一下!我的工程中已经设定了RW_BASE=0x40003000, RO_BASE = 0x40000040,映象文件也可以从ADS集成环境中成功载入到目标系统中,并且AXD调试器在载入映象后也没有报任何错误,可就是无法仿真下去! 2: 我用过ws-120调试过2129/2292,没碰见你说的问题啊!内部ram调试,用周立功的模板就可以的! 3: laoshan朋友能不能提供一下您的调试例程!lndlty55@yahoo.com.cn

谢谢! 4: 我下载了ZLG的模块,还是不行!2104和2100的都用了,不行!

我直接就用的是里面的asm for lpc2100的工程模块.同样的错误!

我的仿真器供应商说原厂的Multi-ICE也有这个问题,是真的吗?

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]