当前位置:网站首页>The execution process before executing the main function after the DSP chip is powered on

The execution process before executing the main function after the DSP chip is powered on

2022-06-21 09:39:00 ah_ yl

With tms320f28377d For example :

Suppose we create a project test;

The documents to be noted in this project include ( See the picture 1):

1、 main.c file ;

2、 DSP Used to connect to .coff( Executable file ) Of  .cmd file ;

3、 28377 Model appropriate F2837xD_CodeStartBranch.asm file

 

chart 1

main The specific contents of the procedure are as follows ( See the picture 2): Just one main application , Random content ;

 

chart 2

When we burn the project into dsp On chip in a chip FLASH when ,dsp How to execute the code in the chip when powered on ( Code execution process );

 

First , stay dsp In the online debugging state , Get into debug Interface , open view In the menu bar Disassembly Options ( See the picture 3); Here we can view the film flash Assembly code corresponding to different addresses on ;

 

chart 3

Open as follows : We click debug In the interface CPU Reset after ;

At this point, the chip restarts ; The running position of the code after restart is on-chip flash Address 0x3ff16a( See the picture 4), The code at this location is Ti Procedures that have been cured before leaving the factory , The function is to complete the bottom register , Environment configuration of stack, etc ;

 

chart 4

Next , wait for Ti At the bottom boot After the program is initialized ,DSP The chip will jump to 0x80000 To execute the user's first instruction ; We're at the address 0x80000 Set a breakpoint at ; Click continue ( See the picture 5);

 

chart 5

here , The program stops at the set breakpoint 0x80000 It's about , This is a dsp The bottom layer is powered on after execution boot after , Address of the first user instruction executed ;DSP Default flash start-up ,dsp Start up boot After the initialization , Program PC Set to flash Address of the 0x80000 To execute the user's first instruction , namely F2837xD_CodeStartBranch.asm In the document code_start function ( See the picture 6); Observe flash stay 0x80000 Memory contents at , There is only one jump instruction in the program 0048 201C ( The machine code means 004/ Jump to 8201C It's about ); namely LB  _c_int00, Jump to function _c_int00;( Be careful : Suppose we configure cmd file ;BEGEIN:           origin=0x082000,length=0x000002; When we connect the emulator online , The program can run normally , But when we don't connect the emulator , keep dsp The chip is powered on when the emulator is not connected , here , The program has indeed been burned into dsp Of flash In the chip , But the chip will not work normally after it is powered on ; because ,dsp At the completion of boot And then I'll run 0x80000 To execute the user's first instruction , And ours cmd In file :code_start:>BEGIN The first command of power on operation is written in flash 0x82000 It's about , and 0x80000 There is no executable code at , So our chip will not run after it is powered on

 

chart 6

stay Disassembly Click step by step , The next instruction the program runs is _c_int00 function ; The function address is

0x8201C, Consistent with the jump address of the machine code ( See the picture 7); The main functions of this function are : Initialize registers and stacks for application layer code written by users ; Continue to step down ;(_c_int00 Save in boot28.asm in , This file is a library file , Not within the scope of user creation )

 

chart 7

You can find that the program runs to LCR __args_main This assembly instruction ( Still in _c_int00 Function ); This Assembly statement means to jump to __args_main Function and return ( if main Function cannot return, then the function cannot return );

Continue to click step by step , Get into __args_main Function ( See the picture 8);

 

chart 8

You can find ,__args_main The last instruction the function executes is written by the user main function ;(__args_main Function saved in args_main.c in , This file is a library file , Not within the scope of user creation )( See the picture 9)

 

chart 9

 

thus , We can DSP The process of power on operation is summarized as follows :

 

chart 10

原网站

版权声明
本文为[ah_ yl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221443018275.html