cancel
Showing results for 
Search instead for 
Did you mean: 

Programming error after first time

MSeme.1
Associate II

Hi,

I have a problem with my STM8AF6213PDU custom board.

The first time, I programmed sucessfully the board using ST Visual Programmer. The procedure was succesfully because I loaded a "blink firmware" and it's always working (ever with power on/off)

Now I want to update my firmware but I'm not allowed to do it. I cannot estabilish connection neither with ST Visual Develop nor ST Visual Programmer.

It's like a read/write protection but I can't disable it. I can not think about the "one shot possibility" because sounds to me impossible.

Could someone help me? Is there a procedure that I'm missing?

Thanks,

Marco.

4 REPLIES 4
Artur IWANICKI
ST Employee

Hello,

Are you reconfiguring PD1 pin (shared with SWIM interface line) in your application ?

Could you please try to hold MCU in reset just before trying to connect to it, please? The reason for that operation would be to perform "connect under reset" scenario which would allow you to connect with the debugger before your code will be executed.

Could you please share with me part of the schematics related to VCAP, SWIM and NRST connections.

Could you please check those points on your side?

In case you do not want to share those data on this forum, please insert a question using online support system.

Thank you in advance

Best Regards,

Artur

Hello Artur, I managed to get it work.However, the procedure that I'm following is insane:1 - Try a programming using ST Visual Programmer2 - The led on ST-Link colors green3 - Press the reset button4 - Power cycle5 - From ST Visual develop press DEBUG6 - When I "feel" debug procedure is ready, I relewase the button7 - Debugging can take place Is there an alternative for this procedure? Do you follow this procedure to debug STM8? An other problem is that when I go step by step with the debugger, the debug session crashes. For the moment I'm trying to debug my code inserting strobes on my code, programming with ST Visual Programmer, checking the behaviour with oscilloscope and trying to guess the path of the code.Is there a solution for this?Thanks,Marco. Il mercoledì 15 dicembre 2021, 13:31:05 CET, ST Community ha scritto: @media only screen and () {#yiv3005270284 html {}#yiv3005270284 table.yiv3005270284container {width:100% !important;}#yiv3005270284 .yiv3005270284hidden-for-mobile {display:none !important;}#yiv3005270284 .yiv3005270284callToAction, #yiv3005270284 .yiv3005270284callToAction td, #yiv3005270284 .yiv3005270284footer {font-size:12px !important;}#yiv3005270284 .yiv3005270284button .yiv3005270284text {font-size:12px !important;}#yiv3005270284 .yiv3005270284defaultIndentation {width:10 !important;}#yiv3005270284 .yiv3005270284text {font-size:12px !important;}#yiv3005270284 a.yiv3005270284button {width:96 !important;}#yiv3005270284 a.yiv3005270284buttonWide {width:118 !important;}#yiv3005270284 a.yiv3005270284buttonAuto {padding-left:1em !important;padding-right:1em !important;}#yiv3005270284 a.yiv3005270284button, #yiv3005270284 a.yiv3005270284buttonWide, #yiv3005270284 a.yiv3005270284buttonAuto {min-height:23 !important;line-height:23px !important;border-radius:4px !important;}#yiv3005270284 td.yiv3005270284buttonWrapper {width:98 !important;min-height:23 !important;}#yiv3005270284 img {display:inline !important;}#yiv3005270284 .yiv3005270284circle {border-radius:50%;}#yiv3005270284 .yiv3005270284square {border-radius:10%;}}@media only screen and () {#yiv3005270284 table.yiv3005270284container {width:600px !important;}}@media screen {#yiv3005270284 filtered {}}#yiv3005270284 a, #yiv3005270284 a:visited {color:#015BA7;text-decoration:none;}#yiv3005270284 img {display:block;}#yiv3005270284 .yiv3005270284preheader {display:none !important;}#yiv3005270284 table {border-collapse:collapse;}Hello, Are you reconfiguring PD1 pin (shared with SWIM interface line) in your application ?Could you please try to hold MCU in reset just before trying to connect to it, please? The reason for that operation would be to perform "connect under reset" scenario which would allow you to connect with the debugger before your code will be executed.Could you please share with me part of the schematics related to VCAP, SWIM and NRST connections. Could you please check those points on your side?In case you do not want to share those data on this forum, please insert a question using online support system. Thank you in advanceBest Regards,Artur Hello,   Are you reconfiguring PD1 pin (shared with SWIM interface line) in your application ? Could you please try to hold MCU in reset just before trying to connect to it, please? The reason for that operation would be to perform "connect under reset" scenario which would allow you to connect with the debugger before your code will be executed. Could you please share with me part of the schematics related to VCAP, SWIM and NRST connections.   Could you please check those points on your side? In case you do not want to share those data on this forum, please insert a question using online support system.   Thank you in advance Best Regards, Artur Programming error after first time Hi,   I have a problem with my STM8AF6213PDU custom board.   The first time, I programmed sucessfully the board using ST Visual Programmer. The procedure was succesfully because I loaded a "blink firmware" and it's always working (ever with power on/off) Now I want to update my firmware but I'm not allowed to do it. I cannot estabilish connection neither with ST Visual Develop nor ST Visual Programmer.   It's like a read/write protection but I can't disable it. I can not think about the "one shot possibility" because sounds to me impossible.   Could someone help me? Is there a procedure that I'm missing? Thanks, Marco. Hello,   Are you reconfiguring PD1 pin (shared with SWIM interface line) in your application ? Could you please try to hold MCU in reset just before trying to connect to it, please? The reason for that operation would be to perform "connect under reset" scenario which would allow you to connect with the debugger before your code will be executed. Could you please share with me part of the schematics related to VCAP, SWIM and NRST connections.   Could you please check those points on your side? In case you do not want to share those data on this forum, please insert a question using online support system.   Thank you in advance Best Regards, Artur To change or turn off ST Community email, log in as marco95_thebest@yahoo.it.st. Are notifications about this post getting annoying? Reply to this email with the word " mute". STMicroelectronics N.V.
Artur IWANICKI
ST Employee

Hello Marco,

Are you using SWIM pin (or reconfiguring within the code) or low power modes (like halt) in your application ? It could be the reason of the issue.

Next points worth to check are related to hardware part of the application:

  • the length of the wires between your board and the debugger. Its max length is 20cm.
  • capacitor value at VCAP pin (it should be at least 470nF)
  • capacitor at NRST line (100nF) as close as possible to the MCU

Could you please check it on your side?

Best Regards,

Artur

Hello Artur,

I'm using the original SWIM pin. Not sure what you mean by low power mode. I believe that I'm using normal mode because I don't know about low power mode.

The length of the wire is ok according to your suggests

The capacitor value at VCAP pin is ok according to your suggests

The capacitor on the NRST is 100nF, but I'll try to get it closer to the CPU.

I'll be back to you when I test again the board and I'll provide a screen of the debugging session. hopefully could help.

Thanks,

Marco.