Hi. I am using uVersion2 IDE. Here after reset, MPU will execute code from reset vector located in Startup.A51 file and after some initialization, it will jump to label named as ?C_START which is defined in Init.A51, where it does some other initialization. If we dont include the Init.A51 in project, then will it automatically include for project ? If we dont want to use this Init.A51 file and instead of jumping to ?C_START from Startup.A51, we modify this to jump to Main direclt then will it create any proble ? Thanks.
If no variables need initialization, what will INIT.A51 look like? just "jmp main" I guess. INIT.A51 is not a compiler-generated file, so no, it won't change its shape depending on what the actual program uses, and what it doesn't. The startup sequence is: STARTUP.A51 --> defines ?C_STARTUP at boot address (usually 0), does all initialization independent of the program; finishes by jumping to ?C_START INIT.A51: defines ?C_START, carries out static initializations by going through data in segment ?C_INITSEG; finishes by jumping to MAIN. If the project doesn't define ?C_STARTUP in a module of its own (e.g. a modified copy of STARTUP.A51), then a pre-compiled version from the C library is pulled in automatically by the linker. Similarly, if that file references ?C_START, but no object in the project defines it, the linker pulls a pre-compiled INIT.A51 from the library.