Hi,
I migrating GCC to armclang and I approach problem that I don't have idea how solve.
I prepared scatter file:
#define __ROM_BASE 0x00000000#define __ROM_SIZE 0x00010000
#define __RAM_BASE 0x20200000#define __RAM_SIZE 0x00008000#define BCR_CONFIG 0x41C00000#define BCR_CONFIG_LENGHT 0x00000080#define BSL_CONFIG 0x41C00100#define BSL_CONFIG_LENGHT 0x00000080
#define __STACK_SIZE 0x00001000#define __HEAP_SIZE 0x00000200
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) /* starts at end of RAM */#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
#define __RO_BASE __ROM_BASE#define __RO_SIZE __ROM_SIZE#define __RW_BASE __RAM_BASE#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address *.o (RESET, +First) *(.version) *(InRoot$$Sections) *(+RO) *(+XO) } DATA __RW_BASE __RW_SIZE { /* RW data */ * (+RW, +ZI) }#if __HEAP_SIZE > 0 ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap }#endif ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack }}LR_BOOT BCR_CONFIG BCR_CONFIG_LENGHT { ; load region size_region ER_BOOT BCR_CONFIG BCR_CONFIG_LENGHT { ; load address = execution address *(.BCRConfig) }}
Everything compile and link together but when I try flash device I got warning "No segment found for 'DATA' VAddr = 0x20200568 size = 0x2f8c, Assuming PAddr == VAddr"
Well flashing RAM is bad idea so I do objectdumb and I saw this:
Sections:Idx Name Size VMA LMA File off Algn 0 ER_ROM 000098b4 00000000 00000000 00000038 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 DATA 00000190 20200000 20200000 000098f0 2**3 CONTENTS, ALLOC, LOAD, DATA 2 DATA 00002f8c 20200568 20200568 00009a80 2**3 ALLOC
I don't understand why VMA and LMA have same value. When I compile same code in GCC I receive normal result:
Sections:Idx Name Size VMA LMA File off Algn 0 .intvecs 000000c0 00000000 00000000 00010000 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .text 00005c10 000000c0 000000c0 000100c0 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE
252 .data 00000590 20200160 0000b098 00020160 2**3 CONTENTS, ALLOC, LOAD, DATA253 .bss 00002f2c 202006f0 202006f0 000206f0 2**3 ALLOC
Have you any idea what could I do wrong? and what could I check?
Best regards,
Marcin