cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing common flash memory space between two projects?

mani s
Associate III

0690X00000895fsQAA.pngI 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().

  1. How to arrange this memory layout when linking, and then further, how to expose BT library functions to the application code area?
  2. How to link the .elf file of ota code to application code?

12 REPLIES 12

The core needs to define data or functions address that changes by using an index that is constant.

S.Ma
Principal

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!

turboscrew
Senior III

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.