This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change .data section Load Base

Hi,

I working on a project and I need to split my module into sections in the scatter file to easily update any of these sections with only the module bin file.

And I was able to allocate my modules into specific addresses with their ro-data.

But still facing an issue for adding (.data) data to these sections.

I want to add the module  (.data)  load base to the module section.

But when I do that and run the code, I got a hard fault.

I assumed that the hard fault I got, from trying to assign a value to any of the global variables.

Here Scatter file.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
LR_IROM1 (_MEMORY_FLASH_BEGIN_+MEMORY_FLASH_APP_OFFSET) _MEMORY_FLASH_SIZE_ { ; load region size_region
REGION_FLASH (_MEMORY_FLASH_BEGIN_ + MEMORY_FLASH_APP_OFFSET) (MEMORY_FLASH_APP_SIZE) { ; load address = execution address
*.o (.intvec, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
MODULE_A_SECTION 0x10078800 FIXED 2048{
module1.o (+RO +RW)
module1.o (.rodata)
}
MODULE_B_SECTION 0x10079000 FIXED 2048{
module2.o (+RO +RW)
module2.o (.rodata)
}
END_SECTION 0x10079800 FIXED EMPTY 0{}
REGION_RAM2 (_MEMORY_RAM_BEGIN_ + MEMORY_RAM_APP_OFFSET) (_MEMORY_RAM_SIZE_ - MEMORY_RAM_APP_OFFSET) { ; RW data
.ANY (+RW, +BSS)
}
REGION_RAM3 +0 UNINIT (_MEMORY_RAM_SIZE_ - MEMORY_RAM_APP_OFFSET) { ; RW data not initialized
*.o (.noinit.data)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0