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.

FEE and HALCoGen - detailed information about the global variable uint32 TI_Fee_u32ActCpyVS



Hello,

I am using the RM48 MCU HDK (Hercules Development Kit with RM48L952ZWT Safety MCU) for rapid prototyping.

Where can I get detailed information about the global variable uint32 TI_Fee_u32ActCpyVS?

Which bits of TI_Fee_u32ActCpyVS indicate the copy sector of EEP0?
Which bits of TI_Fee_u32ActCpyVS indicate the active sector of EEP0?
Which bits of TI_Fee_u32ActCpyVS indicate the copy sector of EEP1?
Which bits of TI_Fee_u32ActCpyVS indicate the active sector of EEP1?

An example for better understanding:

Number of Virtual Sectors is 2.
Virtual Sectors for EEP1 is 0.

Virtual Sector 1 : Sector Number = 1 ; Flash Bank = 7 ; Flash Start Sector = 0 ; Flash End Sector = 0
Virtual Sector 2 : Sector Number = 2 ; Flash Bank = 7 ; Flash Start Sector = 1 ; Flash End Sector = 1

Error is of type Error_CopyButNoActiveVS and Virtual Sector 1 is copy sector, which value returns the global varable uint32 TI_Fee_u32ActCpyVS?
Error is of type Error_CopyButNoActiveVS and Virtual Sector 2 is copy sector, which value returns the global varable uint32 TI_Fee_u32ActCpyVS?

Error is of type Error_NoFreeVS and Virtual Sector 1 is active sector, which value returns the global varable uint32 TI_Fee_u32ActCpyVS?
Error is of type Error_NoFreeVS and Virtual Sector 2 is active sector, which value returns the global varable uint32 TI_Fee_u32ActCpyVS?


Thanks and regards,

