I have this linker script from keil and i want to use define to allocate base address based on that define. But i get errors. I tried gpt and others but not solved. `
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
; Custom scatter file for STM32F051
LR_IROM1 0x08007C00 0x00008000 { ; load region size_region
ER_IROM1 0x08007C00 0x00008000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00002000 { ; RW data
.ANY (+RW +ZI)
}
}
I want this
#define NEW_BASE_ADDRESS 0x08007C00
LR_IROM1 ${NEW_BASE_ADDRESS} 0x00008000 { ; load region size_region
ER_IROM1 ${NEW_BASE_ADDRESS} 0x00008000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00002000 { ; RW data
.ANY (+RW +ZI)
}
}
But i get these errors
missing base address for lr_irom1. ignoring unknown attribute '$' specified fr region lr_irom1.
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
; Custom scatter file for STM32F051
LR_IROM1 0x08007C00 0x00008000 { ; load region size_region
ER_IROM1 0x08007C00 0x00008000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00002000 { ; RW data
.ANY (+RW +ZI)
}
}
I want this
#define NEW_BASE_ADDRESS 0x08007C00
LR_IROM1 ${NEW_BASE_ADDRESS} 0x00008000 { ; load region size_region
ER_IROM1 ${NEW_BASE_ADDRESS} 0x00008000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00002000 { ; RW data
.ANY (+RW +ZI)
}
}
But i get these errors
missing base address for lr_irom1. ignoring unknown attribute '$' specified fr region lr_irom1