TI中文支持网
TI专业的中文技术问题搜集分享网站

DSP28035 混合编程

本人是新手,在看28035程序,由于是混合编程,有一段代码看不懂什么意思。

在汇编文件里定义了 .global _InitRAMPointer   ,_InitRAM

下面又写了这条语句_InitRAMPointer  LB _InitRAM

在.C文件有 有这条语句extern void InitRAMPointer(void);

之后在主程序里调用的 InitRAMPointer();    写的备注是//ram initialize

请问是什么意思呢? ram是怎样初始化的? 程序如何执行的?

谢谢!

Susan Yang:请问能否给出具体信息或者代码?

本人是新手,在看28035程序,由于是混合编程,有一段代码看不懂什么意思。

在汇编文件里定义了 .global _InitRAMPointer   ,_InitRAM

下面又写了这条语句_InitRAMPointer  LB _InitRAM

在.C文件有 有这条语句extern void InitRAMPointer(void);

之后在主程序里调用的 InitRAMPointer();    写的备注是//ram initialize

请问是什么意思呢? ram是怎样初始化的? 程序如何执行的?

谢谢!

user6106831:

回复 Susan Yang:

The second level boot loader and application depend on these
; constants being exactly where they are.Their addresses are
;hard coded in the linkder command files because the DSECT
; liker directive does not prevent overlaying code on the
;specified section but instead puts code wherever it wants.

; THE NUMBER AND LOCATION OF THESE CONSTANTS CANNOT BE CHANGED
;WITHOUT ALSO CHANGING THE SECOND LEVEL BOOT AND APPLICATION!
;.global _ApplicationValidPointer, _Application_Valid.global _Application_Valid.global _WatchDogKickPointer,_Watch_Dog_Kick;C语言中调用汇编函数,汇编文件中用 .global定义,程序标号前加_.global _B1AppEntryPointer , _B1_App_Entry.global _B1RstEntryPointer , _B1_Rst_Entry.global _MemCopyPointer, _MemCopy.global _InitSysCtrlPointer,_InitSysCtrl.global _InitGpioPointer,_InitGpio.global _DisableDogPointer,_DisableDog.global _EnableDogPointer,_EnableDog
.global _InitCpuTimersPointer,_InitCpuTimers.global _InitPieCtrlPointer , _InitPieCtrl.global _InitPieVectTablePointer , _InitPieVectTable.global _InitPeripheralsPointer , _InitPeripherals.global _InitRAMPointer,_InitRAM.global _USER_ISR_Pointer, _USER_ISR.global _uiI2caWriteDataPointer, _uiI2caWriteData.global _uiI2caReadDataPointer , _uiI2caReadData.global _fReadFloatDataThreePointer,_fReadFloatDataThree.global _Boot_Version;_Hardware_Version.global _StartTimer;, _StartTimerPointer.global _TimeIsUp;, _TimeIsUpPointer .global _uiI2caWriteData1Pointer, _uiI2caWriteData1.global _uiI2caWriteData2Pointer, _uiI2caWriteData2.global _uiI2caReadData1Pointer, _uiI2caReadData1.global _uiI2caReadData2Pointer, _uiI2caReadData2.global _InitSciPointer,_InitSci.global _ucAsc2HexPointer , _ucAsc2Hex.global _uiHex2AscPointer , _uiHex2Asc.sect ".bootvec"
_Boot_Version.int0x0100.int0x0100

_B1AppEntryPointerLB _B1_App_Entry;0x3F7002/0x3F6002
_WatchDogKickPointer LB _Watch_Dog_Kick;0x3F7004/0x3F6004
_B1RstEntryPointer LB _B1_Rst_Entry;0x3F7008/0x3F6008
_MemCopyPointerLB _MemCopy;0x3F700A/0x3F600A
_InitSysCtrlPointer LB_InitSysCtrl;0x3F700C/0x3F600C
_InitGpioPointer LB_InitGpio;0x3F700E/0x3F600E

_DisableDogPointer LB_DisableDog;0x3F7016/0x3F6016
_EnableDogPointer LB_EnableDog;0x3F7018/0x3F6018
_InitCpuTimersPointerLB _InitCpuTimers ;0x3F701A/0x3F601A

_InitPieCtrlPointer LB _InitPieCtrl;0x3F7022/0x3F6022
_InitPieVectTablePointer LB _InitPieVectTable;0x3F7024/0x3F6024

;#定义 _InitRAM 为外部程序可以访问的标签
_InitRAMPointerLB _InitRAM;0x3F7028/0x3F6028
_USER_ISR_Pointer LB _USER_ISR;0x3F702A/0x3F602A

_uiI2caWriteDataPointerLB _uiI2caWriteData;0x3F702C
_uiI2caReadDataPointerLB _uiI2caReadData;0x3F702E

_fReadFloatDataThreePointer LB _fReadFloatDataThree ;0x3F703C
_uiI2caWriteData1Pointer LB _uiI2caWriteData1 ;0x3F703E
_uiI2caWriteData2Pointer LB _uiI2caWriteData2 ;0x3F7040
_uiI2caReadData1PointerLB _uiI2caReadData1 ;0x3F7042
_uiI2caReadData2PointerLB _uiI2caReadData2 ;0x3F7044
_InitSciPointerLB _InitSci
_ucAsc2HexPointer LB _ucAsc2Hex
_uiHex2AscPointer LB _uiHex2Asc
;********************************************************************.ref _c_int00.global_BOOT_MAIN.global_g_u16FromApplication,_g_u16MdlAddr
__stack: .usect ".stack",0.sect "FlashBoot"
_B1_Rst_Entry:MOVAL,#__stackMOV@SP,ALSPM0SETCOBJMODECLRCAMODE.c28_amodeSETCM0M1MAPCLRCPAGE0;28x modeMOVWDP,#0x0000CLRCOVMASPSETC INTMMOVAL,#0MOVW DP,#_g_u16MdlAddr ; _uiMdlAddr = 0MOV@_g_u16MdlAddr,ALLBContinueB1
_B1_App_Entry:SETC INTM MOVAL,#0FFH
ContinueB1:MOVW DP,#_g_u16FromApplicationMOV@_g_u16FromApplication,ALLCR_BOOT_MAINSETC INTM; disable interrupts
justdie:LBjustdie

;***********************************************************************
.global_main,_exit.sect ".appvec"
_Application_Entry_Point:MOVAL,#__stackMOV@SP,ALLCR_main;LB_c_int00,0x003F4000

_exit_entryLCR_exit

;***********************************************************************.global _CRC16_CheckWord.sect "appcrc"
_CRC16_CheckWord:.int 0x4616
;***********************************************************************.end
;===========================================================================
; No more.
;===========================================================================

这个是asm文件的全部代码。

本人是新手,在看28035程序,由于是混合编程,有一段代码看不懂什么意思。

在汇编文件里定义了 .global _InitRAMPointer   ,_InitRAM

下面又写了这条语句_InitRAMPointer  LB _InitRAM

在.C文件有 有这条语句extern void InitRAMPointer(void);

之后在主程序里调用的 InitRAMPointer();    写的备注是//ram initialize

请问是什么意思呢? ram是怎样初始化的? 程序如何执行的?

谢谢!

Susan Yang:

回复 user6106831:

建议您给出程序的详细出处/路径

对汇编也不太熟悉

赞(0)
未经允许不得转载:TI中文支持网 » DSP28035 混合编程
分享到: 更多 (0)