What is a startup code ? Can i manually modify it


This is a general question about startup code. I know it's like the bootloader or the first thing that run after reset or power up and it call the main function.

But i want to know it main / core functionnalities.

For example,

Startup code is executed immediately upon reset of the target system. The Keil startup
code performs (optionally) the following operations in order:
 Clears internal data memory
 Clears external data memory
 Clears paged external data memory
 Initializes the small model reentrant stack and pointer
 Initializes the large model reentrant stack and pointer
 Initializes the compact model reentrant stack and pointer
 Initializes the 8051 hardware stack pointer
 Transfers control to code that initializes global variables or to the main C function if
there are no initialized global variables

What about the startup code for renesas RH850 as example ? And why & when i will need to modify it and what are the risks involved ?

Thanks for your time

  • Hi chfakht,

    You are correct that a startup code is the first thing that runs after a reset or power up. It is at its core a set of code that prepares the microcontroller to execute software which are written in higher level language. The code is written for the microcontroller to function as designed and could be as simple as a few lines of code to initialize memory location, interrupt controls, check peripherals and other diagnostics or it could be something more complex.



    RenesasRulz Moderator