This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to put program to specify address using startup.s

Hi!
I am using ADUC7026 and Keil Arm Tools. I need to put all program to specify address(for example 0x8C800). I need to do this in startup.s, because I want MCU to jump to this address only on specially condition(for example GPIO pin low). In all other cases program must start from defaul address(0x80000). Thanks in advance

Parents
  • (I don't know much about this.)

    I think you may have to re-implement __main. (__main is not your main().)

    The relative documentation on KEIL's web is gone. So I am not able to provide an URL for you.
    Please check the documentation installed with your KEIL toolchain.

    
    RealView Libraries and Floating Point Support Guide
    
    Home > The C and C++ Libraries >
    Tailoring the C library to a new execution environment >
    How C and C++ programs use the library functions
    
    Initializing the execution environment and executing the application
    
    The entry point of a program is at __main in the C library where library code does the following:
    
      1. Copies non root (RO and RW) execution regions from their load addresses to their execution addresses.
    Also, if any data sections are compressed, they are decompressed from the load address to the
    execution address. See the Linker Guide for more information.
    
      2. Zeroes ZI regions.
    
      3. Branches to __rt_entry.
    
    If you do not want the library to perform these actions, you can define your own __main that branches
    to __rt_entry as shown in Example 2.1.
    
    

    (Actually, I don't know how to re-implement __main. I had read the documentation for other purposes.)

Reply
  • (I don't know much about this.)

    I think you may have to re-implement __main. (__main is not your main().)

    The relative documentation on KEIL's web is gone. So I am not able to provide an URL for you.
    Please check the documentation installed with your KEIL toolchain.

    
    RealView Libraries and Floating Point Support Guide
    
    Home > The C and C++ Libraries >
    Tailoring the C library to a new execution environment >
    How C and C++ programs use the library functions
    
    Initializing the execution environment and executing the application
    
    The entry point of a program is at __main in the C library where library code does the following:
    
      1. Copies non root (RO and RW) execution regions from their load addresses to their execution addresses.
    Also, if any data sections are compressed, they are decompressed from the load address to the
    execution address. See the Linker Guide for more information.
    
      2. Zeroes ZI regions.
    
      3. Branches to __rt_entry.
    
    If you do not want the library to perform these actions, you can define your own __main that branches
    to __rt_entry as shown in Example 2.1.
    
    

    (Actually, I don't know how to re-implement __main. I had read the documentation for other purposes.)

Children
No data