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

ARM : Get memory region start address from map file in c.

Hello,
I want to reserve memory region for specific data.
So I edit the scatter file and I add following line to the scatter file.

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x08000000 0x00040000 { ; load region size_region ER_IROM1 0x08000000 0x00040000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x00040000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 +0 EMPTY 0x10000 // I ADD THIS SECTION ! {

}
}

My first question is, Is this way is true for reserve memory region ?
second question is, independent from first question, How can I access this memory region (RW_IRAM2) from c code ?

Thanks for your answers !
Best Regards.

Parents
  • www.keil.com/.../armlink_pge1362065952432.htm

    extern void *Image$$RW_IRAM2$$Base;
    printf("RW_IRAM2 Base %08X\n", (uint32_t)&Image$$RW_IRAM2$$Base);
    

    App reports
    RW_IRAM2 Base 20013A00

    .MAP reports

    ...
        __heap_base                              0x20000a00   Data           0  startup_stm32f769xx.o(HEAP)
        __heap_limit                             0x20012a00   Data           0  startup_stm32f769xx.o(HEAP)
        Image$$RW_IRAM2$$Base                    0x20013a00   Number         0  anon$$obj.o ABSOLUTE
        __initial_sp                             0x20013a00   Data           0  startup_stm32f769xx.o(STACK)
    ...
    

    Could you use the heap?

    Use structure/pointers? Use #pramga or attributes?

Reply
  • www.keil.com/.../armlink_pge1362065952432.htm

    extern void *Image$$RW_IRAM2$$Base;
    printf("RW_IRAM2 Base %08X\n", (uint32_t)&Image$$RW_IRAM2$$Base);
    

    App reports
    RW_IRAM2 Base 20013A00

    .MAP reports

    ...
        __heap_base                              0x20000a00   Data           0  startup_stm32f769xx.o(HEAP)
        __heap_limit                             0x20012a00   Data           0  startup_stm32f769xx.o(HEAP)
        Image$$RW_IRAM2$$Base                    0x20013a00   Number         0  anon$$obj.o ABSOLUTE
        __initial_sp                             0x20013a00   Data           0  startup_stm32f769xx.o(STACK)
    ...
    

    Could you use the heap?

    Use structure/pointers? Use #pramga or attributes?

Children