Hello,
I've a small simple question:
ldr r4, =||Image$$ER_IROM1$$RO$$Length||+||Image$$RW_IRAM1$$RW$$Length||
At the moment I get an error message from Keil, using this code in the startup file. Maybe an syntax error?
If I write
ldr r4, =||Image$$ER_IROM1$$RO$$Length|| ldr r4, =||Image$$RW_IRAM1$$RW$$Length||
there's no such error message.
best regards David
So post the full text of the complete error message!
Use copy-and-paste - do not manually re-type it.
"Maybe an syntax error?"
Have you checked the manuals to confirm the correct syntax?
If I use this syntax, I get no error message.
EXPORT Reset_Handler IMPORT ||Image$$ER_IROM1$$RO$$Length|| IMPORT ||Image$$RW_IRAM1$$RW$$Length|| Reset_Handler ; this part is always equal ldr r4, =||Image$$ER_IROM1$$RO$$Length|| ldr r4, =||Image$$RW_IRAM1$$RW$$Length||
the error message is:
"error: A1150E: Bad symbol, not defined or external"
Hi David
The symbols are linker defined and their values will end up in a literal pool. The symbols themselves will be converted into (pc-relative) pointers into that pool.
The inline expression in your original code requires values known at compilation time in order to work. Hence the error message.
Instead you could write something like this:
Reset_Handler ; this part is always equal ldr r4, =||Image$$ER_IROM1$$RO$$Length|| ldr r5, =||Image$$RW_IRAM1$$RW$$Length|| add r4, r4, r5
Best regards Marcus http://www.doulos.com/arm/
"The inline expression in your original code requires values known at compilation time in order to work. Hence the error message."
But why that particular message?
That particular message doesn't seem to be particularly relevant?
Agreed. It could be a parser glitch, where symbol names are matched by something like "||.*||" (* being greedy).
Since I cannot think of any situation where more than one linker defined symbol could be legally used in an expression, this might not have come up, yet. Just guessing.
Regards Marcus http://www.doulos.com/arm/