Spark Logic

Custom STM32F103C8T6

Dallasta Fri May 20, 2016 7:06 pm

Hey guys!

I recently designed a custom STM32 board for an RS485 aplication. I was using an Atmega 168 before and I was having trouble with speed, so I decided it was time to move.
The board is simply a STM32F103C8T6 with an AS5048A magnetic encoder and a SN65HVD78 transceiver. It reads the encoder via SPI and sends the information to a dynamixel servo network, using the dynamixel protocol. I have the SWD pins to program it.
As I already have the code for the arduino IDE so I was thinking what should I modify on my code to port it. Another question I have is how I set the clock on the microcontroller (on AVR devices you use the memory fuses)? I’m using a 16Mhz crystal to reach the 72Mhz.
If you want, I can send the codes, the libs and the board schematic.
Here is a picture of the boards (I have two different models to fit in different places). I’m now soldering them and waiting for a few components to arrive.
Image
I would apreciate a lot if someone could help me here.
Thanks!

Replies

stevech Thu Jun 02, 2016 4:02 am

Ah, I see. I just use ST-Link every day, but to do downloads and SWD. So, I don’t know what I don’t know! :|

Slammer Thu Jun 02, 2016 7:03 am

STLink of nucleo boards is V2.1, while dongles are V2. USB CDC Serial is supported only in V2.1.

RogerClark Thu Jun 02, 2016 7:15 am

Slammer wrote:STLink of nucleo boards is V2.1, while dongles are V2. USB CDC Serial is supported only in V2.1.

GrumpyOldPizza Mon Jun 06, 2016 12:15 pm

RogerClark wrote:Slammer wrote:STLink of nucleo boards is V2.1, while dongles are V2. USB CDC Serial is supported only in V2.1.

Slammer Mon Jun 06, 2016 12:21 pm

I can use the ST-Link part of my Nucleo-401RE to program the BluePill (103RE) with storage device (copy the binary to storage device) normally.
OK, the name of Volume created by ST-Link is always something with 401RE, but it works. Do you mean that every Nucleo’s stlink V2.1 is working only (as storage device) to specific variants of STM32 family?

GrumpyOldPizza Mon Jun 06, 2016 12:32 pm

Slammer wrote:I can use the ST-Link part of my Nucleo-401RE to program the BluePill (103RE) with storage device (copy the binary to storage device) normally.
OK, the name of Volume created by ST-Link is always something with 401RE, but it works. Do you mean that every Nucleo’s stlink V2.1 is working only (as storage device) to specific variants of STM32 family?

Slammer Mon Jun 06, 2016 2:12 pm

GrumpyOldPizza wrote: On the other hand it might be simply marketing, as the ST-Link on the Nucleo boards is fundamentally something different that an standalone ST-Link device.

GrumpyOldPizza Mon Jun 06, 2016 3:15 pm

Slammer wrote:GrumpyOldPizza wrote: On the other hand it might be simply marketing, as the ST-Link on the Nucleo boards is fundamentally something different that an standalone ST-Link device.

Vassilis Mon Jun 06, 2016 4:53 pm

I have the feeling that the SB12-SB15 jumpers should be de-soldered in case you don’t want to break the board in two parts,for isolating the ST-Link v2.1 from the main Nucleo MCU.
nucleo-board-bottom-side.jpg
nucleo-board-bottom-side.jpg (253.3 KiB) Viewed 1379 times

Slammer Mon Jun 06, 2016 8:45 pm

No remove of resistors, no break of board.
Just remove the two jumpers on CN2 (see photo). The only problem I had with Nucleo-STLInk is that RESET pin is required for reseting the target system (or you have to reset manually by button or other way) . Note that VCC cannot power the target board from ST-Link (unlike the cheap ST-Link Dongles), is only for sensing the target voltage, but in Nucleo-STLink is NOT used. Note the TX & RX at CN3, these signals go to USB-CDC.

randybb Mon Jun 06, 2016 8:48 pm

But these jumpers are for SWD interface only. In case you want to use serial interface as well, then you need to remove mentioned 0 ohm resistors.

Slammer Mon Jun 06, 2016 8:57 pm

Yes! correct! Serial is available either by removing of SB14/SB15, either by breaking the ST-Link from the board.
The price of the board is so low and I think it is possible for someone to buy it, just for the ST-Link part (and keep the rest as a bonus).

Rick Kimball Mon Jun 06, 2016 9:14 pm

randybb wrote:But these jumpers are for SWD interface only. In case you want to use serial interface as well, then you need to remove mentioned 0 ohm resistors.

Vassilis Tue Jun 07, 2016 6:27 am

Rick Kimball wrote:randybb wrote:But these jumpers are for SWD interface only. In case you want to use serial interface as well, then you need to remove mentioned 0 ohm resistors.

Slammer Tue Jun 07, 2016 1:41 pm

Rick Kimball wrote:I just pull the power jumper to the target chip and it won’t read or write on the serial pins. Oh and I use the power there to power the target off board chip

Rick Kimball Tue Jun 07, 2016 3:49 pm

I haven’t seen any issues from doing this. However, it doesn’t mean your results will be the same

testato Mon Sep 26, 2016 12:47 pm

Slammer wrote:No remove of resistors, no break of board.
Just remove the two jumpers on CN2 (see photo). The only problem I had with Nucleo-STLInk is that RESET pin is required for reseting the target system (or you have to reset manually by button or other way) . Note that VCC cannot power the target board from ST-Link (unlike the cheap ST-Link Dongles), is only for sensing the target voltage, but in Nucleo-STLink is NOT used. Note the TX & RX at CN3, these signals go to USB-CDC.

RogerClark Mon Sep 26, 2016 9:13 pm

The STLink firmware is read protected, but I have seen copies of it in some Russian sites, as someone figured out who to hack the Windows program that does the firmware upgrade, and extracted the unencrypted binary from Windows memory.

Re:Usb mass storage

The STM32F103 does not have any built in USB profiles, ( unlike the F4).
You can write code so that its any form of USB device you want, but you have run code in the MCU to do this.

If you feel like writing a mass storage bootloader, please go ahead, but remember you wont be able to use the HAL or CMSIS etc as the code needs to be ultra small ( less then 0x2000 to be comparable with the existing DFU bootloader)

Slammer Mon Sep 26, 2016 9:43 pm

The hacked firmware is for STLink/V2 not for V2.1
V2.1 adds some very important features like mass storage upload and USB/Serial passthrough, as I understand nobody has cloned the V2.1 (this is included on all Nucleo boards) as all Chinese clones support V2 operations.
If we compare the code size of BlackMagic (which is also a debuger/serial passtrough device), I dont think that would be possible to include this functionality in the code memory of a typical F103C8 as bootloader (and to have spare memory for a real application)

randybb Mon Sep 26, 2016 9:47 pm

On Nucleo is STM32F103CB.

Sign in to reply