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.

AM263P4-Q1: RBL is not copying SBL to RAM, when Flash memory erase size set to 64KB(Block erase)

Part Number: AM263P4-Q1


Tool/software:

Hello Team,

We are working on Bootmanager(BM -> SBL for TI RBL), Bootloader(BL) and Bootloader updater(BLU).

To reduce flash erase timing we are trying to change flash erase size from 4KB to 64KB

As per my understanding TI hardcode default erase sizes to 4KB and block size to 64KB in Flash_sfdpParams_init().

There is no option to set erase size to 32KB, supported by the flash device.

RBL -> BM ->BL -> APP/BLU

Memory Map

  • BM at 0x60000000
  • BL at 0x60030000
  • APP/BLU at 0x60100000

Working -> BM is copied to RAM by RBL, after a BL update and warm-reset, when flash memory erase size set to 4KB(subsector).

Not working -> But when flash memory erase size set to 64KB(Block erase), after BL update and warm-reset BM is copying to RAM by RBL.

Q) What are the possible causes for this issue?

Q) what are the possibilities in BM memory corruption, ever BM memory area is not affected by BL update? 

Kind regards,

Hari

  • Hi Hari,

    Please help me understand the scenario,

    The entire SW flow RBL → BM → BL → APP/BLU. RBL loads BM, BM loads BL , BL loads APP

    1. When are you seeing the issue? Are you seeing the issue after updation of application and warm reset, between RBL → BM stage?

    2.  Boot Manager (BM) refers to SBL right? Is your SBL/BM based on MCAL or the TI provided MCU_PLUS_SDK based one.

    3. Where are you changing erase size? Is it done for APP updation?

    Regards,

    Aswin

  • Hi Hari, 

    Can you also tell me which region is being erased from flash (address of the region)?

    Regards,

    Aswin

  • Hello Aswin,

    The entire SW flow RBL → BM → BL → APP/BLU. RBL loads BM, BM loads BL , BL loads APP

    -> Correct

    1. When are you seeing the issue? Are you seeing the issue after updation of application and warm reset, between RBL → BM stage?

    -> Yes, RBL -> BM

    2.  Boot Manager (BM) refers to SBL right? Is your SBL/BM based on MCAL or the TI provided MCU_PLUS_SDK based one.

    -> MCAL_AM263Px_10_02_01_04

    3. Where are you changing erase size? Is it done for APP updation?

    -> erase size change in Tresos configuration, it will be generated.

    4. erased from flash (address of the region)?

    ->During update process 

    • BL size is 0x60000 (0x60030000 - 0x60090000)
    • BL at 0x60030000 will be erased and same length of new data is copied from BLU at 0x60100000. 
  • Hi Hari,

    I suspect the following,

    For the flash, the block size is 128KB. So when you are performing block erase, 128KB is getting erased from flash.

    So when 0x6003 0000 is given as the erase size, then the block which has this address is getting erased. In this case it would be block 0x6002 0000 to 0x6004 0000 block. 

    So if your SBL is more than 128KB then it might be spanning to this block as well and some part of it is getting erased.

    Can you try the following,

    1. Keep the BM/SBL and BL in a separate block. Suppose if the BM size if 130KB, then give it Block 1 and Block 2 that is from address 0x6000 0000 to 0x6004 0000. 

    2. Then let us leave a block as a empty in between (0x6004 0000 - 0x6006 0000) for safety. Let not use this block for now.

    3. Let the BL begin from the next block (0x6006 0000).

    Can you now try the same block erase.

    Step 2 is optional. You can place BL in the block next to BM.

    Regards,

    Aswin

  • Hi Hari,

    Let me know if we need to schedule a meeting today?

    Regards,

    Aswin

  • Hi Aswin,

    I am testing your inputs, and update you.

    If issue not solved, can we have a debug session on Monday?

    Q) is above inputs based on FLASH device?

    In MCAL block size is set to 64KB not 128KB

  • Hi Hari, 

    The second snippet is from the Fls_Nor_Config.c file right?

    I think you are referring to V0 or V1 folder. For AM263P, it is V2 folder.

    Please see the config file in V2 folder.

    You can see the block size is 128KB (131072 bytes).

    Regards,

    Aswin

  • Hi Hari,

    Yes we can have the meeting accordingly

    Regards,

    Aswin

  • Hello Aswin,

    After aligning BM, BL & BLU with 128KB(0x20000) address.

    Now RBL copying SBL properly.

    Have few queries below, as per below image, FLS driver supports 4KB or 128KB erase size

    Q) If i configure erase size is 64KB, is is no problem right?

    Q) is FLS driver support 4KB/32KB subsector and 64KB/128KB sector size?

    Q) Should i use Fls_SetEraseType(FLS_BLOCK_ERASE); to erase 64KB/128KB sector size?

  • Hi Hari,

    Q) If i configure erase size is 64KB, is is no problem right?

    This functionality depends on the variant of the ISSI. In datasheet it is mentioned that this supported by ISLX256/128 - B variant of flash. The OOB flash does not have this.

    is FLS driver support 4KB/32KB subsector and 64KB/128KB sector size?

    The FLS driver supports 4KB subsector erase and 128KB sector erase.

    Should i use Fls_SetEraseType(FLS_BLOCK_ERASE); to erase 64KB/128KB sector size?

    Yes, You would need to set the erase type as BLOCK erase to perform 128KB erase.

    Regards,

    Aswin

  • Hi Aswin,

    Thank you for your support and clarification.

    The FLS driver supports 4KB subsector erase and 128KB sector erase.

    As per datasheet memory device supports 64KB sector erase, but FLS driver is not supporting it

    If memory is configured as 64KB, there is no use of it and if i use this function Fls_SetEraseType(FLS_BLOCK_ERASE); then it will erase 128KB Sector/Block only.

    Q) There is no use, if i configure erase/sector size is other than 4KB/128KB right?

    Kind regards,

    Hari

  • Hi Hari,

    Can you let me know which flash part are you using? Can you share full part number.

    Regards,

    Aswin

  • Hi Hari,

    There is no use, if i configure erase/sector size is other than 4KB/128KB right?

    ISSI flashes either supports 128KB or 64KB sector erase. That property depends on the flash variant being used, like how it is given in the screen snip above.

    Since 128KB erase is happening currently, then 64KB erase size cannot be configured on flash. This means that the ISSI flash under consideration supports 128KB sector erase.

    Even if you change the sector size as 64KB, this won't be possible as that is a property of flash.

    Regards,

    Aswin

  • Hi Aswin,

    Following hardware is connected to our test system

    As per the user guide

    OSPI device as below

    From device datasheet

  • Hi Hari,

    I checked the SFDP table and it indicates that the flash as 128KB block. This can be checked by running the OSPI diagnostics example. 

    The example and found in MCU PLUS SDK: examples/drivers/ospi/ospi_flash_diag 

    The datasheet never lists a standard part number for 64KB erase even though in the foot notes it is mentioned as optional.

    Regards,

    Aswin