Skip to content
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: Add support for CKS32F103C8T6 #805

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

vzasukhin
Copy link
Contributor

CS32F103C8T6 is clone of STM32F103C8T6 but with incorrect core_id number. ( #757 )

All original STM32F1xx has core id STM32VL_CORE_ID, but CS32F103 has different core id 0x2BA01477 (as original STM32F3xx, STM32F4xx and STM32L1xx).

This commit should not affect other devices because all original STM32F1xx (include STLINK_CHIPID_STM32_F1_MEDIUM) has core id STM32VL_CORE_ID.

CS32F103C8T6 is clone of STM32F103C8T6 but with incorrect core_id number.
Copy link

@NavinF NavinF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I successfully flashed my CS32F103C8T6 after applying this PR, so it fixes #756.

All the new Blue Pill boards use this chip instead of the STM32 so I hope this is merged soon. For now, here's how I used it with the Arduino IDE:

git clone https://github.com/texane/stlink.git
cd stlink/
git fetch origin pull/805/head:805
git checkout 805
make release
sudo mount -o bind /home/navin/stlink/build/Release/ /home/navin/.arduino15/packages/STM32/tools/STM32Tools/1.2.1/tools/linux64/stlink

@xor-gate xor-gate added this to the Next milestone Jun 6, 2019
@xor-gate xor-gate merged commit 84f63d2 into stlink-org:master Jun 6, 2019
@xor-gate
Copy link
Member

xor-gate commented Jun 6, 2019

Sorry for the late reply! Looks good to me

@eugenesia
Copy link

Thanks @NavinF for this patch, have tested the latest version of stlink (which includes this patch) with my CS32 clone MCU and it works.

I compiled the latest version on the master branch v1.5.1-31-g625f4cd, commit 625f4cd5.

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/

Nightwalker-87 added a commit that referenced this pull request Feb 20, 2020
-> CKS devices with Core ID 0x2ba01477
(Closes #756 #757 #761 #766 #769 #805)
@Nightwalker-87 Nightwalker-87 modified the milestones: General, v1.6.1 Feb 21, 2020
@Nightwalker-87 Nightwalker-87 changed the title Add support for CS32F103C8T6 CKS32: Add support for CKS32F103C8T6 Mar 17, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.6.1, v1.6.0 Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CKS32: Unable to flash STM32F103C8T6 with stlink 1.5.1 CKS32: Support for CKS32F103C8T6
5 participants