-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CKS32: Support for CKS32F103C8T6 #756
Comments
I think the only problem is that the I have successfully uploaded the bootloader using ST-Link on Windows, but I'd like to be able to do the same from Linux :) |
Thanks! |
@xor-gate is there a release timeframe for this? I'm on a Mac and I see the last release was in September and I'm having the same problem... |
There are instructions provided on how to compile from sources: https://github.com/texane/stlink/blob/master/doc/compiling.md |
@VictorLamoine does yours now work? Mine now stops as per issue #607 |
Yes I have flashed more than 8 device using the modifications, all device were from the same provider so they were exactly the same. As for you problem, I'm afraid I cannot help! Good luck |
It appears I have the same CS32F103C8T6 microcontroller from the same seller "Wavgat" on Aliexpress. Fix #757 has resolved the issue for me. After some digging around I think the CS32 microcontroller is made by China Key System, a company based in Wuxi, China: http://www.cksic.com/en/about/217.html Here's a Chinese user manual for a development board making use of the CS32 microcontroller, from another of CKS's websites (CKS Cup, an electronics competition for university students) http://www.ckscup.com/upload/yonghushouce.pdf Someone else on the EevBlog forum encountered a similar issue https://www.eevblog.com/forum/beginners/unexpected-idcode-flashing-bluepill-clone/ |
Since #757 has been reverted (see #761 (comment) ), can this please be re-opened to track official support for this chip? |
Reopening it now. |
These chips are NOT legitimate copies of the STM32 so avoid buying them: |
Thanks @VictorLamoine, the aim of the texane/stlink project is to support legitimate programmers and chips. So I will close this issue. Thanks all. |
Same error on macOS Mojave.
|
|
Thank you! But to get work properly, you need to remove definition STM32_FLASH_BASE and STM32_SRAM_BASE in includes/stlink.h: // line 62 |
It seems that #805 was merged which enables support for the CS32 Blue Pill clone. I just compiled the latest version on the master branch v1.5.1-31-g625f4cd, commit 625f4cd5 and it appears that CS32 MCU support has been re-enabled. Successful flash to CS32 MCU: $ st-flash --version
v1.5.1-31-g625f4cd
$ st-info --probe
Found 1 stlink programmers
serial: 563f6f06513f52481953253f
openocd: "\x56\x3f\x6f\x06\x51\x3f\x52\x48\x19\x53\x25\x3f"
flash: 0 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device
$ st-flash write generic_boot20_pc13.bin 0x8000000
st-flash 1.5.1-31-g625f4cd
2019-07-27T18:43:38 INFO usb.c: -- exit_dfu_mode
2019-07-27T18:43:38 INFO common.c: Loading device parameters....
2019-07-27T18:43:38 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2019-07-27T18:43:38 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2019-07-27T18:43:38 INFO common.c: Attempting to write 21140 (0x5294) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08005000 erased
2019-07-27T18:43:38 INFO common.c: Finished erasing 21 pages of 1024 (0x400) bytes
2019-07-27T18:43:38 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-07-27T18:43:38 INFO flash_loader.c: Successfully loaded flash loader in sram
21/21 pages written
2019-07-27T18:43:39 INFO common.c: Starting verification of write complete
2019-07-27T18:43:39 INFO common.c: Flash written and verified! jolly good! I encountered other connection issues with the CS32 Blue Pill clone and have documented some fixes on my blog: http://eugenesia.co.uk/2019/07/cs32-blue-pill-clone-connection-problems/ |
I'll take a look at this now with the following environment:
|
So far this all looks good, but I haven't verified the core-id yet (seen it via openOCD previously, as far as I can remember). I'd be surprised if this was not a fake chip... |
After figuring out how to start the compared to Thus it appears verifiable that STM32 clones with this core ID are working with the st-link toolset without the need for a change in the codebase. For further investigation I'll also test with older releases. Maybe we can figure out if something else (accidentally) caused the problems somewhere in the code history. |
@eugenesia: I'm still working out the history of this feature request throughout the code (which was not so easy though), but as far as I can see this is what happened so far: 2019-01-03 (#767) [1st feature request, this ticket] So this is likely to have been originally resolved with PR 805 already, implying Release v1.6.0 shipped with a functional implementation. |
Hey @Nightwalker-87 thanks for following up on this. Apologies for my lack of updates as I haven't touched anything STM32-related for a while due to work. The last time I checked in July 2019, #805 had fixed the issue. My blog post merely documents some other quirks and workarounds for the CS32 chip, a clone chip made by China Key System from Wuxi, China, so is unlikely to be useful to you. I'll try out the latest update and see if it still works for the CS32 chip. |
Hey there.
Indeed it is, as I have one of these as well. Also this is the chip targeted by this issue as CS32F103 and CKS32F103 seem to be the same chip manufactured by the mentioned company.
To me it would be most helpful if you verified with 84f63d2, c492e1d and finally with the v.1.6.0 tag, because that would let this whole topic go to the correct Release milestone including related PRs, I could mark all of these as resolved and verified and can update/correct the changelog. Referring to your blogpost, it would also be good to know if detection works without holding down Reset now. Talking about my setup, this is the case. |
Hi @Nightwalker-87 I have verified as requested (due to Covid I have some time on my hands 😂). All the versions you asked me to test worked. Before testing each version I pulled out the ST-Link v2 programmer from my USB port and plugged it back in, together with the CS32F103C8T6 MCU. After each test, the program I uploaded worked as the LED was blinking. Latest master f5d0454$ st-info --version
v1.6.0-31-gf5d0454
$ st-info --probe
Found 1 stlink programmers
serial: 563f6f06513f52481953253f
openocd: "\x56\x3f\x6f\x06\x51\x3f\x52\x48\x19\x53\x25\x3f"
flash: 131072 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device
$ st-flash write miniblink.bin 0x8000000
st-flash 1.6.0-31-gf5d0454
2020-03-29T17:39:08 INFO common.c: Loading device parameters....
2020-03-29T17:39:08 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-03-29T17:39:08 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-03-29T17:39:08 INFO common.c: Attempting to write 688 (0x2b0) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2020-03-29T17:39:08 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes
2020-03-29T17:39:08 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2020-03-29T17:39:08 INFO flash_loader.c: Successfully loaded flash loader in sram
1/1 pages written
2020-03-29T17:39:08 INFO common.c: Starting verification of write complete
2020-03-29T17:39:08 INFO common.c: Flash written and verified! jolly good! Commit 84f63d2$ st-info --version
v1.5.1-30-g84f63d2
$ st-info --probe
Found 1 stlink programmers
serial: 563f6f06513f52481953253f
openocd: "\x56\x3f\x6f\x06\x51\x3f\x52\x48\x19\x53\x25\x3f"
flash: 131072 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device
$ st-flash write miniblink.bin 0x8000000
st-flash 1.5.1-30-g84f63d2
2020-03-29T17:42:11 INFO common.c: Loading device parameters....
2020-03-29T17:42:11 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-03-29T17:42:11 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-03-29T17:42:11 INFO common.c: Attempting to write 688 (0x2b0) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2020-03-29T17:42:11 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes
2020-03-29T17:42:11 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2020-03-29T17:42:11 INFO flash_loader.c: Successfully loaded flash loader in sram
1/1 pages written
2020-03-29T17:42:11 INFO common.c: Starting verification of write complete
2020-03-29T17:42:11 INFO common.c: Flash written and verified! jolly good! Commit c492e1d$ st-info --version
v1.5.1-36-gc492e1d
$ » st-info --probe
Found 1 stlink programmers
serial: 563f6f06513f52481953253f
openocd: "\x56\x3f\x6f\x06\x51\x3f\x52\x48\x19\x53\x25\x3f"
flash: 131072 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device
$ st-flash write miniblink.bin 0x8000000
st-flash 1.5.1-36-gc492e1d
2020-03-29T18:01:58 INFO usb.c: -- exit_dfu_mode
2020-03-29T18:01:58 INFO common.c: Loading device parameters....
2020-03-29T18:01:58 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-03-29T18:01:58 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-03-29T18:01:58 INFO common.c: Attempting to write 688 (0x2b0) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2020-03-29T18:01:58 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes
2020-03-29T18:01:58 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2020-03-29T18:01:58 INFO flash_loader.c: Successfully loaded flash loader in sram
1/1 pages written
2020-03-29T18:01:58 INFO common.c: Starting verification of write complete
2020-03-29T18:01:58 INFO common.c: Flash written and verified! jolly good! Tag v1.6.0 393310f$ st-info --version
v1.6.0
$ » st-info --probe
Found 1 stlink programmers
serial: 563f6f06513f52481953253f
openocd: "\x56\x3f\x6f\x06\x51\x3f\x52\x48\x19\x53\x25\x3f"
flash: 131072 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device
$ st-flash write miniblink.bin 0x8000000
st-flash 1.6.0
2020-03-29T17:46:12 INFO common.c: Loading device parameters....
2020-03-29T17:46:12 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-03-29T17:46:12 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-03-29T17:46:12 INFO common.c: Attempting to write 688 (0x2b0) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2020-03-29T17:46:12 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes
2020-03-29T17:46:12 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2020-03-29T17:46:12 INFO flash_loader.c: Successfully loaded flash loader in sram
1/1 pages written
2020-03-29T17:46:12 INFO common.c: Starting verification of write complete
2020-03-29T17:46:12 INFO common.c: Flash written and verified! jolly good! I didn't have to use the Reset button to trigger MCU detection in the above tests. Did you do something that fixed it? The last time I had detection problems, I overwrote the boot loader or did something similar. I will try to do a more thorough test for this later on, by recreating the detection issue, and checking to see if the latest Stlink version fixes it. |
@eugenesia: Thank you so much for verifying this. 🥇
No, so it must be either a result from the oldest commit you tested or any earlier change not specifically related to this board type. I don't really know, but nothing to bother about really.
You can if you wish to do so. Talking about my demand - I'm absolutely fine and satisfied with the results you've just presented. 👍 |
Resolved by #805. |
st-flash
I am trying to upload the bootloader from the STM32duino project.
Info about the device:
Output:
The text was updated successfully, but these errors were encountered: