FAQ's and links - Please read if you are new

Please read this if you are new to the STM32
User avatar
RogerClark
Posts: 5916
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

FAQ's and links - Please read if you are new

Post by RogerClark » Mon Jan 25, 2016 11:41 pm

Please post your additions and I will merge and remove your postings.

FAQ's

Please read all the way down, as OS specific FAQs are below the general FAQs

Q. Whats this all about?
A. Its about using the Arduino IDE and API to program STM32 based controller boards.


Q: How do I get Started?
  1. Install the stm32duino support package for Arduino

    The stable release are now listed here. Download the most recent zip

    https://github.com/rogerclarkmelbourne/ ... 2/releases

    Instructions on how to install the zip are in this video (Note the video says download the main version of the repo - this has been superseded by the Releases system )

    https://www.youtube.com/watch?v=TePglhSkghg +
  2. figure out how to upload code to your board
    1. Serial - requires a TTL (3.3V) serial adapter - viewtopic.php?f=36&p=295
    2. ST-Link - requires a ST-Link adapter - hook up the SWD lines: GND, Clock (labeled DCLK or SWCLK), and Data (labeled DIO or SWDIO) between your ST-Link and board
    3. STM32duino bootloader - requires you flash your target board with the bootloader first
    4. BMP (Black Magic Probe) - requires a device dedicated to being a Black Magic Probe. Hook up the SWD lines like the ST-Link and optionally the UART for debugging
  3. set the Board and Variant for your target under the Tools menu
  4. set the upload method in the Arduino IDE under Tools > Upload method
  5. set the com port for the Serial or STM32duino methods (it's optional for the BMP method)
Q. What boards are supported
A. STM32F103 based boards have the best level of support. This includes STM32F103C serial, STM32F103R series, STM32F103T series, STM32F103V series and STM32F103Z series.
STM32F4 series are supported to a lesser extend, and use a modified version of the F103 codebase.
GD32F103 is also supported within the STM32F103 boards, as they are very similar

Q. What Arduino IDE version is supported
A. Version 1.8.0 is know to work fine, (various older versions e.g. 1.6.5 also work - Note. Not all old versions work)

Q. What Operating Systems are supported
A. Windows, Vista, 7, 8, 8.1 and 10 are all known to work.
OSX works for most people (Special setup for DFU may be needed)
Linux, both 32 and 64 bit flavours work for most people (Special setup / configuration for both Serial and DFU may be needed based on your distro)

Q.Where can I download the bootloader binaries or source
A. Here... https://github.com/rogerclarkmelbourne/ ... bootloader
There are precompiled binaries for a number of different boards.

Q. How to I get the bootloader onto my board.
A. You will need either a USB to Serial Adaptor or a ST-Link Adaptor, or you can use any other SWD programmer that supports the STM32 e.g. JLink.
See this video which shows how to upload firmware, (a bootloader of a sketch) to a STM32 board using a USB to Serial adaptor
https://www.youtube.com/watch?v=G_RF0a0hrak

Q. I managed to upload once, (using the bootloader), but when I tried to upload again it didn't work?
A. You probably forgot to select the Serial device for the board. The IDE uses the Serial port to reset the board back into upload mode.

Q: Which upload methods have USB serial?

For the STM32F1 boards, SERIAL_USB is defined for the STM32duino and ST-Link methods. This means the "Serial" object is the virtual UART on the USB port, and UART1 is "Serial1" and so on. For the other upload methods, "Serial" is UART1 and "Serial1" is UART2 and so on.

For the STM32F4 boards, "SerialUSB" is the virtual UART on the USB port and "Serial" is UART1 and so on.

Q.I have another / different board. Can you add support for this board?
A. Sorry. No. If you have a new sort of board based on the STM32F103 or STM32F4 we may be able to help you create the necessary files to add support for that board, but we can't do it for you.

Q. My board has an LED and / or a button on it which doesnt match with any of the available bootloaders. What should I do?
A. If you are despirate to get going with your new board and its not one which the bootloader specifically supports, you can use any of the bootloaders, e.g. generic-pc13.bin, however you won't get a flashing LED to indicate what is going on.
If you want a custom version of the bootloader, you will need to modify the existing code and rebuild it. The process is extensively documented at https://github.com/rogerclarkmelbourne/ ... bootloader

Q. I uploaded a sketch using the bootloader and now want to upload using ST-Link. Why doesn't ST-Link connect?
A. The SWD pins are set to GPIO mode when you use the bootloader and Serial upload methods, so that people can use them as GPIO.
Use the "Connect Under Reset" option in the Windows ST-Link tool, and press and hold reset on the board, then connect via ST-Link and release the button. This eventually works, but sometimes you need to try a few times before it will connect.
If you select the ST-Link upload method, the SWD pins are not assigned as GPIO, so you should be able to upload again without needing Connect Under Reset


Windows specific questions

Q. When I plug in my board to the USB on my PC, it says device not recognized
A.If you have a brand new board, other than a Maple, or Maple mini, the chances are that your board does not have a bootloader, or any other firmware installed on it at all. In this case you need to "flash" the Stm32duino bootloader onto your board.

Q. I installed the bootloader, but Windows says it can't find a driver for the board?
A. You need to install the special Windows driver using the batch file in /drivers/win in the files you downloaded from GitHub

Q: I ran the install_drivers.bat file, but Maple board doesn't create virtual serial port and has yellow exclamation mark in device manager.
A: Connect your board, run the Zadig http://zadig.akeo.ie/downloads/zadig_2.2.exe tool - select Maple in hardware dropdown menu, choose USB CDC driver, install.

Q. I've noticed that Windows device manager shows either the "Maple DFU" device or "Maple Serial". What are these?
A. Maple DFU is the USB device that the bootloader enumerates as, which allows the OS to upload to the board using the DFU protocol.
Maple Serial is the virtual UART / Serial device which the sketch enumerates as, when its running, which you can use Serial.print etc or Serial.read etc to communicate with.

Mac OSX specific questions

Q. dfu-util doesn't seem to work.
A. Install dfu-util using HomeBrew (google osx homebrew if you don't know what this is)

Linux specific questions

Q. dfu-util doesn't seem to work.
A. dfu-util was built for 32 bit linux, and only seems to work on some 64 bit linuxes. The easiest solution is to build dfu-util from the sources included in tools/src/dfu-util and copy the resultant binaries to the tools/linux folder to replace the 32 bit version

Q. Linux won't open the Maple serial port
A. You need to update the rules files. Try running the linux installer script, or search the forum for the ways other people resolved this problem.



Links

Main Github repository. https://github.com/rogerclarkmelbourne/Arduino_STM32
Releases page - https://github.com/rogerclarkmelbourne/ ... 2/releases
Bootloader Github repository. https://github.com/rogerclarkmelbourne/ ... bootloader

ST-Link utility. http://www.st.com/web/en/catalog/tools/PF258168
ST Serial Flash utility. http://www.st.com/web/en/catalog/tools/PF257525

Main programming reference manual for the STM32F103 series. http://www2.st.com/content/ccc/resource ... 171190.pdf

Old. Leaflabs wiki on the Maple Mini. hhttp://docs.leaflabs.com/docs.leaflabs.com/index.html
Last edited by RogerClark on Thu May 25, 2017 7:23 am, edited 16 times in total.

User avatar
ddrown
Posts: 125
Joined: Sat Jan 09, 2016 4:49 am

Re: FAQ's and links

Post by ddrown » Tue Jan 26, 2016 3:48 am

Q: How do I get Started?
  1. install the stm32duino support package with Arduino 1.6.5 - https://www.youtube.com/watch?v=TePglhSkghg + https://github.com/rogerclarkmelbourne/Arduino_STM32
  2. figure out how to upload code to your board
    1. Serial - requires a TTL (3.3V) serial adapter - viewtopic.php?f=36&p=295
    2. ST-Link - requires a ST-Link adapter - hook up the SWD lines: GND, Clock (labeled DCLK or SWCLK), and Data (labeled DIO or SWDIO) between your ST-Link and board
    3. STM32duino bootloader - requires you flash your target board with the bootloader first
    4. BMP (Black Magic Probe) - requires a device dedicated to being a Black Magic Probe. Hook up the SWD lines like the ST-Link and optionally the UART for debugging
  3. set the Board and Variant for your target under the Tools menu
  4. set the upload method in the Arduino IDE under Tools > Upload method
  5. set the com port for the Serial or STM32duino methods (it's optional for the BMP method)
Q: Which upload methods have USB serial?

For the STM32F1 boards, SERIAL_USB is defined for the STM32duino and ST-Link methods. This means the "Serial" object is the virtual UART on the USB port, and UART1 is "Serial1" and so on. For the other upload methods, "Serial" is UART1 and "Serial1" is UART2 and so on.

For the STM32F4 boards, "SerialUSB" is the virtual UART on the USB port and "Serial" is UART1 and so on.

User avatar
RogerClark
Posts: 5916
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: FAQ's and links

Post by RogerClark » Tue Jan 26, 2016 5:35 am

Thanks
Last edited by RogerClark on Tue May 03, 2016 9:35 pm, edited 3 times in total.

stevech
Posts: 442
Joined: Thu Aug 27, 2015 6:32 am

Re: FAQ's and links

Post by stevech » Tue Jan 26, 2016 7:18 am

Regarding the below... "Get Started" implies most such persons would not any of the jargon! Bewildered they'd be!
"serial" - what's that? USB? USB serial? DB9 plug serial?
TTL - what's that?
ST-Link -Huh?
Flash your target board - hmm, open my overcoat? Nah. They mean put a flash drive in it. Where?

https://www.youtube.com/watch?v=TGWAkLVhuVI

ddrown wrote:Q: How do I get Started?
  1. install the stm32duino support package with Arduino 1.6.5 - https://www.youtube.com/watch?v=TePglhSkghg + https://github.com/rogerclarkmelbourne/Arduino_STM32
  2. figure out how to upload code to your board
    1. Serial - requires a TTL (3.3V) serial adapter - viewtopic.php?f=36&p=295
    2. ST-Link - requires a ST-Link adapter - hook up the SWD lines: GND, Clock (labeled DCLK or SWCLK), and Data (labeled DIO or SWDIO) between your ST-Link and board
    3. STM32duino bootloader - requires you flash your target board with the bootloader first
    4. BMP (Black Magic Probe) - requires a device dedicated to being a Black Magic Probe. Hook up the SWD lines like the ST-Link and optionally the UART for debugging
  3. set the Board and Variant for your target under the Tools menu
  4. set the upload method in the Arduino IDE under Tools > Upload method
  5. set the com port for the Serial or STM32duino methods (it's optional for the BMP method)
Q: Which upload methods have USB serial?

For the STM32F1 boards, SERIAL_USB is defined for the STM32duino and ST-Link methods. This means the "Serial" object is the virtual UART on the USB port, and UART1 is "Serial1" and so on. For the other upload methods, "Serial" is UART1 and "Serial1" is UART2 and so on.

For the STM32F4 boards, "SerialUSB" is the virtual UART on the USB port and "Serial" is UART1 and so on.

User avatar
ddrown
Posts: 125
Joined: Sat Jan 09, 2016 4:49 am

Re: FAQ's and links

Post by ddrown » Tue Jan 26, 2016 8:13 pm

stevech wrote:Regarding the below... "Get Started" implies most such persons would not any of the jargon! Bewildered they'd be!
"serial" - what's that? USB? USB serial? DB9 plug serial?
TTL - what's that?
ST-Link -Huh?
Flash your target board - hmm, open my overcoat? Nah. They mean put a flash drive in it. Where?

https://www.youtube.com/watch?v=TGWAkLVhuVI
You are correct when you say there's a lot of jargon that will be confusing to people unaware of its meaning. Perhaps you'd like to put together an index of terms and their meanings?

Also, how do I get a dialtone on my stm32? Does it use tone or pulse dialing? ;)

User avatar
RogerClark
Posts: 5916
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: FAQ's and links

Post by RogerClark » Tue Jan 26, 2016 8:35 pm

Perhaps the first Q/A needs to be minimum skill level to have a realistic chance of using an STM32

jaromir
Posts: 28
Joined: Sat Apr 30, 2016 4:50 pm

Re: FAQ's and links

Post by jaromir » Tue May 03, 2016 9:18 pm

I have this suggestion for FAQ - it can happen, it happened more than once and if it happens, solution is not very obvious.

Q: I ran the install_drivers.bat file, but Maple board doesn't create virtual serial port and has yellow exclamation mark in device manager.
A: Connect your board, run the Zadig http://zadig.akeo.ie/downloads/zadig_2.2.exe tool - select Maple in hardware dropdown menu, choose USB CDC driver, install.

I also suggest to delete all other messages except of the first one, containing actual FAQ - to improve signal to noise ratio.

zmemw16
Posts: 1155
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: FAQ's and links

Post by zmemw16 » Tue May 03, 2016 9:50 pm

Main programming reference manual for the STM32F103 series link is a Not Found
using the search on that page with CD00171190 does find it and i tried, but i can't see how to capture the link.
and its still RM0008.

stephen

User avatar
RogerClark
Posts: 5916
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: FAQ's and links

Post by RogerClark » Tue May 03, 2016 10:35 pm

zmemw16 wrote:Main programming reference manual for the STM32F103 series link is a Not Found
using the search on that page with CD00171190 does find it and i tried, but i can't see how to capture the link.
and its still RM0008.

stephen

Arrggghh

Why do people constantly move stuff. I'll find its new location and relink

User avatar
mrburnette
Posts: 1783
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: FAQ's and links

Post by mrburnette » Tue May 03, 2016 11:25 pm

RogerClark wrote:Perhaps the first Q/A needs to be minimum skill level to have a realistic chance of using an STM32

@Roger, et al.

This has come up time and time again and I'm going to repeat myself again: This forum is not setup for newbies as the Arduino.cc forum is configured. We have no dedicated Forum Monitors and no Super cop other than Roger who is already fairly busy earning a living.

I strongly suggest keeping Q/A at a level that is reasonable for advanced computing with uC's since baby-talk just cannot articulate techno-babble adequately; which is to say that flash means flash... one can hypertext to a reference for STM or to Wikipedia, for example. All ofthe platform favors have discriptive post, just not all in one place.

A knowledgable Arduino 8-bit user should be able to get into the swing of things here with a little effort on their part. The site is fully indexed in Google. The new member should be encouraged to have a start with the Maple Mini as this is the baseline device.

The ability to buy into 32-bit computing and the Arduino IDE for the price of a hamburger is disruptive economics! Let us take care that we do not allow this economics to completely disrupt the forum. Newbies without electronics or computing background are best served by 8-bit devices and the Arduino.cc forums. Learned Arduino users can easily migrate here with a bit of self-study when they hit head-room or performance issues in the 8-bit world: to those, a big welcome is extended.

I feel helpful most times, but I have no intentions to tutor a newbie starting at knowledge level zero.


Ray

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest