RogerClark wrote: ↑
Sat Sep 16, 2017 9:27 pm
Are you trying to use it as USB to Serial, or USB to SPI etc ?
DId you look in the Windows device manager to see what devices appear when you connect it with the relevant pins pulled high or low?
Flashed the code to a BluePill but the USB device comes up as unknown, and looking in the device manager, this is because the USB is not functioning correctly.
There should be value in the windows device manager for Hardware ID's, but it just appears as "USB Unknown"
Do you know what clock crystal is on that board ?
Also when you backed-up the whole flash, there seems to be less code than I'd expect,
Yes, I am trying to use it as USB to Serial, USB to SPI and USB to I2C, I have successfully use it as USB to Serial but I can't figure out how to use it as USB to I2C and USB to SPI.
To switch the mode to USB to I2C, you need to ground the RX pin.
To swtich the mode to USB to SPI, you need to ground the SDA pin.
To switch the mode to USB to Serial, you need to ground the MOSI pin.
The reason why you are getting an unknown USB device is because you need to choose one of the 3 modes above, meaning you must gound one of the pins before plugging it into the computer. Once you ground one of the pins, either RX, SDA or MOSI, it will come up as a CH340 Virtual comm port for all 3 types. I am not sure what the associated RX,SDA and MOSI pins are, but most probably will be hardware serial, I2C and SPI?
Edit : I went through the traces, I suspect I2C is on I2C1, SPI is on SPI1 and UART is on UART2. There are also 3 LED indicators which will indicate what mode the board is in, the pins the LEDs are connect to I am not sure, can't see the traces.
Erm, as for the backed up, do I need to do anything on the ST-Link utility? I simply dump the device memory, I don't think it will save zero values in the file, will they, meaning it will yield 64K since it is a stm32F103C8T6 (64k) device?
As for the crystal on the board, I am not sure of smd codes, but I have enclosed a enlarged photo of what I think is the crystal. The rest looks like resistors and caps and I think one is a LDO regulator probably the 1117.
Thanks for your help in trying this out.