[SOLVED] S32K144 d-flash programming failure

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] S32K144 d-flash programming failure

    I work with the S32K144 device. I have a program linked against the lower half of FlexNVM (address range 0x10000000:0x10008000), and flash it with the J-Link loadfile command.

    When the FlexNVM is configured as D-flash only (no eerpom), everything works as expected. However, if FlexNVM is partitioned into 32k D-Flash and 32k EEPROM backup, loadfile fails with

    Downloading file [****]...
    Comparing flash [100%] Done.
    Erasing flash [100%] Done.
    Programming flash [100%] Done.
    Verifying flash [015%]
    **************************
    WARNING: CPU could not be halted
    **************************

    100%] Done.
    J-Link: Flash download: Bank 0 @ 0x00000000: 2 ranges affected (22528 bytes)
    J-Link: Flash download: Total time needed: 0.112s (Prepare: 0.013s, Compare: 0.005s, Erase: 0.001s, Program: 0.087s, Verify: 0.000s, Restore: 0.003s)

    ****** Error: Verification failed @ address 0x00000000
    Error while programming flash: Verify failed.


    Any advice?

    Thanks in advance,
    Victor
  • Hi Victor,
    Thank you for your inquiry.

    It looks like you are writing to 0x00000000, not to 0x10000000.
    Are you trying to download a .bin file?
    If so, you will have to add the starting address of where to download the file as well:
    Syntax: loadfile <filename> [<addr>]
    Example: loadfile %pathToFile%\somedata.bin 0x10000000

    If this does not solve the problem:
    Could you please send us a screenshot of the full commander output?
    Could you please send us a J-Link log file? How to enable:
    wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File
    Could you please provide us with the data file you want to flash?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Fabian,

    Thank you for the answer.

    I am downloading an S-rec file. The address information is correct. In case of success (no eeprom) the file is programmed into the correct addresses. The "@ 0x00000000" J-Link reports seems to be an offset in the bank.

    It turns out that the real problem is that partitioning of FlexNVM enables the security. According to the Note in 36.5.11.14

    Program Partition command section of the reference manual,

    For CSEc enabled parts, once Flash Keys are allocated (regardless of being initialized or not), the SHE spec requirement of not erasing Flash Keys without authentication will apply. This will mean Authentication (DBG_CHAL & DBG_AUTH) commands must be run and pass (removing all flash keys) before erase of the DFlash, ...

    ... and the Program Partition command automagically allocates some keys.

    Thank you very much for the log file hint.

    Best,
    Victor
  • Hi Victor,
    Glad to hear that you found the source for the issue.
    So if I understand you correctly, this is resolved now and we can consider this thread as closed?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Hello Victor,

    Thank you for your feedback.
    Unfortunately there is not much improving space here for the error message as a verify can fail because of numerous reasons and during write no error was reported from the target devices Flash controller.
    We will see if our documentation/FAQ can be improved so it becomes more clear that .bin files do not contain memory location information.

    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.