Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
if you are working on 8 bit controller then you add or dont add does not make difference. but when you work with 32bit controllers then the startup code of the manufacturer and device specific should be mandatorily added, or else the compilation of program will not be done in advance programs.
• Startup code is an extra piece of software that executes prior to main(). The startup code is generally written in assembly language and linked with any
executable that you build.
• It prepares the way for the execution of programs written in a high-level language.
• Each such language has its own set of expectations about the run-time environment in which programs are executed.
• For example, many languages utilize a stack. Space for the stack must be allocated and some registers or data structures initialized before software written in the
high-level language can be properly executed.
Startup code for C/C++ usually performs the following actions:
• Disable interrupts
• Copy any initialized data from ROM to RAM
• Zero the un-initialized data area
• Allocate space for and initialize the stack
• Create and initialize the heap
• Execute the constructors and initializers for all global variables (C++ only)
• Enable interrupts
• Call main()
A startup code is adviced not to be modified unless you know the internal architecture and working of every component inside the controller.
things you can modify. the remapping of memory. SP and PC value, stack position and size, PLL clock, peripherals definition and address, ISR or 7 modes of operation. their control etc, clock input to peripherals etc...
if it is tampered without knowledge then it make the controller work or behave wrongly or give wrong output.... it can also cause other damages to the controller....
Once you make changes to the file you have to recompile the program / project and flash the hex file to the controller.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.