This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2612-Q1: AM261 OCSRAM questions

Part Number: AM2612-Q1

Hi experts,

 

Good day! I am asking for customer for OCSRAM questions. In their application, AM261 run on QSPI mode.

  1. Now customer found that their SBL and APP occupy the same portion of OCSRAM.Address 0x70040000-0x70071FFF overlaps for SBL and APP. Customer wants to know if it has risk when SBL and APP occupy same RAM address.IMG_0721.jpegIMG_0722.jpeg
  2. Customer wants to know how OCSRAM matches the address of external flash? For example, if a customer wants to fix a variable to the 0x1000 address of the external flash, which address should be allocated in OCSRAM? 

 

Thanks!

Best Regards

Kita

  • Now customer found that their SBL and APP occupy the same portion of OCSRAM.Address 0x70040000-0x70071FFF overlaps for SBL and APP. Customer wants to know if it has risk when SBL and APP occupy same RAM address.

    Hi Kita,

    No, this is safe and expected behavior. The application is put to RAM from flash only after loading the HSMRT. By "Loading HSMRT", it means to put the HSMRT firmware from OCRAM to HSM_RAM. So overwriting this shouldn't be a problem.

    If customer wants to store a variable at a specific address in flash memory, follow these steps:

    In linker command file (.cmd), define a new memory region with your desired flash address:

    MEMORY
    {
    /* Standard memory regions */
    OCSRAM : origin = 0x70000000, length = 0x80000
    FLASH : origin = 0x60100000, length = 0x800000

    /* Custom flash region at specific address */
    FLASH_FIXED_VARIABLE : origin = 0x6010xxxx, length = 0x1000 /* Replace xxxx with your offset */
    }

    In the SECTIONS part of your linker file:

    SECTIONS
    {
    /* Standard sections */
    .text : {} > OCSRAM
    .data : {} > OCSRAM
    .bss : {} > OCSRAM

    /* Custom section mapped to specific flash address */
    .flash_code : {} > FLASH_FIXED_VARIABLE
    }

    In your C source code, use the section attribute to place variables/functions in the custom flash section:

    __attribute__((section(".flash_code")))
    const uint32_t myFixedVariable = 0x12345678;

    Best Regards,

    Mayank Shadwani

  • Hi Mayank,

    Customer tested with this method to fix a variable on RAM.

    Now they want to fix a struct on RAM 0x70002100. From .map customer can see that this struct is fixed on RAM 0x70002100. But from the generated tiimage, this is fixed on 0x7C9 flash address. Customer also tried to use ospi function to read this flash address 0x7C9, it also can match the struct that customer fix.

    So customer wants to know the relationship between RAM address(0x70002100) and flash address(0x7C9). How to calculated the flash address of variable that fixed on specific RAM address? 

    Thanks!

    Best Regards

    Kita

  • Hi, why do they want to read the variable from flash when the same variable is being copies to internal memory? 

  • Hi Sanmveg, 

    Because customer wants to store their SW version Info in fixed address on RAM and flash. If MCU fails, they can use other device to read the flash address to confirm SW version directly.

    Best Regards

    Kita

  • in that case, calculating address and then reading from the flash would not be a stable approach. This is because, the address in the flash can change with each build. Better approach would be to fix the variable's address in the flash explicitly along with fixing the address in the RAM.

    I think customer can make use of Specifying Load and Run Addresses in the linker file.