|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2014-5-21 13:28:19
|
显示全部楼层
本帖最后由 wotyndal 于 2014-5-21 13:31 编辑
我也觉得应该是SP的设置问题,但是我设置SP了的,大侠帮忙看看哈!
1. 如下是启动代码:
PRESERVE8
; Area Definition and Entry Point
; Startup Code must be linked first at Address at which it expects to run.
AREA RESET, CODE, READONLY
ARM
; Define hardware config parameters *******************************************;
; SDRAM
EXPORT SDRAM_SIZE ; Declare SDRAM_SIZE can be used in other files(including C)
EXPORT SDRAM_BASE ; Declare SDRAM_BASE can be used in other files(including C)
SDRAM_SIZE EQU (64000000) ; 64Mbits
SDRAM_BASE EQU (0x30000000) ; SDRAM base addr
; --startup = _START
EXPORT _START
_START
LDR sp, =4*1024 ; Set stack, Internal 4KB SRAM
LDR lr, =ENTER_MAIN ; Set return addr(absolutely)
IMPORT Board_PreConfig ; Board_PreConfig is external
LDR pc, =Board_PreConfig ; Jump to Board_PreConfig(in Board.c)
; Enter the main function
ENTER_MAIN
LDR sp, =(SDRAM_SIZE+SDRAM_BASE) ; Set stack at the top of SDRAM
LDR lr, =END_PROGRAM
IMPORT main
LDR pc, =main ; Go to main function
END_PROGRAM
END
2. 下面是C文件内容
void Watchdog_Config( void )
{
WTCON = 0; // Close Watchdog
}
void Board_PreConfig( void )
{
Watchdog_Config( );
} |
|