Skip to main content
Visitor II
August 24, 2021
Solved

Problem with SWD Interface

  • August 24, 2021
  • 4 replies
  • 3809 views

Hello,

i want to program my STM32G031F4P6 chip over ST Link, but i get the error message

"Can not read memory! Disable Read Out Protection and retry".

Disable the Read Out Protection over the Option Bytes doesn't work.

Erasing the chip also doesn't help.

Can anybody help me to solve this problem?

    This topic has been closed for replies.
    Best answer by Imen.D

    Add the flash programming related to your device.

    For that, open your MDK-ARM, go to: Project > Options for Target >Utilities>Settings>Flash Download>Add Flash programming related to your device.

    Imen

    4 replies

    Technical Moderator
    August 24, 2021

    Hello @TKlei.5​ ,

    Firstly, make sure to upgrade the ST-Link firwmare/drivers.

    Did you use the latest version of STM32CubeProgrammer tool? 

    Try select "connect under reset" option in Target->Settings.

    Is NRST connected to debugger?

    Maybe you can try with BOOT0 pulled high?​

    When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

    Imen

    Super User
    August 24, 2021

    > Disable the Read Out Protection over the Option Bytes doesn't work.

    What does doesn't work mean? Does it succeed? Error messages?

     

    > Erasing the chip also doesn't help.

    Does it erase the chip?

    Are you using 3.3V or 1.8V? Note that most programmers will not be compatible with a 1.8V target.

    TKlei.5Author
    Visitor II
    August 24, 2021

    Thank you for your answers.

    I can connect the chip with the latest version of the STM32CubeProgrammer tool now.

    But i want to flash and debug the chip with the KEIL MDK V5 IDE.

    I get the error message: "Cannot load Flash Device Descriotion! Flash Download failed- 'Cortex-M0+'".

    Imen.DAnswer
    Technical Moderator
    August 24, 2021

    Add the flash programming related to your device.

    For that, open your MDK-ARM, go to: Project > Options for Target >Utilities>Settings>Flash Download>Add Flash programming related to your device.

    Imen

    TKlei.5Author
    Visitor II
    August 24, 2021

    Now it works fine. Thank you!

    This topic can be closed.

    Technical Moderator
    August 24, 2021

    Really glad to know you overcame this problem. :)

    I closed this thread by marking Select as Best button.

    Imen