Skip to main content
shravan
Associate II
April 12, 2017
Question

Memory-Loader error

  • April 12, 2017
  • 7 replies
  • 5220 views
Posted on April 12, 2017 at 15:22

Hi all,

        I am facing some issues here on flash erasing and programming. I am not getting where is the actual problem. I am using STM32F429ZET on our custom board. For testing purpose is used provided blinky example's hex file which support same controller. Problem here is that when i am trying to program this hex file using ST-Link utility it throws errors as:

18:22:34 : ST-LINK SN : 49FF70065178505057391687

18:22:34 : ST-LINK Firmware version : V2J28S6

18:22:34 : Connected via SWD.

18:22:34 : SWD Frequency = 4,0 MHz.

18:22:34 : Connection mode : Normal.

18:22:34 : Debug in Low Power mode enabled.

18:22:34 : Device ID:0x419

18:22:34 : Device flash Size : 512KBytes

18:22:34 : Device family :STM32F42xxx/F43xxx

18:23:04 : [Blinky.hex] opened successfully.

18:23:04 : [Blinky.hex] checksum : 0x000F72B6

18:23:07 : Memory-Loader error

18:23:07 : Error occured during erase operation!

18:23:07 : Programmed memory Checksum: 0x00000000

Any idea?

Any suggestions might help me.

    This topic has been closed for replies.

    7 replies

    Technical Moderator
    April 12, 2017
    Posted on April 12, 2017 at 15:28

    Hi

    p.Shravan

    ,

    I recommend you to upgrade the ST-Link firmware version through this link

    /external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fst_com%2Fen%2Fproducts%2Fembedded-software%2Fdevelopment-tool-software%2Fstsw-linkhtml

    /external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fst_com%2Fen%2Fproducts%2Fembedded-software%2Fdevelopment-tool-software%2Fstsw-linkhtml

    Thanks

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    shravan
    shravanAuthor
    Associate II
    April 12, 2017
    Posted on April 12, 2017 at 15:56

    Hi Imen D,

    Thank you for your quick reply. I tried this option but nothing changed.

    Tesla DeLorean
    Guru
    April 12, 2017
    Posted on April 12, 2017 at 17:19

    What did you use to create the file?

    What memory regions are described in the linker script or scatter file?

    If Keil, what does the internal download/debug report when configuring the ST-LINK in SWD mode?

    Have you done any other testing on your board?

    Can you use the System Loader via USART or USB in your design?

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    shravan
    shravanAuthor
    Associate II
    April 13, 2017
    Posted on April 13, 2017 at 06:47

    Hi Clive One,

                Please find my answers here,

       

    What did you use to create the file?

    I actually used Keil IDE.

    What memory regions are described in the linker script or scatter file?

    This is the memory region: Load Region LR_IROM1 (Base: 0x08000000, Size: 0x00002b1c, Max: 0x00010000, ABSOLUTE)

    If Keil, what does the internal download/debug report when configuring the ST-LINK in SWD mode?

    This is the Build Output from Keil:

    C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe -c SWD -p 'D:\SANDBOX\STM32\Blinky\Flash\Blinky.hex' 0x08000000 -V -Rst

    STM32 ST-LINK CLI v3.0.0.0

    STM32 ST-LINK Command Line Interface

    ST-LINK SN : 49FF70065178505057391687

    ST-LINK Firmware version : V2J28S7

    Connected via SWD.

    SWD Frequency = 4000K.

    Target voltage = 3.0 V.

    Connection mode : Normal.

    Device ID:0x419

    Device flash Size : 512 Kbytes

    Device family :STM32F42xxx/F43xxx

    Loading file...

    Flash Programming:

    File : D:\SANDBOX\STM32\Blinky\Flash\Blinky.hex

    Address : 0x08000000

    Memory programming...

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

    Memory-Loader error

    Error occured during erase operation!

    ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 100%

    Programming Complete.

    Programmed memory Checksum: 0x00000000

    MCU Reset.

    Have you done any other testing on your board?

    No, I haven't done any testing. We just got this new custom board. 

    Can you use the System Loader via USART or USB in your design?

    I think this custom board don't have such provision. Only what I got is SWD pins for programming.

    Tesla DeLorean
    Guru
    April 13, 2017
    Posted on April 13, 2017 at 11:20

    Looks like you build process uses external tools to download code. What about Keil's normal way of configuring the ST-LINK as a debugger internally and using that to download and debug? Make sure update target is selected and you have a flash algorithm selected for the STM32. 

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Max
    ST Employee
    April 13, 2017
    Posted on April 13, 2017 at 04:28

    Could it be that you have an external memory configured in ST-Link Utility/External Loader menu that do not mach with your hardware on your custom board?

    shravan
    shravanAuthor
    Associate II
    April 13, 2017
    Posted on April 13, 2017 at 06:53

    Hi Max,

                I haven't selected any External Loader. All these Loaders are deselected. Can you please tell me what is exactly meant by Memory-Loader error .

    Max
    ST Employee
    April 13, 2017
    Posted on April 13, 2017 at 11:47

    I think the answer is on the next line of your log:

    Error occured during erase operation!

    but at this stage, I have no idea what could be causing that error.

    There are a few possible directions to investigate, in no particular order:

    - follow

    Turvey.Clive.002

    recommendation and try if the debugger works

    - check the hex file content to make sure it'scorrect, i.e. not trying to use memory that dos not exist in your device

    - check the protection in the option bytes (but I think the error message should be different in this case)

    - check your power supply. If the supply is not able to sustain the programming current, you may have this kind of behavior.

    - observe the reset pin during programming with an oscilloscope

    Were you able to program this device on this board before or is it the first time?

    Do you have several boards or only one? if you have several, you may want to try on another one.

    regards,

    Max

    Alex R
    Associate II
    April 13, 2017
    Posted on April 13, 2017 at 17:43

    Hi,

    Do you have an external watchdog circuit on your board that can be triggering the CPU reset ?

    If yes, do you have a way to disable it?

    Alex R.

    Tesla DeLorean
    Guru
    April 13, 2017
    Posted on April 13, 2017 at 18:44

    I think we are definitely into board implementation details, but no specifics have been shared.

    Time to drag the board designer into the bring-up party, and probe things like the NRST signal.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    shravan
    shravanAuthor
    Associate II
    May 3, 2017
    Posted on May 03, 2017 at 12:39

    Hello again,

    As per the suggestions I updated the firmware of ST-Link and it started to flash/erase my custom board but I have a weird behavior of a simple blinky code not working, when I checked with the code I found that control is lost in this following line. 

    /* Configure the system clock */

    SystemClock_Config(); 

    My PPL configurations are as follows and I have used 25MHz crystal 

    /*Initializes the CPU, AHB and APB busses clocks*/

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;

    RCC_OscInitStruct.HSEState = RCC_HSE_ON;

    RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

    RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;

    RCC_OscInitStruct.PLL.PLLM = 25;

    RCC_OscInitStruct.PLL.PLLN = 360;

    RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;

    RCC_OscInitStruct.PLL.PLLQ = 7;
    Max
    ST Employee
    May 8, 2017
    Posted on May 08, 2017 at 09:08

    This sounds like an oscillator issue...

    Does the crystal start oscillating? 

    Try enabling the MCO pin and look at the clock with a scope.

    shravan
    shravanAuthor
    Associate II
    May 15, 2017
    Posted on May 15, 2017 at 09:03

    Hi Max,

    Thanks for your reply. I have tested the crystal with the scope and its giving out the frequencies properly. But still my control fails to come out of the 

    SystemClock_Config() function. When I debug I found out that its exactly hanging at HAL_Enable_PLL() function which is used to enable main PLL. This is the same case for all of the tested sample codes. But when tested the same code with my STM32 Discovery(stm32f429zit6) all the examples are wotking properly. 

    Max
    ST Employee
    May 16, 2017
    Posted on May 16, 2017 at 04:03

    So there is a problem when you start the PLL.

    Try to change its configuration to see what is wrong.

    Reduce the output frequency (reduce PLLN or increase PLLP)

    I think PLLQ is out of spec in your configuration (freq>48MHz) try with 8.

    shravan
    shravanAuthor
    Associate II
    May 16, 2017
    Posted on May 16, 2017 at 07:19

    Hi Max,

    I have followed this 

    https://stm32f4-discovery.net/2014/11/overclock-stm32f4-device-up-to-250mhz/

     to set the PLL values. I have tested for different values and for all those changes its giving same response by getting stuck at the above mention line. I tested by changing system click from 48MHz to 168MHz but no use.
    Max
    ST Employee
    May 16, 2017
    Posted on May 16, 2017 at 09:21

    If you get stuck when enabling the PLL, this means there is something wrong with your configuration.

    Are you sure the voltage scaling / flash wait states are set up correctly?

    Did you try running an example from the library on your board?

    shravan
    shravanAuthor
    Associate II
    May 29, 2017
    Posted on May 29, 2017 at 06:51

    Hi, Sorry for the delayed reply. I used STM32 cube to generate the code and a simple blinky program seems to work without any problem. I would like to thank you all for your support.