cancel
Showing results for 
Search instead for 
Did you mean: 

External Flash Download Fails most of the times

Bala1
Associate II

Hi,

I am working on STM32L4R9_Discovery board. I have created a blank TouchGFX project and i have added around 20 images to the project so that image data will be written to the external flash. And after compilation, size of the target.hex file is shown as 11694700 Bytes(11.7MB) and my flash size is 64MB. After compilation i selected Run Target option which is present on the TouchGFX Tool to download code to the kit.

Sometimes download gets successful. But Most of the times download fails after download initiation and gives below message.

 Erasing memory corresponding to segment 0:

    Erasing internal memory sectors [0 43]

    Erasing memory corresponding to segment 1:

    Erasing external memory sectors [0 175]

    Download in Progress:

    ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%

    Û 3%Û 4%Û 6%Û 9%Û 10%Û 12%Û 14%Û 17%Û 18%Û 20%Û 23%Û 25%Û 26%Û 28%Û 31%Û 32%Û 34%Û 36%Û 39%Û 40%Û 42%Û 45%Û 47%Û 48%Û 50%Û 53%Û 54%Û 56%Û 58%

     

    Error: failed to download Segment[1]

    Error: failed to download the File

    Time elapsed during download operation: 00:01:29.861

     

    Hard reset is performed

    gcc/Makefile:282: recipe for target '_extflash_' failed

    make[1]: *** [_extflash_] Error 1

    ../gcc/Makefile:50: recipe for target 'flash' failed

    make: *** [flash] Error 2

    Failed

  Failed

This i have tried with STM32CubeProgrammer also and same thing happens.

I googled and tried many ways, but not found any resolution for this.

Could you please help to resolve this issue.

Thanks and Regards,

Bala

3 REPLIES 3
Martin KJELDSEN
Chief III

The Designer just reports what STM32CubeProgrammer outputs, so it makes sense that both are reporting the same error.

Can you add the external flashloader manually in STM32CubeProgrammer and try to erase the flash just to be sure that you can actually access it and the board is not faulty? The Makefile the designer uses already configures the right flashloader for the board.

/Martin

Bala1
Associate II

Hi @Martin KJELDSEN​,

Thank you so much for the details.

I have added External Flash-loader then only tried programming in STM32CubeProgrammer. As i mentioned previously, sometimes download will get success and will show proper screens also. This failure is coming only during flash downloading time which is after erasing. It's not failing at particular block also to check for code issue.

To confirm hardware i have changed different cable, but still fails randomly. If it's not from Software then i have to check with different Kit.

Thanks and Regards,

Bala

Let me know how it goes with a different kit!