"thank you for being interested in creative electronic music."

diydsp_log.png Join us -  We're making a journey into sound.

 

What is st-util?

 

st-util, which is free, writes apps into the flash of your stm32f4 chip.  It works over a three wire ST-only serial bus called SWD (clock, data in, data out).  It is a vital part of developing musical instruments using the STM32F4.

 

This pages shows you where to get it, how to use it and what to do about a few error messages.  If you would like to make any contributions, please get in touch with us.

 

 

How to Compile and Install st-util

On Ubuntu Linux, following these instructions will help you download, compile and install st-util on your computer:

 


#Download and build st-util
sudo apt-get -y install libusb-1.0-0-dev
sudo apt-get -y install libusb-1.0
git clone https://github.com/texane/stlink.git
cd stlink

# at this point, on Lubuntu, you must add the following line to top line of Makefile.am
# so autoconf can find the path to the usb libraries:
# ACLOCAL_AMFLAGS = -I /lib/i386-linux-gnu
# The following step is necessary, at least on Lubuntu 13.03, see https://github.com/texane/stlink/issues/83
sudo apt-get install pkg-config

./autogen.sh
./configure
make
cd ..

asdf

asdf






Error Messages

 

If you see this error message:

"libusb_submit_transfer(-1)
[!] send_recv"

 

It may mean your USB driver is overwhelmed (such as multiple suspend and resumes, plugging/unplugging lots of devices).  You can fix it with the modprobe command below

 



nvawter@Majestic:~/stm32f4/install/libopencm3-examples/examples/stm32/f4/mobb1/mobb_platform_alpha_03$ sudo st-util
libusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_recv
2014-05-27T10:46:17 INFO src/stlink-common.c: Loading device parameters....
libusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_recv
2014-05-27T10:46:17 WARN src/stlink-common.c: unknown chip id! 0
libusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_recv
Chip ID is 00000000, Core ID is  00000000.
libusb_submit_transfer(-1)
[!] send_recv
Listening at *:4242...
^Clibusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_recv
libusb_submit_transfer(-1)
[!] send_only

 

 



asdf

Modprobe command to reset USB bus

 

Sometimes the USB bus gets overwhelmed.  Unplug all of the devices (except your keyboard) and run this command to reset it:


sudo modprobe -r usbhid && sleep 5 && sudo modprobe usbhid

asdf

 

 

Running st-util with no STM32F4 on the SWD

 

Notice that st-util still tries to listen on 4242 even if it didn't find a chip there.  That can be confusing if you don't realize it.  In this case, you have to press control-c, connect your chip properly and try again.



root@Majestic:~/stm32f4/install/libopencm3-examples/examples/stm32/f4/mobb1/mobb_platform_alpha_03# st-util
2014-05-27T10:49:28 INFO src/stlink-usb.c: -- exit_dfu_mode
2014-05-27T10:49:28 INFO src/stlink-common.c: Loading device parameters....
2014-05-27T10:49:28 WARN src/stlink-common.c: unknown chip id! 0xe0042000
Chip ID is 00000000, Core ID is 00000000.
Target voltage is 2893 mV.
Listening at *:4242...

 

Running st-util with the MOBB-1

 


root@Majestic:~/stm32f4/install/libopencm3-examples/examples/stm32/f4/mobb1/mobb_platform_alpha_03# st-util
2014-05-27T11:04:51 INFO src/stlink-usb.c: -- exit_dfu_mode
2014-05-27T11:04:51 INFO src/stlink-common.c: Loading device parameters....
2014-05-27T11:04:51 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
2014-05-27T11:04:51 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes

 


Chip ID is 00000413, Core ID is 2ba01477.root@Majestic:~/stm32f4/install/libopencm3-examples/examples/stm32/f4/mobb1/mobb_platform_alpha_03# st-util
2014-05-27T11:06:30 INFO src/stlink-common.c: Loading device parameters....
2014-05-27T11:06:30 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
2014-05-27T11:06:30 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
Chip ID is 00000413, Core ID is 2ba01477.
Target voltage is 2881 mV.
Listening at *:4242...

Target voltage is 2882 mV.
Listening at *:4242...

 

st-util with stm32f4 discovery


root@Majestic:~/stm32f4/install/libopencm3-examples/examples/stm32/f4/mobb1/mobb_platform_alpha_03# st-util
2014-05-27T11:07:05 INFO src/stlink-common.c: Loading device parameters....
2014-05-27T11:07:05 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
2014-05-27T11:07:05 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
Chip ID is 00000413, Core ID is 2ba01477.
Target voltage is 2881 mV.
Listening at *:4242...



 

Links

 

The website for st-util is at: https://github.com/texane/stlink

The subreddit for the stm32f4

 

Powered by liveSite