how to let the program run from function _Startup

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to let the program run from function _Startup

1,583 Views
maoer
Contributor I

Hi,

 

I'm trying to debug my application based on MC9S08DZ60 and encountered a problem need your help.

 

I used the following link file in my project and hope the program will run from the function _Starup in the file Star08.c . but in fact, the program runs from the function main in full chip simulation mode.  could any one tell me why the problem occurs and how to resolve the problem?

 

below is the link file I uesd. Thanks

 

###################################################################
*/

NAMES

END

SECTIONS
    Z_RAM                    =  READ_WRITE   0x0080 TO 0x009F;
    RAM                      =  READ_WRITE   0x00A0 TO 0x107F;
    ROM                       =  READ_ONLY    0x1900 TO 0xFFAD;
    EEPROM                   =  READ_ONLY    0x1400 TO 0x17FF;
END

PLACEMENT
    DEFAULT_RAM                         /* non-zero page variables */
                                        INTO  RAM;

    DEFAULT_ROM, ROM_VAR, STRINGS       INTO  ROM;
    _DATA_ZEROPAGE,                     /* zero page variables */
    MY_ZEROPAGE                         INTO  Z_RAM;
END

 

the CPU module. */

STACKSIZE 0x0080                       /* Size of the system stack. Value can be changed on the "Build options" tab */

VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */

Labels (1)
0 Kudos
Reply
4 Replies

526 Views
maoer
Contributor I

I tried the way you mentioned. now the program can execute as expected.

 

Thank you all for your great help.

0 Kudos
Reply

526 Views
maoer
Contributor I

Thank you for your help.

 

I tried the second way and the program can start at the function Startup.

 

but I don't know how to set the option in CW to let the program starts at the function Startup you mentioned .

0 Kudos
Reply

526 Views
CrasyCat
Specialist III

Hello

 

This can be done in HI-WAVE in the following way:

  - Start the debugger the usual way (click on Debug button).

  - Select "File" -> "Configuration"

  - Change to "Load" Tab

  - Uncheck "Run after Successful load"

  - Click OK to close the dialog.

 

Next time you start eh debugger application will stop at its entry point (_Startup).

 

Note that this settings is project specific, So you need to do that once for each project you want to debug.

 

I hope this helps.

 

CrasyCat

0 Kudos
Reply

526 Views
CompilerGuru
NXP Employee
NXP Employee

The application does start at _Startup, just for "ease of use" the debugger let is run to main

before you first see the state. There is a setting for this, check the menus in hiwave (sorry forget where it is exactly). Find it, change it and click the save menu once, then it should be used in future debug sessions.

Another way to start debugging from _Startup is to simply press the reset button. Then you end up starting the debug process again at _Startup.

 

Daniel

 

0 Kudos
Reply