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
Just call a simple C function via the assembly of the startup file. then test the return value to decide. remember the limitations on code placed in startup (heap, stack etc.)
oops, sorry, that was a mistake. can't you jump to a different location once arriving in main? must the decision be placed in the startup?
The problem is: I put program to 0x8C800 address via uVision Target Options->LA Locate DATA (0x10000-0x11FFF), CODE (0x8C800-0x8F7FF), CONST (0x8C800-0x8F7FF)) But uVision put this program to 0x8DA69(I checked in Disassebmly window) so if jump to 0x8C800 nothing happened. I need to know hot to put start of main program to exactly 0x8C800 address. I think there are must be assembler operand to do this.
I checked in Disassebmly window
And you checked ... what?
I need to know hot to put start of main program to exactly 0x8C800 address.
No, you quite certainly don't need to know that. You need to learn why the address of main() is irrelevant to what you're trying to do there.
And you checked ... what? I used debugger to check where PC goes after startup
I need to know this for make jump to this address. I tried to make jump after initialization in startup.c to address 0x8C800, but nothing happened because program starts at 0x8DA69 address. I need to do this because I want to start two different programs on different address on different condition.
I need to do this because I want to start two different programs on different address on different condition.
sounds like a bootloader to me.
sounds like a bootloader to me Exactly I need to make bootloader.I want to put this bootloader to 0x8C800 address and main program to 0x80000. And call bootloader on condition.
what you need is a bootloader at the entry point into flash, e.g. 0x0. decide where you need to branch to in the main function of the bootloader itself. it should not "be called on condition"...