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

Missing memory regions in hex file

Hi,

I'm working on a dual core psoc63 with different application, and i can see hex generated files but a specific region defined in scatter file is missing.

Any idea?

This region is used by CM0+ to store ble bonding list.

Thanks

Parents
  • Can you share the scatter file?

    What I am guessing the issue is, is something like the below:

    LOAD 0x0 0x10000
    {
        EXEC1 0x0 0x4000{ * (+RO)}
        EXEC2 0xe000 0x1000{code_at_e000.o (+RO)}
        RAM 0x20000 0x10000{ * (+RW +ZI)}
        ARM_LIB_STACKHEAP 0x30000 EMPTY 0x10000{}
    }

    The hex files represent the LOAD regions (outer braces), as this is what would be programmed into Flash on a real device. The EXECUTION regions (inner braces) are the run-time addresses... what the system will look like at the start of main(), and will be copied from its 'load' address to its 'execution' address by the C library init code.

    In this case it would (attempt to) copy the EXEC2 code from some other address (after EXEC1's code) to 0xe000, which likely fails in the real world, as this would be an attempt to write to flash (0x0 - 0x10000(.

    Perhaps use the FIXED keyword to ensure that it is located at that address in the binary?

    LOAD 0x0 0x10000
    {
        EXEC1 0x0 0x4000{ * (+RO)}
        EXEC2 0xe000 FIXED 0x1000{code_at_e000.o (+RO)}
        RAM 0x20000 0x10000{ * (+RW +ZI)}
        ARM_LIB_STACKHEAP 0x30000 EMPTY 0x10000{}
    }

Reply
  • Can you share the scatter file?

    What I am guessing the issue is, is something like the below:

    LOAD 0x0 0x10000
    {
        EXEC1 0x0 0x4000{ * (+RO)}
        EXEC2 0xe000 0x1000{code_at_e000.o (+RO)}
        RAM 0x20000 0x10000{ * (+RW +ZI)}
        ARM_LIB_STACKHEAP 0x30000 EMPTY 0x10000{}
    }

    The hex files represent the LOAD regions (outer braces), as this is what would be programmed into Flash on a real device. The EXECUTION regions (inner braces) are the run-time addresses... what the system will look like at the start of main(), and will be copied from its 'load' address to its 'execution' address by the C library init code.

    In this case it would (attempt to) copy the EXEC2 code from some other address (after EXEC1's code) to 0xe000, which likely fails in the real world, as this would be an attempt to write to flash (0x0 - 0x10000(.

    Perhaps use the FIXED keyword to ensure that it is located at that address in the binary?

    LOAD 0x0 0x10000
    {
        EXEC1 0x0 0x4000{ * (+RO)}
        EXEC2 0xe000 FIXED 0x1000{code_at_e000.o (+RO)}
        RAM 0x20000 0x10000{ * (+RW +ZI)}
        ARM_LIB_STACKHEAP 0x30000 EMPTY 0x10000{}
    }

Children