-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stm8s103f3 flashing - Tries exceed - Protected chip #38
Comments
I tried to flash the same chip from Windows ST Visual Programmer and got "Device is protected" message. Removing of protection resolved the issue. Flashing is OK now from Windows and Linux both. Is it possible to add chip protection removal to stm8flash? |
Having the same problem with the stm8s103f3. Is there any way to "unprotect" the thing on Linux? Sadly I don't have any experience with STM8 microcontrollers, and would just like to experiment with them, so all I can do is +1 the issue. |
read the manual and datasheet before ask, pls.
|
@kensenjiha thanks. I've tried your solution on two boards, but it does not appear to solve the issue. I still get the same error. Also, if that is relevant, the red LED (might be specific to the model I bought) stopped blinking when it is powered on:
No idea where to start, the 100 page PDF is for sure intimidating to me, and I would just like to get the 10 1$ microcontrollers from China working without having to use a crappy OS called Windows and a proprietary program :) |
I tried tinkering with a HC-11 board with a stm8s003f3 mcu. The ROP_CLEAR.bin file completed once but not again. Determine OPT area And all other commands end up in the following: Determine OPT area |
I tried ST Visual programmer and that worked fine. So I tried with increasing the duration of the TRY macro. This helps somewhat, I can read/write 50% of the times. With the windows software I get 100%, so something is wrong with the commands or timing. diff --git a/try.h b/try.h
|
@AlexanderSelzer , try reset to factory defaults: echo "00 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > factory_defaults.bin |
@minobull Now it works, I was able to write to flash now. Thank you. Also, if anyone has the same issue, the sdcc-examples-stm8 blinky.c example does not work on the stm8s103f3 boards. Use one from there instead: http://www.cnx-software.com/2015/04/13/how-to-program-stm8s-1-board-in-linux/ |
@minobull that is sensational. After 5 hours working on this, your two-liner has turned a dead end into a success. I guess the opt2 box in README.md can be changed to OK for stm8s103f3. Very pleased to report success with OS X (El Capitan) + ST-Link V2 (Mini emulator on eBay) + sdcc + stm8flash + STM8S103F3P6 (minimum system development board on eBay). Have attached a minimum blinky.c and a minimum Makefile to any others working along the same path. Just cut out the .txt extensions. |
It works also on Win7 x64+ ST-Link V2 + SDCC + STM8S103F3P6 I create options backup without ROP and now you can unlock your STM8S103F3P6 with command: |
@minobull Thank god I found you! Crazy... |
Hi. stm8flash 20170616-1.1 Initial attempt to flash this device reported Testing with STVP on Windows indicated that the device was read out protected. Cleared read out protection, using STVP. Could now flash device on Windows using STVP. However, can read both flash and option bytes using stm8flash on Ubuntu machine. Am probably doing something silly. Should I have posted this a a separate (new) issue? I have attached the result of the stm8flash option byte read, although this file had to be renamed with a .txt extension to be uploaded. Take care. M |
the issue with "tries...exceeded" has nothing to do with a protected chip or similar. |
I am having "tries exceeded" happen on my STM8s103f3 chip when trying to reset to factory defaults. I have not run it in a loop to see if I can get one try to work, but I will overnight and see if it works. |
Did not work. Anyone who finds a solution, please ping me - I would like to get my boards working :) |
Update: I got a new ST-Linkv2 in the mail and I tried that with my STM8 boards - two out of three worked on the first try with the new link. The third one is being a problem child, and I get this feeling I may have messed something up with it in the process of trying to get it to flash. I used the #define ERROR(s) do { fprintf(stderr, "%s in %s:%d\n", (s), __FILE__, __LINE__); exit(-1); } while(0) This will tell you the source file and line that actually ended up failing. Honestly, I think these are the results of cheap hardware and good/bad luck. Keep trying, and if you have the money to buy another STM8 or ST-linkv2, it might fix any problems you have with the flash. It's disappointing, I understand, but that's the price you pay for cheap hardware. Good luck and godspeed the rest of you reading this. |
A little while back, I noticed that the success or failure to upload code
to STM8 devices depended upon which USB port I used.
I assumed, rightly or wrongly, that some ports were not able to supply
adequate current.
I have not done enough experiments on this to either confirm or disprove
though.
M
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On 31 March 2018 at 18:25, Alek Ratzloff ***@***.***> wrote:
Update: I got a new ST-Linkv2 in the mail and I tried *that* with my STM8
boards - two out of three worked on the first try with the new link. The
third one is being a problem child, and I get this feeling I may have
messed something up with it in the process of trying to get it to flash. I
used the -d slow option, I'm not sure if that helped. If you want some
sort of diagnostics about *where* tries exceeded, change line 6 in error.h
to read like this:
#define ERROR(s) do { fprintf(stderr, "%s in %s:%d\n", (s), __FILE__, __LINE__); exit(-1); } while(0)
This will tell you the source file and line that actually ended up failing.
Honestly, I think these are the results of cheap hardware and good/bad
luck. Keep trying, and if you have the money to buy another STM8 or
ST-linkv2, it might fix any problems you have with the flash. It's
disappointing, I understand, but that's the price you pay for cheap
hardware. Good luck and godspeed the rest of you reading this.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcmEmQuphUyJG4U3UEgVv5C3a49sfsieks5tj7v6gaJpZM4HNrmR>
.
|
I am also facing the same issue on Linux. Is anyone got any solution on linux yet? |
Is there any solution got for this issue yet? I am also facing same problem.. |
This issue probably ought to be closed. @embhobbb yes, there were multiple solutions given. If you are in fact getting "Tries exceeded" due to a protected chip (ROP flag), one of the solutions provided by @ghost, @minobull, or @blahlt should have worked for you. I'm using OpenBSD and had to install vim(1) to get the xxd(1) command. You may very well be experiencing ST-Linkv2 issues like @alekratz, but that is outside the scope of this issue. The dev boards I ordered already had blinky running, so I suspect the ROP flag got set when they flashed blinky. Personally, I skipped the @ghost solution, went straight for @minobull, and was then able to flash my own program. Lastly, @wonbinbk thanks for that blinky.c with the sine wave, that is kind of cool. I made a couple of changes so it doesn't need: #include "stm8-header/stm8s.h"
|
Just ran into this issue and as it turn out on my ST-Link v2 clone the SWIM and GND Pins were swapped on the silkscreend label on the programmer. swapping the connections did fix the issue |
@bgrumbine i had working stlink previously. i have created another thread and here is the link. |
$ echo "00" | xxd -r -p >ROP_CLEAR.bin Hi. I got ROP protected stm8s105s4 chip in e-bike controller and would like dump it's entire content (flash, eeprom and option memory). Is it 100% sure that doing above trick will result in a lost of original flash memory ? |
Summary: check your grounding! I was having similar issues, but none of the above worked. In frustration I tried connecting the USB power and programmer in at the same time (same PC!) Things magically worked with out issues(!) I disconnected the USB power and it started failing again. It wasn't power supply; I could get it to work again by just touching the USB cable plug to the socket metal. |
Thanks @julianrendell , in addition to the "protected chip" issue, all my 4 samples of STM8S103F3P6 boards (bought from China) had the same GND problem. I marked my findings with my multimeter:
I apologize because I know this hardware problem may be specific to (all) my boards, or my vendor, but I hope my findings can be useful for someone. |
results into
There is stm8s103f3 controller on the "minimal system board". Can I help (e.g. providing of additional logs, testing) to make this toolset work with the controller mentioned?
Also, is there any native Linux way to flash stm8 as a temporary solution?
Hardware is similar to the listed in this article
The text was updated successfully, but these errors were encountered: