Hello,
I have this scatter file
LR_IROM1 APPLICATION_START_ADDRESS APPLICATION_IMAGE_MAX_SIZE { ; load region size_region ER_IROM1 APPLICATION_START_ADDRESS RESET_VECTOR_AND_KERNEL_SIZE { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) *(privileged_functions) .ANY (+RO) } ER_IROM2 (APPLICATION_START_ADDRESS + RESET_VECTOR_AND_KERNEL_SIZE) (APPLICATION_IMAGE_MAX_SIZE - RESET_VECTOR_AND_KERNEL_SIZE) { .ANY (+RO) }
where
#define PBOOT_START_ADDRESS (0x0) #define MBOOT_START_ADDRESS (PBOOT_START_ADDRESS + PBOOT_IMAGE_MAX_SIZE) #define APPLICATION_START_ADDRESS (MBOOT_START_ADDRESS + MBOOT_IMAGE_MAX_SIZE) #define RESET_VECTOR_AND_KERNEL_SIZE (0x4000) #define INTERNAL_FLASH_MAX_SIZE (0x80000) #define PBOOT_IMAGE_MAX_SIZE (0x1000) #define MBOOT_IMAGE_MAX_SIZE (0x4000) #define APPLICATION_IMAGE_MAX_SIZE (INTERNAL_FLASH_MAX_SIZE - PBOOT_IMAGE_MAX_SIZE - MBOOT_IMAGE_MAX_SIZE)
and my LPC1788 ends up in a hard fault, after attempting to load the address of SystemInit, here:
Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0
But if I remove ER_IROM2 - scatter loading works and the controller starts up. Am I hitting a linker limitation here? Any ideas? I must place my kernel image at the beginning of flash (via the section "privileged_functions").
Well I am not amused. I asked a technical question, and I get back a pack of drivel. If the guy cannot make himself coherent, he better not say anything...
so tapeer i pas my drivel threw googel transleight and got this
<TranslateStart>
And what did you find? The clue must be there. Look for the answer in the evidence.
When you compare one map file from the failed build with one from the good build you must see a difference. Does this give you a clue?
When you say "I'm not sure why it works" it concerns me. If you don't know why it works, then you may not have really fixed it and the problem might show up and bite you in the backside at some future time.
For the record you did not ask me specifically about the FIXED keyword. Is it not detailed in the documentation?
</TranslateStart>
always yo're freind,
Zeusti
(now going back to my bottle)
The problem is that I could not find an explanation why the contents or the lack of contents of the second execution region determined why the image will not function. No matter which object file was mapped to it, without the FIXED keyword for the second execution region it would not function! I looked in the linker user manual but it offered no clues. I know there are some tool chain experts around here...
tapeer,
<holdingbackwhatifeellikesaying>
c'mon man! what diffrence do you see from the map files? the fixed is obviously having some effect. the map file will show a difference in the layout. why did you use the fixed? did you have some reason or was it just a guess?
</holdingbackwhatifeellikesaying>
zeusti