"Hello World"

A project log for HiCuDriver

convert a BLDC driver in High Current Driver. Provides a Step/Dir interface like DRV8825 A4988 and converts 12@1A in coil current up to 70A

Chris.deerlegChris.deerleg 12/07/2019 at 11:370 Comments

For establishing a connection to the PCB are following steps required:

On the image above is a picture of the ST-Link programmer connected to the PCB. The ST Link programmer pin "T_SWSCLK" is connected to testpoint which is marked as "DIO"  and "T_SWDIO" is connected to testpoint which is marked as "CLK". If the pin are interchanged, it will not be possible to get a connection to the PCB.

As Next remove the write protection.

Above is the STM32 cube programmer shown. The tool is available on the STMicroelectronics home page. After the successful installation it should be possible to establish and connection to the PCB. The default communication frequency of  4000 kHz  don't work for me. I used 100 kHz as frequency to get a stable connection. In the OB menu under sub-menu "Write Protection" tick all boxes and apply.  Once done the write protection is successfully removed. 

To run a blink sketch the following is to do.

Reduce the flash frequency

the following show how to change the programmer frequency in a Arduino IDE with a STM32F.


in the Arduino path shown above is the stm32CubeProg.bat to modify.

exit 0
%STM32CP_CLI% -c port=%PORT% freq=480 reset=SWrst %MODE% %ERASE% -q -d %FILEPATH% %ADDRESS% -v %OPTS% 
exit 0

at the end of the stm32CubeProg.bat add "freq=480 reset=SWrst" to reduce the frequency and change to software reset. Further add "-v" to verify the code after flashing.

Create a board variant
The following shows how to create a own board variant for the Arduino IDE.


 in the folder variants (path above) are all board listed which are usable in the Arduino IDE .

to create a new board variant for the HiCuDriver copy the DISCO_F030R8 folder and renamed it to HiCuDriver_Dshot.

Add a board in Arduino IDE menu

the following shows how to add the own board variant to the tool menu in the Arduino IDE.


it is necessary to change the "boards.txt" which is to find in the path shown above. add the lines of "# HiCuDriver_DShot" in the section "# Generic F0".  Further details see below.

# Generic F0 STM32F0 series{build.product_line} {build.xSerial}


# DEMO_F030F4_HSI board Demo board (internal RC oscillator)

# HiCuDriver_DShot board (internal RC oscillator)"No_mass_storage_for_this_board_Use_STLink_upload_method"

The led is connected to pin PB3. Therefore to get a blinking led, replace "LED_BUILTIN" with "PB3"

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PB3, OUTPUT);

// the loop function runs over and over again forever
void loop() {
  digitalWrite(PB3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(250);                       // wait for a second
  digitalWrite(PB3, LOW);    // turn the LED off by making the voltage LOW
  delay(250);                       // wait for a second