-1

I will ask a question about my STM32F407 Discovery board. I want to learn about external interrupts and I was making a small circuit. I connected PH0 to my button and PH1 to the LED. But these pins are connected to the mcu's crystal pins. But I didn't know it at that time. I was press button that is connectet to 5V. And my IDE won't connect to my board for debugging debugging. I can connecting to my board via ST Link Utility and I can do a full chip erase with no errors. Then I turn back to code in Atollic, press the debugging button and I get this error messages:

Error in executing 'cont' command ... 
CM4 Failed to read all registers
FAILED to REGISTER Values from the target
Target is not responding, retrying...

*some messages in between*

warning: Remote failure reply: E31
Remote failure reply: E31
Remote connection closed
Quit

And then I turned off the debug screen to try again but I can't because Atollic can't find any ST Link devices. This is the error message:

Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.

Note: My PC recognize my board in Device Manager.

How can I solve this problem. ST Link Utility connects to my board succesfully, My PC connects to my board. I tried St link firmware upgrade but I got more errors. Like this.

Failure at line: 13 in "Target Software Startup Scripts"

EN20
  • 51
  • 11
RasimGök
  • 1
  • 2
  • 7
  • But when I connect it to the PC, I still see 1 MB storage device on my computer. My MCU flash still working and I can seeing MCU sectors in ST Link Utility. – RasimGök Jun 23 '20 at 16:38

2 Answers2

2

You probably have ST Utility still connected to your MCU. This results in Atollic not beeing able to connet to the MCU. Either close ST Utillity or press the disconnet button.

Since you can erase it your MCU should be ok and you chose one of the few 5V tolerant pins but it would be better practice to use 3V.

Another reason might be the option bytes if the read out protection got set to level 1 or 2 the debugger is sometimes not able to reset those and is therefore not able to read out the register.

EN20
  • 51
  • 11
  • No ST Utility not connected at debuggin time. I disconnect every time. This advice is not my problem. But I don't know E31 error what does it mean? I think this error about register read issue. Because it says "FAILED to REGISTER Values from the target". And thanks for your advice I will use 5v tolerant pins and 3v circuit voltage. Thanks for your comment ;) – RasimGök Jun 23 '20 at 16:32
  • Check the option bytes the readout protection might be set. Sometimes the erase does not work properly then set the readout protetion to level 1 and then program to level 0 this will erase the mcu properly. But never use level 2 because that is not reversible – EN20 Jun 23 '20 at 16:43
  • The 1 MB storage you see on your pc is the ST Link device on your discovery board – EN20 Jun 23 '20 at 16:44
  • I checked the option bytes. Readout protection is level 0. BOR level is OFF. nRST_STOP, nRST_STDBY, WDG_SW are set in User configuration option byte. Flash sector protection is off for all sectors. – RasimGök Jun 23 '20 at 17:44
0

I was solve a lot of problem. Firstly I found a problem. This is a my DCMI_Config function. In this function I have a lot of pin definition. GPIOA caused my problem.

GPIOA-> MODER = 0x00002200; //GPIOA 4,6 Set Alternate Function for DCMI

This line has my problem. I was search Discovery schematic and I found something. PA4 pin connected to Discovery's voice uc as I2S3_WS. Is this cause any problem?

0___________
  • 60,014
  • 4
  • 34
  • 74
RasimGök
  • 1
  • 2
  • 7