1. Add your region in the 'sct' file.

; Load Region -------------------------------------------------
LR0 iRAM0_BASE  iRAM0_SIZE
{

...

    TUBE_REGION (DRAM_END-STACK_SIZE-4)
    {
       test_debug.o (tube_region)
    }

 

    ARM_LIB_STACK (DRAM_END-STACK_SIZE) EMPTY STACK_SIZE {}
    ARM_LIB_HEAP +0 EMPTY HEAP_SIZE {}
}

2. In  test_debug.c code, use 'attribute' and 'section' to assign the region.

 

volatile int* TUBE_ADD  __attribute__((section("tube_region"), zero_init));
#define TUBE *((volatile int *) (TUBE_ADD))

 

3. After building the code, check the map file.

 

    TUBE_ADD                                 0x1002b7fc   Data           4  sdl_debug.o(tube_region)
    Image$$ARM_LIB_HEAP$$ZI$$Base            0x1002c000   Number         0  anon$$obj.o(ARM_LIB_HEAP.bss)
    Image$$ARM_LIB_HEAP$$ZI$$Limit           0x1002c000   Number         0  anon$$obj.o(ARM_LIB_HEAP.bss)
    Image$$ARM_LIB_STACK$$ZI$$Limit          0x1002c000   Number         0  anon$$obj.o(ARM_LIB_STACK.bss)

반응형

+ Recent posts