Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
ROM writing with secured using PROGS12ZZ
Ikki S. Feb 16, 2014 at 09:11 PM (21:11 hours)
Staff: Takao Y.

  • Dear person in charge,

    I have a question about PROGS12ZZ.

    I could write .S19 file to S12ZVM using PROGS12ZZ.
    However, I have a concern about the writing ROM image.

    I can observe that the value at the 0xFF_FE0F becomes 0xFE via SM(show module) function
    while the value should become 0xFF just after all erase.
    I have a concern whether the ECC error has occurred due to double writing
    when we want to write certain value at 0xFF_FE0F(Flash Security Byte).

    I have thus concern, nevertheless, doesn't the ECC error occur?
    And if yes(the ECC error does not occur),
    coule you tell me what mechanism is implemented to prevent
    the occurance of the ECC error as much as possible?

    I am afraid that it doesn't work well on the other tool about this issue,
    I would like to confirm about this background.

    Best Regards,
    Ikki Shingu




    Comments

  • Greetings,

    Erasure does set most of the flash memory to 0xFF, but if we set 0xFF on the security byte then it automatically becomes secured (SEC[1:0] = 2'b11). Having 0xFE keeps it in a unsecured state. This does not cause any ECC errors.

    I am not sure what value you are programming into the security byte, but it should not be the binary value 2'b11 or 2'b01. Remember that at security byte we have 0xFE (7'b1111110). The reason is that you cannot flip a 0 bit to a 1 bit in flash. This is most likely the reason why you are getting an error. So the only way to secure the flash is actually to set the value to 2'b00.

    You can either write the security byte within your S19/ELF file and set the security as you program, or you can leave it untouched and use P&E's "Secure device" command within our software.


    Takao Yamada

  • Dear Yamada-san,

    Thank you for your comment.
    I can understand that the 0xFE value at 0xFF_FE0F is required for the unsecured state.

    What I want to know is how the PROGS12ZZ changes the FSEC(0xFF_FE0F) register value.

    [example of the operation to FSEC]
    <FSEC data> <ECC phrase>
    Default : 0xFF(just after all erase) - 0b1111111
    after 1st write : 0xFE(by ROM image programmer) - 0b1001110
    after 2nd write : 0xFC(given value by user) - 0b1001100(while 0b1111100 is expected)

    If the operation is done simply as above, the ECC error would occur after 2nd write because each bit of ECC phrase cannot change 0 to 1.
    However, the operation is done properly and doesn't occur the ECC error when I use PROGS12ZZ.
    I think PROGS12ZZ is implemented the function to prevent occuring the ECC error.(ex. read-modify&erase-write)
    Could you tell me how to prevent occuring the ECC error?

    Best Regards,
    Ikki Shingu

  • Greetings,

    Your analysis is correct. After speaking with the algorithm engineer, we can confirm that in a regular scenario you would see an ECC error.

    However, within the algorithm we get around the ECC error when programming the security byte.

    The mechanism we use is we read all the data in the last sector of flash (which includes the security bytes), we merge in the security byte changes, and save it. We erase the last sector and reprogram the whole sector with the saved data. This avoids the ECC error by only writing to the sector once.


    Takoa Yamada

  • Dear Yamada-san,
    Thank you for your comment.
    It makes sense to me!
    Ikki Shingu

  • Greetings,

    I hope this answers all of your questions. I will now post this thread as resolved. Please create a new forum thread if you have any further questions.


    Takao Yamada

Add comment


   Want to comment? Please login or create a new PEMicro account.







© 2017 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement