请问CH32F CortexM0/M3系列MCU可以直接用STM32CubeIDE开发环境开发吗?

之前用STM32F103C8T6在STM32CubeIDE下开发的HAL程序可以直接烧录到CH32F103C8T6芯片上使用吗?还是需要做什么代码修改移植工作?

你好,是可以直接烧录使用的。


STM32CubeIDE 的HAL库是完全兼容的是吗?想了解一下在STM32CubeIDE 环境下开发CH32F系列芯片有什么需要注意的地方。看到网上有文章说CH32的bootloader和flash下载算法和stm32的不同,能具体介绍一下吗?


附:5款国产ARM芯片(对标stm32f103c8t6)测试评估



你好,st的两字节编程ch32是兼容的,但是速度会慢一点,如果对flash编程速度没有要求的话可以不用在意。如果对速度有要求的话可以使用ch32的128字节快速编程,快速编程的例程可以查看ch32f103evt中的flash例程,evt可以在我们官网下载。


CH32F103C8T6用STM32CubeIDE开发,选STM32F103C8 编译下载时出现报错:

ST-Link设备进行初始化时出错。

原因:(18) Could not verify ST device! Abort connection.


请问是什么地方需要设置吗?


image.png


用STM32 ST-LINK Utility可识别出芯片是STM32F10xx Medium-density

image.png


不知道你的问题解决了没?

STM32CubeIDE 的HAL库是完全兼容的.

使用keil的话 下载ch32f103evt CH32F103EVT.ZIP - 南京沁恒微电子股份有限公司 (wch.cn)

然后安装device pack 才能成功烧录了。


问题没解决,我公司几个项目都是用STM32CubeIDE开发的,没用keil,CubeIDE下载时报错,见楼上的错误信息。这个问题一直没解决。


well you dont expect STM tools compatible with WCH do you? 

You may ask WCH if they can proide a gdb Server or you may ask STM if the might include support in their tools for WCH chips or you may simply use OpenOCD for this.


If you use vendor locked tools you have to stay with these vendor. 


@usbman, Thanks for you replay.

 

The vendor told me that CH32F103s are totally compatible with STM32CubeIDE. That’s the reason I’m trying CH32F103 on STM32CubeIDE. However, the result is it just doesn’t works.

 

I’m expect the replay for how to make the download works or clearly let me know  CH32F103s chips are not compatible with STM32CubeIDE for downloading.

 

What I’m exactly concern is how to make STM32F103 HAL code which developed on STM32CubeIDE work on CH32F103 chip.

 

No clear answer till now.



Well that is a misunderstanding then. The WCH chips might be comptible with the Cube framework. The programmer and GDB server are not because those tools check the ChipVendor and therefore will not find a valid STM Chip ID.

So you have to find alternate programmer and GDB server. There are plenty out there.

This is what i ment with vendor locked tools.

Personally i dont use HAL too much but use the chips bare metal. WCH might even be the better solution because they support 5V Vcc, an extra USB Port, and some other nice extra features, but again if you use them you are locked to WCH :-)


只有登录才能回复,可以选择微信账号登录