makerbase-mks / MKS-SERVO42B

MKS SERVO42B is 3d printer closed loop stepper motor NEMA17 MKS SERVO42 developed by Makerbase that prevents losing steps. CPU is STM32F103C8T6 ARM 32-bit Cortex™-M3 CPU Core,72 MHz. Magnetic encoder is Allegro's A1333LLETR-T Contactless 0° to 360° angle sensor IC ,12bit .This Project open source hardware and code,support platformio build and upload firmware...
https://www.aliexpress.com/item/33032696338.html?spm=a2g0o.store_home.productList_8356958.pic_1
GNU General Public License v3.0
166 stars 70 forks source link

Update wiki with ST-link isntruction to disable "Read Out Protection" #17

Closed dzid26 closed 2 years ago

dzid26 commented 3 years ago

Error when trying to connect to STM32:

Can not read memory!
Disable Read Out Protection and retry.
  1. In order to unprotect the chip with ST-LINK, one has to click Target -> Option Bytes: -> change Read-Out Protection - Disabled. image

  2. Then it is possible to switch to System memory (0x1FFFF800) and see firmware binary: image

  3. Flashing is possible now.

makerbase-mks commented 3 years ago

Hi! You need Unsecure chip by J flash or other tool, but i know't your tool hold Unsecure chip function. image

dzid26 commented 3 years ago

I know. I provided solution for ST-link, because it was not obvious what to do. You can add my instruction to the wiki https://github.com/makerbase-mks/MKS-SERVO42B/wiki/MKS-SERVO42B-User-Manual#how-to-upload-firmware so it's easier for people understand how to do it with ST-Link tool.

mustafatrk0 commented 2 years ago

In section Read Out Protection, it says Level0, Level1, Level2. How can I turn off Read Out Protection

dzid26 commented 2 years ago

In section Read Out Protection, it says Level0, Level1, Level2. How can I turn off Read Out Protection

This doesn't work for you? https://github.com/makerbase-mks/MKS-SERVO42B/issues/17#issue-672503790

mustafatrk0 commented 2 years ago

unfortunately not working. When I try to change from Level 1 to Level 0 I get error "Could not set Options byte! Please reset the target and retry"

fpvmate commented 2 years ago

unfortunately not working. When I try to change from Level 1 to Level 0 I get error "Could not set Options byte! Please reset the target and retry"

I also get same error did anyone solved this ?

dzid26 commented 2 years ago

unfortunately not working. When I try to change from Level 1 to Level 0 I get error "Could not set Options byte! Please reset the target and retry"

I also get same error did anyone solved this ?

The first post says what to do.

fpvmate commented 2 years ago

unfortunately not working. When I try to change from Level 1 to Level 0 I get error "Could not set Options byte! Please reset the target and retry"

I also get same error did anyone solved this ?

The first post says what to do.

I tried that and it didn't work that's why asked again.

up2smoke commented 2 years ago

+1 disable protection is nt possible

dzid26 commented 2 years ago

In section Read Out Protection, it says Level0, Level1, Level2. How can I turn off Read Out Protection I had a look at it again. F103 series chip doesn't have protection levels. Only disabled/enabled options. So you are writing in the wrong Github issue or maybe somehow you were debugging wrong target. This should be reported device: image

fpvmate commented 2 years ago

In section Read Out Protection, it says Level0, Level1, Level2. How can I turn off Read Out Protection I had a look at it again. F103 series chip doesn't have protection levels. Only disabled/enabled options. So you are writing in the wrong Github issue or maybe somehow you were debugging wrong target. This should be reported device: image

But what about stm32f405 chips in that while I was using in my flight controller the board stopped responding and when i connect the processor with st-link it's saying read out protection is enabled and when i try to make it to level 0 it's not happening and says failed in between . Any solution for that or is it possible to erase the entire chip ? Can anything be done with the help of boot pins of the processor?

dzid26 commented 2 years ago

If it is set to Level2 then it is irreversible. https://www.st.com/resource/en/application_note/an4701-proprietary-code-readout-protection-on-microcontrollers-of-the-stm32f4-series-stmicroelectronics.pdf Anyway, your problem doesn't belong to this issue.

Sasha7b9Work commented 1 year ago

This helped me: https://community.st.com/s/question/0D50X00009Xkdy5SAB/not-able-to-update-option-bytes (update firmware ST-Link utility)

huanbaose commented 1 year ago

在读取保护部分中,它显示 Level0、Level1、Level2。 如何关闭读出保护

You need to select Level0.

mfaghani commented 11 months ago

unfortunately not working. When I try to change from Level 1 to Level 0 I get error "Could not set Options byte! Please reset the target and retry"

I've had the same problem with ST-LINK and STM32 ST-LINK Utility V 4.6.0.0, it was solved by decreasing the connection frequency from 4MHz to 125KHz in Target->Settings->Connection Settings.