2019-03-27 10:05 AM
I trying to make common address space for BT-stack in flash memory, show in below figure. I have two projects using same flash memory. In both the projects Bt stack is used, so, I thought to make common memory for BT stack so that both the projects can call functions and can reduce the flash memory size also.
Let's call OTA is project-1 and Application is project-2.Using Stm32f412CE controller with 512kbytes flash memory. BT stack will be in OTA project and storing in specific address location in flash memory. I need to call same functions which is stored in common place from application code as well.
I'm aware that I can use section attributes on functions and variables and then locate those sections at specific addresses during linking.
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}
.ip_code :
{
*(.IP_Code*);
} > IP_CODE
__attribute__((section(".IP_Code"))) int placed_logic().
2019-03-29 05:01 AM
The core needs to define data or functions address that changes by using an index that is constant.
2019-03-29 05:04 AM
First, fill the common box and project box with all items that needs to be accessed from outside the box.
Second, put an arrow from where to where to access functions or data.
Make a list an put a number.
The interrupt vector table is a simplistic implementation, you use IRQ number, not the absolute address.
Remember this is lots of dev work!
2019-03-30 03:26 AM
I haven't done anything like that, but just came to my mind: does compilation to static library generate a jump table or something? Then it would be enough to link the library to an absolute address.