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.

RM44L520: Using more than half of Bank 7 with FEE module

Part Number: RM44L520
Other Parts Discussed in Thread: TMS570LC4357, TMS570LS3137

Hello,

From my research of how the FEE module works I came to the following conclusion. The maximum usable storage capacity of Bank 7 while using the FEE module is a bit under 32 kB (taking into account Virtual Sector and Data Block headers). This would be achieved by configuring 2 Virtual Sectors each mapped to 8 Physical sectors of Bank 7, thus each sector would be 32kB in size.

My question is if it is possible to use more than this 32 kB of memory while using the FEE. If not, is there any alternative to make the most of the Bank 7 storage?

P.S. I did some tests configuring unequal Virtual Sectors (for example 60kB for 1 and 4kB for the other), and as expected it did not run properly. When going over the capacity of the first sector and switching to the 2nd one everything started breaking. Data was not able to be properly copied from the 1st sector to the 2nd and subsequent write operations returned E_NOT_OK status, as the jobs were no longer being accepted.

  • Hi Alexandru,

    My question is if it is possible to use more than this 32 kB of memory while using the FEE. If not, is there any alternative to make the most of the Bank 7 storage?

    Yes, it is possible. I mean it is depending on the data block size.

    At least two minimum virtual sectors are required in FEE. And only flash bank 7 can be configured for FEE.

    For example, if we configure two virtual sectors each of 32KB and assuming only two data blocks each of 8 bytes. Then once the virtual sector-1 completely filled out then if we try to write any additional data to the virtual sector-1 then the new data will only be written into the virtual sector-2 and only last valid data blocks in the virtual sector-1 will get moved to the virtual sector-2. In valid data blocks (old data) of virtual sector-1 will not get moved into the virtual sector-2.

    Also refer below threads to understand:

    (+) TMS570LS3137: Data backup inside FEE module - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    (+) TMS570LS3137: REGARDING EEPROM ACCESS - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    --
    Thanks & regards,
    Jagadish.

  • Hello Jagadish,

    Thank you for your response!

    I read through the two threads you linked to make sure I don't miss any points.
    However I don't see a response for my question so maybe I didn't do a good enough job of explaining what I'm interested in.

    From your response in the first linked thread, the description you gave when writing a big data block is very useful. I came to a similar conclusion by reading the FEE user manual, but I was unsure about certain edge cases.

    Also from your reply here you told me that I can use more than the 32kB, but that is with only two 8 byte Data Blocks. The blocks keep getting rewritten, the old blocks get invalidated. This goes on until Virtual Sector 1 is filled and at that point, further writes, will write to Virtual Sector 2. After this point all VALID data from the first Virtual Sector gets copied to the 2nd one. The first Virtual Sector gets marked for erase, and the 2nd becomes the active one. I understood this from the FEE User manual. So this means we can write more than 32kB of data, but it will mostly be old invalidated data left over in the Virtual Sector, not actual usable data.

    My question is, if it possible to have more than 32 kB of ACTUAL data in Bank 7 in a useful way, without breaking the FEE. So for example if it is possible to have 10 Data Blocks of 4000 bytes each. Would it be possible to store this into the FEE without breaking how it works?

    From the way the FEE itself works I figure you need 2 Virtual Sectors of identical sizes to avoid possible data loss and corruption. So basically the maximum usable memory in this case would be half the Bank 7 capacity (32 kB), since we split it into 2 equal Virtual Sectors. I was wondering however if there is any way to make use of more space than that.
    I am also aware that the some of the space will be taken up by the headers for the Virtual Sector itself and each Data Block header.

    If we try for example to have the following configuration:
    Virtual Sector 1 - 56 kB
    Virtual Sector 2 - 8 kB
    10 x Data Blocks - 4000 bytes each

    If we write all 10 Data Blocks we will have ~40kB of data written into VS1 (Virtual Sector 1). Now if we rewrite some of the Data Blocks, let's say 4 of them. Let's assume we will almost fill VS1 but not entirely (we still have a bit of space left at this point). The moment we try to rewrite another Data Block, there won't be enough space left in VS1, so it gets written to Virtual Sector 2 (VS2). After that VS1 should get copied to VS2, VS1 should be marked for erase and erased, and VS2 should become the active Virtual Sector.
    The problem in this case is that the space available for VS2 is not enough for all the valid data blocks already written to VS1. This to me will likely result in data loss, data corruption, etc.
    So this to me does not look like a usable configuration where we can actually store and make use of 40kB of data within Bank 7.

    My question then is the following. Is there any way to actually use 40kB of ACTUAL data within Bank 7? Either through the FEE if possible or through other means if not.

    With respect,

    Alexandru Matei

  • Hi Alexandru Matei,

    My question is, if it possible to have more than 32 kB of ACTUAL data in Bank 7 in a useful way, without breaking the FEE. So for example if it is possible to have 10 Data Blocks of 4000 bytes each. Would it be possible to store this into the FEE without breaking how it works?

    No that is not possible in this device. Here the max possible ACTUAL data will only less than 32KB.

    My question then is the following. Is there any way to actually use 40kB of ACTUAL data within Bank 7? Either through the FEE if possible or through other means if not.

    If you want more than 32KB then we can do two things:

    1. We should need to go for other Hercules devices like TMS570LC4357

    As you can see this device bank-7 have 128Kb memory.

    2. We should not use FEE driver, instead of just need to use FAPI routines for reading and writing. In this case we don't have virtual sector concept and here we can manually utilize the entire 64KB of the bank-7.

    The problem in this case is that the space available for VS2 is not enough for all the valid data blocks already written to VS1. This to me will likely result in data loss, data corruption, etc.
    So this to me does not look like a usable configuration where we can actually store and make use of 40kB of data within Bank 7.

    You are totally correct about this behavior and this method will create data loss and corruption etc. And even we never tested like this.

    --
    Thanks & regards,
    Jagadish.

  • I understand. Thank you for the confirmation and clarification Jagadish.

    I have one further question. For option 2, "instead of just need to use FAPI routines for reading and writing", are there any constraints with using Bank 7 strictly as FLASH memory with the FAPI routines? For example I see some EEPROM Emulation related registers in the RM44Lx Technical Reference Manual, SPNU608A:

    Are there any configurations that need to be done to use Bank 7 as flash? Or is is as straight forward as using the FAPI with Bank 0 (of course using different parameters such as Bank 7, and Initializing Bank 7 with the FAPI as well, etc.).

    With respect,

    Alexandru Matei

  • P.S. I got a new idea as well. Is it possible to use Bank 7 in hybrid mode?

    Concretely, use 2 Physical Sectors as Virtual Sectors for FEE usage as EEPROM.
    The remaining 14 Physical Sectors used as FLASH with FAPI routines.
    Is this possible?

  • Hi Alexandru Matei,

    Are there any configurations that need to be done to use Bank 7 as flash? Or is is as straight forward as using the FAPI with Bank 0 (of course using different parameters such as Bank 7, and Initializing Bank 7 with the FAPI as well, etc.).

    No there won't be any additional configurations needed to use flash bank-7 as flash. It is straight forward method as bank-0.

    I did these tests on my TMS570LS3137, TMS570LC4357 and RM46 board as well. You can find these example codes from below link.

    (+) [FAQ] TMS570LC4357: Main FAQ for Hercules - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    (+) [FAQ] TMS570LC4357: Examples and Demos available for Hercules Controllers (E.g. TMS570x, RM57x and RM46x etc) - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    You can download them and refer.

    Concretely, use 2 Physical Sectors as Virtual Sectors for FEE usage as EEPROM.
    The remaining 14 Physical Sectors used as FLASH with FAPI routines.
    Is this possible?

    I never test this but i don't see any issues in doing this. You can do that.

    --
    Thanks & regards,
    Jagadish.