|
本帖最后由 spkk 于 2013-4-10 16:00 编辑
老师给布置的任务,要求是norflash上一句代码都不能有,从启动开始写起,实现串口收到一个数据后再发回一个数据,现在问题是收到的和发送的都是乱码,不知道是启动时初始化有问题还是怎么,AXD+jlink调试时发现0x50000020和0x50000024处的数据都没有对,代码如下,希望大神能帮我分析下大概是怎么回事。。。boot.s:启动初始化的代码
- ;***************work mode defines***********************
- USERMODE EQU 0x10
- FIQMODE EQU 0x11
- IRQMODE EQU 0x12
- SVCMODE EQU 0x13
- ABORTMODE EQU 0x17
- UNDEFMODE EQU 0x1b
- SYSMODE EQU 0x1f
- ;**************work mode defines end********************
- ;**************INTs defines*****************************
- NOINT EQU 0xc0
- SUBINTDIS EQU 0x4A00001C
- IRQDIS EQU 0x80
- FIQDIS EQU 0x40
- ;*************INTs defines end**************************
- ;*******************hardware defines********************
- WTCON EQU 0x53000000
- LOCKTIME EQU 0x4C000000
- CLKDIV EQU 0x4C000014
- UPLLCON EQU 0x4C000008
- MPLLCON EQU 0x4C000004
- M_MDIV EQU 92
- M_PDIV EQU 1
- M_SDIV EQU 1
- U_PDIV EQU 2
- U_MDIV EQU 56
- U_SDIV EQU 2
- ;******************hardware defines end*****************
- ;------------------Stack Addr Define--------------------
- _STACKBASEADDR EQU 0x33ff8000
- StackUse EQU (_STACKBASEADDR-0x3800)
- StackSvc EQU (_STACKBASEADDR-0x2800)
- StackUnd EQU (_STACKBASEADDR-0x2400)
- StackAbt EQU (_STACKBASEADDR-0x2000)
- StackIRQ EQU (_STACKBASEADDR-0x1000)
- StackFIQ EQU (_STACKBASEADDR-0x0000)
- ;-------------Stack Addr Define Ends--------------------
- IMPORT IRQHandle
- ;this is used by asm
- IMPORT FIQ_Exception ;the FIQ process func,used by asm
- IMPORT Main
- EXPORT HandlerSWI ;this is used by c
- GET inc/memdef.inc
- CODE32
- AREA Boot,CODE,READONLY
- ENTRY
- Vectors
- B ResetInit ;reset int.
- B HandlerUndef ;the undefined int
- B HandlerSWI ;software int
- B HandlerPabort ;int for get command error,use for MMU
- B HandlerDabort ;int for get data error,use for MMU
- NOP ;reserved
- ;B HandlerIRQ ;int
- B IRQHandle
- B HandlerFIQ ;fast int
复制代码 main.c 串口初始化以及发送接收
|
|