Pascal

  • Just reviewing the code, it appears that this variable will contain a 1 in each bit location for each virtual sector that is in the "Copy" state. Bit 0, for virtual sector 1 and bit 1 for virtual sector 2. If there is ever more than one virtual sector in the Copy state, then that is an error. It is an indication that the second virtual sector was filled up before the valid data in the first virtual sector could be copied into the second virtual sector.

    You might want to look at how much data you are trying to put into the FEE. Remember that each block is a minimum of 16 bytes. If the total size of your data blocks gets close to the size of the virtual sector you need to either increase the virtual sector size (use two real sectors for each virtual sector) or reduce the total block size. You can reduce the total block size by combining small blocks of data.
  • Hello,

    Thank you for your fast answer, but my questions are unfortunately not completely answered.

    Please take a look at TI FEE Driver User Guide, Chapter 4.1, page 24:
    If the error is of type Error_CopyButNoActiveVS, then the application has to provide info on which of the VS needs to be corrected in u8VirtualSector.For error of type Error_CopyButNoActiveVS, TI_Fee_u32ActCpyVS will provide info on which VS is Copy. In this case, the second argument for the TI_Fee_ErrorRecovery should be the copy Virtual Sector number. Error recovery API will mark the Virtual Sector as Active.

    Is it rigth that there is only one Virtual Sector in the copy state in the case that an error of type Error_CopyButNoActiveVS occurs? [Correct: Yes/No]
    If 'Yes', this results in the following line to get the info which Virtual Sector is copy sector as input for function TI_Fee_ErrorRecovery(...):
    determination of copy sector in case of Error_CopyButNoActiveVS => copy_sector = (TI_Fee_u32ActCpyVS & 0x0000000F);? [Correct: Yes/No]

    According to your answer, the following lines are correct:
    Virtual Sector 1 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000001) = true;? [Correct: Yes/No]
    Virtual Sector 2 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000002) = true;? [Correct: Yes/No]
    Virtual Sector 3 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000004) = true;? [Correct: Yes/No]
    Virtual Sector 4 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000008) = true;? [Correct: Yes/No]

    Please take a look at TI FEE Driver User Guide, Chapter 4.1, page 24:
    If the error is of type Error_NoFreeVS, then the application has to provide info on which of the Virtual Sector needs to be erased in u8VirtualSector. TI_Fee_u32ActCpyVS will provide info on which Virtual Sector is active.

    Where can I find info which Virtual Sector is active in the case that an error of type Error_NoFreeVS occurs?

    Virtual Sector 1 is active sector => (TI_Fee_u32ActCpyVS & 0x00000010) = true;? [Correct: Yes/No]
    Virtual Sector 2 is active sector => (TI_Fee_u32ActCpyVS & 0x00000020) = true;? [Correct: Yes/No]
    Virtual Sector 3 is active sector => (TI_Fee_u32ActCpyVS & 0x00000040) = true;? [Correct: Yes/No]
    Virtual Sector 4 is active sector => (TI_Fee_u32ActCpyVS & 0x00000080) = true;? [Correct: Yes/No]
    or
    Virtual Sector 1 is active sector => (TI_Fee_u32ActCpyVS & 0x00000100) = true;? [Correct: Yes/No]
    Virtual Sector 2 is active sector => (TI_Fee_u32ActCpyVS & 0x00000200) = true;? [Correct: Yes/No]
    Virtual Sector 3 is active sector => (TI_Fee_u32ActCpyVS & 0x00000400) = true;? [Correct: Yes/No]
    Virtual Sector 4 is active sector => (TI_Fee_u32ActCpyVS & 0x00000800) = true;? [Correct: Yes/No]
    or
    Virtual Sector 1 is active sector => (TI_Fee_u32ActCpyVS & 0x00010000) = true;? [Correct: Yes/No]
    Virtual Sector 2 is active sector => (TI_Fee_u32ActCpyVS & 0x00020000) = true;? [Correct: Yes/No]
    Virtual Sector 3 is active sector => (TI_Fee_u32ActCpyVS & 0x00040000) = true;? [Correct: Yes/No]
    Virtual Sector 4 is active sector => (TI_Fee_u32ActCpyVS & 0x00080000) = true;? [Correct: Yes/No]
    or
    ...

    There is another thing that I do not understand.

    You wrote that each block is a minimum of 16 bytes.

    Please take a look at TI FEE Driver User Guide, Chapter 4.7.20.2, page 38:
    Block Size
    Description Indicates the size of the Block in bytes.
    Generated configuration FeeBlockSize is set to the value assigned to FeeBlockSize.
    Default Value 0x008
    Parameter Range 0x1 to 0xFFF
    Parameter Type uint16
    Target File ti_fee_cfg.c

    It is rigth that FEE works correct if a block with a block size of 8 bytes is configured? [Correct: Yes/No]

    Please answer all my questions with yes or no.

    Best regards,

    Pascal
  • Hi Pascal,

    In general, TI_Fee_u32ActCpyVS is updated only when FEE driver finds either two active sectors or two copy sectors. In all other cases, TI_Fee_u32ActCpyVS will always have a value of zero.

    For all the error cases you described, it will have a value of zero.

  • Hi Vishwanath,

    Thank you for your fast answer.

    One last question:
    I want to implement an error recovery mechanism to recover FEE EEP0 from serious errors.
    Is it correct that the following function serves this purpose?

    void RecoverFeeEep0FromSevereErrors(void)
    {
    TI_Fee_ErrorCodeType feeErrorCode;

    feeErrorCode = TI_FeeErrorCode(0);

    switch (feeErrorCode)
    {
    case Error_SetupStateMachine:
    TI_Fee_ErrorRecovery(Error_SetupStateMachine, 0);
    break;

    case Error_CopyButNoActiveVS:
    //TI_Fee_ErrorRecovery(Error_CopyButNoActiveVS, TI_Fee_u32ActCpyVS);
    TI_Fee_ErrorRecovery(Error_CopyButNoActiveVS, 0);
    break;

    case Error_NoActiveVS:
    TI_Fee_ErrorRecovery(Error_NoActiveVS, 0);
    break;

    case Error_NoFreeVS:
    //TI_Fee_ErrorRecovery(Error_NoFreeVS, TI_Fee_u32ActCpyVS);
    TI_Fee_ErrorRecovery(Error_NoFreeVS, 0);
    break;

    case Error_EraseVS:
    TI_Fee_ErrorRecovery(Error_EraseVS, TI_Fee_u8ErrEraseVS);
    break;

    default:
    break;
    }
    }

    Best regards,

    Pascal
  • Hello,

    I should like to have an answer to my questions:
    Is it correct that the following function serves to recover EEP0 from serious errors?
    Is it correct to call TI_Fee_ErrorRecovery with 0 as input parameter for uint8 u8VirtualSector if an error of type Error_SetupStateMachine, Error_CopyButNoActiveVS, Error_NoActiveVS or Error_NoFreeVS occurs?
    Is it correct to call TI_Fee_ErrorRecovery with TI_Fee_u8ErrEraseVS as input parameter for uint8 u8VirtualSector if an error of type Error_EraseVS occurs?

    void RecoverFeeEep0FromSevereErrors(void)
    {
    TI_Fee_ErrorCodeType feeErrorCode;

    feeErrorCode = TI_FeeErrorCode(0);

    switch (feeErrorCode)
    {
    case Error_SetupStateMachine:
    TI_Fee_ErrorRecovery(Error_SetupStateMachine, 0);
    break;

    case Error_CopyButNoActiveVS:
    TI_Fee_ErrorRecovery(Error_CopyButNoActiveVS, 0);
    break;

    case Error_NoActiveVS:
    TI_Fee_ErrorRecovery(Error_NoActiveVS, 0);
    break;

    case Error_NoFreeVS:
    TI_Fee_ErrorRecovery(Error_NoFreeVS, 0);
    break;

    case Error_EraseVS:
    TI_Fee_ErrorRecovery(Error_EraseVS, TI_Fee_u8ErrEraseVS);
    break;

    default:
    break;
    }
    }

    Best regards,

    Pascal
  • Hi Pascal,

    My answers :

    Is it right that there is only one Virtual Sector in the copy state in the case that an error of type Error_CopyButNoActiveVS occurs? [Correct: Yes]
    If 'Yes', this results in the following line to get the info which Virtual Sector is copy sector as input for function TI_Fee_ErrorRecovery(...):
    determination of copy sector in case of Error_CopyButNoActiveVS => copy_sector = (TI_Fee_u32ActCpyVS & 0x0000000F);? [Correct: Yes]

    Virtual Sector 1 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000001) = true;? [Correct: Yes]
    Virtual Sector 2 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000002) = true;? [Correct: Yes]
    Virtual Sector 3 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000004) = true;? [Correct: Yes]
    Virtual Sector 4 is copy sector => (TI_Fee_u32ActCpyVS & 0x00000008) = true;? [Correct: Yes]

    Error_NoFreeVS is not more used/updated by FEE driver. We will update documentation.

    It is rigth that FEE works correct if a block with a block size of 8 bytes is configured? [Correct: No]

    FEE will work for any block size of 1 to 0xFFFE. Please be careful that every block has a block overhead of 24 bytes. and there is also a sector header of 32 bytes. When configuring blocks, make sure size of all the blocks+block header+sector header is not more than the size of the configured sector.

  • Hi Pascal,

    My answers for your latest query:

    Is it correct that the following function serves to recover EEP0 from serious errors? [TI]Yes.
    Is it correct to call TI_Fee_ErrorRecovery with 0 as input parameter for uint8 u8VirtualSector if an error of type Error_SetupStateMachine, Error_CopyButNoActiveVS, Error_NoActiveVS or Error_NoFreeVS occurs? [TI]No.
    Is it correct to call TI_Fee_ErrorRecovery with TI_Fee_u8ErrEraseVS as input parameter for uint8 u8VirtualSector if an error of type Error_EraseVS occurs? [TI]Yes.

    void RecoverFeeEep0FromSevereErrors(void)
    {
    TI_Fee_ErrorCodeType feeErrorCode;

    feeErrorCode = TI_FeeErrorCode(0);

    switch (feeErrorCode)
    {
    case Error_SetupStateMachine:
    TI_Fee_ErrorRecovery(Error_SetupStateMachine, 0);
    break;
    [TI] Second argument is not used in this case. In fact this is a case where wait states are not matching for the configured frequency. Even calling this API will also not recover from the error.

    case Error_CopyButNoActiveVS:
    TI_Fee_ErrorRecovery(Error_CopyButNoActiveVS, 0);
    break;
    [TI] TI_Fee_u32ActCpyVS should be used to get the correct sector (as you already have written correctly in previous thread).

    case Error_NoActiveVS:
    TI_Fee_ErrorRecovery(Error_NoActiveVS, 0);
    break;
    [TI] Second argument is not used.

    case Error_NoFreeVS:
    TI_Fee_ErrorRecovery(Error_NoFreeVS, 0);
    break;
    [TI] This error is not updated/used by FEE driver anymore,

    case Error_EraseVS:
    TI_Fee_ErrorRecovery(Error_EraseVS, TI_Fee_u8ErrEraseVS);
    break;
    [TI] correct.

    default:
    break;
    }
    }