Post Go back to editing

System Fault LED Blinking after running SPI Flash code

Hello 

I tried this example given in the forum for SC584 EZ kit.

 [FAQ] Example project which helps to understand how to interface flash SPI using driver APIs 

The program runs fine and it displays on console the flash basic information. I ran this project in debug mode when my Switch SW1 is in position 1 which is actually Boot from Flash Mode. After running this project and again powering off and then on the board the system fault red LED is glowing continuously. And when I try to flash the chip in no boot mode and again resetting the board after changing the SW1 position to 1 then also led still continuously glows and my project didn't boot from the flash. This same behavior happen on two of my evaluation kit and in both now I am not able to boot my project from flash. What might be the issue can you guide me? It will be of great help.  

Regards

Anukul Anand

  • Hi,

    The SYS_FAULT LED glows, when exceptions or error occurred or try to boot the processor when the .ldr file is not flashed into external SPI flash.

    Can you please try to change the boot mode 0 and load simple application like LED blinking in flash and let us know how you get on.

    Regards,
    Anand Selvaraj.

  • Hello

    As asked to run any simple application I tried the Button_LED_GPIO example (printf statement commented out because it will create issue in flash). In debug mode it worked fine but after flashing in boot mode 0 and changing the switch to boot mode 1 to run from flash. This didn't happen and same SYS_FAULT LED glows same before. I think the FAQ code      (Missing Wiki Page)  given in forum to work with flash has made some changes on the board and sys fault led is glowing every-time. Please help me in this as I already tested my two eval board which has shown the same behavior. Hoping for favorable response.

    Regards

    Anukul Anand

  • Hi,

    To assist you better, can you please get back on below points,

    When programming the flash using the CLDP, can you add a compare command to make sure that the data written to flash is not getting corrupted?
    Does -erase all (instead of -erase affected) make a difference?
    If you repeat the test several times, do you always get the same result?

    Regards,
    Anand Selvaraj.

  • Hello

    Yeah adding the compare command gives the error : "value 0x0 at offset 0x00000001 in flash doesn't match the value in the file selected"

    I think the data that is written in flash using cldp command is getting corrupted and hence the system fault LED is glowing continuously. I tried -erase all also. This also doesn't make any difference. 

    I repeated the exercise several times but no luck. 

    Does this imply that my flash has gone bad because of the example project given in forum as described above. Although the link is not working. I will attached the code which I got from the forum and spoiled my flash. 

    Is there any way to revive my flash. Hoping for favorable response.

    Anukul Anand

    Central Research Laboratory

    Bharat Electronics Limited

     Flash_Basics.zip

  • Hi,

    We also facing the same issue as you mentioned after flashing the "Flash_Basics.zip". please follow the below steps to recover the flash.

    1. Run the attached project "flash_fullchip_complete" in debug mode (Don't flash). This example erase, write and read the entire flash.
    2. In console you will get as mentioned in Image1.JPG
    3. Terminate the debug session.
    4. Run the cldp.bat file which loads the simple led application into flash. Refer Image2.jpg. Both loading and comparing is successfull.
    5. After loads complete, press reset button. Fault LED is not glown.
    6. If you press PB1, LED1 Toggles. If you press PB2, LED2 Toggles.

    Please try this and let us know the results.

    Flash.zip



    Regards,
    Anand Selvaraj.

  • Hello 

    Thank You for the solution. The problem is resolved and my flash on both boards are working fine. 

    Out of curiosity can I ask what went wrong in flash? What I observed that the flash driver file (attached in the zip file) that was sent yesterday is somehow different from the flash driver present in the examples in C: that I generally used to flash my codes. Because when I try to flash the ''flash.ldr (containing led example)"  with existing driver in C:, the flashing and compare is completed successfully but after resetting the board again the SYS_FAULT LED glows up. Then I have to use the attached driver file to proceed. And after recovering the flash I used the driver from examples to flash my project code. And it worked fine.  

    You can give me the insight on this for my better understanding. Hope for favorable response.

    P.S. My other threads are still unsolvable . Please look into that. 

    Regards

    Anukul Anand

    CRL, BEL

  • Hi,

    Glad to know that your issue got resolved.

    During power on reset, application code and data from flash loads into the various internal and external memories.
    Example "Flash_Basics" does reset, erase, write and read back the data from flash. So, we are load the data from flash which reset and modify he flash content. we believe that this makes flash has become corrupt or inoperable.

    So, please ensure before flashing that code does not erasing or overwriting the flash contents during Power on reset.

    Driver file that we supplied is rebuild with latest CCES version. But the source files are same only.

    Regards,
    Anand Selvaraj.

  • Thank You for the valuable input and guidance on Flash. 

    Regards

    Anukul Anand