This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Write Entry Point to specified address in Flash



Hi,

I want to store the Entry Point to a different location, but I don't know how, or how to retrieve the address.

I'm building a custom booloader for the F28035 at the moment.

What I try to do is devide the Flash into 2 parts:

SECTOR G-H: Bootloader

SECTOR B-F: Main-Program

SECTOR A: Only program the entry point.

What does the bootloader need to do:

1. Set entrypoint to the bootloader

2. Erase+Flash Program

3. Set entrypoint to the Main-Program

4. Branch (or Reset)  to the Main-Program

The Main-Program however also needs to be able to update the Bootloader, so there will be flash functionality in the Main-Program too.

Now.... the problem.... when I use the debugger to flash the Main-Program, and after that the Bootloader or vise versa, I will lose the entry-point of the one I flashed first, so I reserved locations in flash to store those addresses, but how can I get that address and store it at the specified location when flashing with a debugger?

The way I create this bootloader+program, is that the right way, or am I trying to do thing the hard way?

Kind Regards,

Heiny

  • Ok, basicly I only need to write a value to to a section before compile time.

    I created a section on Page 1, of 1 word and I want to write the value of "LB _c_int00" on that location.

    1.  How do I write a value to that location in the .out file, so during linking

    2. How can I get the value of c_int00 (_c_int00) during linking?

    Thanks in advance,

    Greetz Heiny