Open lyusupov opened 1 month ago
I don't have a 307.... but I suspect it should work.
Thank you for your reply!
but I suspect it should work
Could you, please, deploy HEX and BIN binaries for V307, similar to that you already did for the V305 ?
it looks like the 305 and 307 are binary compatible. The source code doesn't differentiate between the two, and they share a common startup file and macro.
`
`
So, you should be able to flash the same binary to a 307 device and as long as you have it wired up to the same GPIO pins (https://www.wch.cn/downloads/WCH-LinkSCH_PDF.html) - I don't see why it wouldn't work. The actual pin numbers will likely be different, but the port/pins used are the same. If needed, you can change them in User/DAP_config.h.
For example,
// SWD IO RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); GPIO_InitStructure.GPIO_Pin = PIN_CLK | PIN_DIO;
the SWDIO pin is therefore using Port A and PIN_CLK is defined as pin 14 - so, PA14.
Also don't forget that you need a 12MHZ crystal on PD0/PD1
Uploading of CH32V305_DAP.bin by WCHISPStudio via USB into V307 devkit gives no effect.
V307 uses different clock source routing.
V305
V307
Give this a try.... the code assumes a 12MHz crystal, and you've got an 8MHz one. I updated the HSE_VALUE to 8000000. Having it connected to the OSC_IN / OSC_OUT pins is correct.
Give this a try...
Still no positive effect. I've tried both of USB ports available - no any HS DAP device comes up.
This V307 code works Ok - https://github.com/nielh/hs-link
However it does not provide USB CDC interface.
I'm out of ideas, then. The startup code and MCU libraries are the same for both projects.
Maybe someday I'll order a 307, and hack around some more.
Is there any chance to add support for V307 as well ?
https://www.cnx-software.com/2022/07/14/yd-ch32v307vct6-risc-v-mcu-board-comes-with-ethernet-and-plenty-of-i-os/ https://github.com/yym36100/RISC-V_CH32V307VCT6