STM32L4R9I-DISCO Discovery Kit - Review

Table of contents

RoadTest: STM32L4R9I-DISCO Discovery Kit

Author: evekites

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?:

What were the biggest problems encountered?: The display on my unit broke after a few minutes playing around with the touch display. I'm now waiting for a replacement. So I marked only 5 points for "Product Performed to expactations". Hopefully I can alter this mark when the new unit arrives. Also I gave a low mark for "Product was easy to use". Hopefully my contribution can add to this.

Detailed Review:

Please note that I'm roadtesting this unit on a Macbook Pro, so at first I will only explore OSx solutions.

 

This Roadtest is a work in progress.

19-9-2018     First struggle without success.

5-10-2018     Finally I've got LED2 blinking.

To be continued!

 

 

My name is Erik Verberne and I'm a teacher at a college in The Netherlands. I teach Cisco datacommunication, Windows Networking and Arduino (age range: 16-22). My experience with MCU's can be found in my Arduino documentation: http://bit.ly/eve_arduino. This is a link to a 45MB PDF document with 680 pages. Normally when you buy a new sensor, you start searching the web for datasheets, connection diagrams, libraries, samples so you can test the newly bought sensor. This takes a lot of time and a lot of trial on error. With this in mind, I started bundling al this information in one large document. The description is not in dept, it is up to the reader to add his creativity. This document is my contribution for the open source Arduino community.

 

My idea for applying for this roadtest was to create a beginners guide for the STM32L4R9+ Discovery kit and add a section for it in my Arduino Documentation. I've noticed that most manuals start off at a very high level. In this roadtest, I'll try to show the steps I've taken to get me started. I'll try to add more chapters on my way (just like a blog). So this roadtest is going to describe to paths I 've taken to get this unit working. When I've finished, I will write a short beginners manuel.

 

 

19-09-2018

Connecting the kit

  • Connected kit with a micro USB cable to my Macbook Pro (through a USB-C to USB connector).
  • After connecting it I noticed a memory drive called DIS_L4R9AI popping up, with the following two files on it:
    • DETAILS.TXT with information about the version of the firmware.

Version: 0221

Build:  Jun 23 2017 17:43:45

  • MBED.HTM with a link to the MBED development environment.

<!-- mbed Platform Website and Authentication Shortcut -->

<html>

<head>

<meta http-equiv="refresh" content="0; url=http://mbed.org/device/?code=07740221782D66374769F07E"/>

<title>mbed Website Shortcut</title>

</head>

<body></body>

</html>

  • This looks a bit like the way the MICRO:BIT and Adafruit’s Playground Express presents themselves. The MICRO:BIT is presented with a drive called MICROBIT and the Playground Express with a drive called CDPLAYBOOT. If you want to upload some code to these devices, you most copy the compiled hex file to their corresponding memory drives. So, I presume this could also be the way to program the STM32L4R9.
  • As my MCU roots are with Arduino, I started the Arduino IDE and noticed that the kit added a serial port to which you can connect to with some kind of terminal program. The name of this port was /dev/cu.usbmodemFD33 with VID: 0483 and PID:374B. Further examining this USB-serial port, I found out that OSx recognized it as a “STM32 STLink”. I’m not sure yet whether this is just a USB-serial port made by STMicroelectronics or some specialized device.
  • I tried to the USB-Serial connection with Arduino IDE’s Serial Monitor, but after trying all available baud speeds, I only saw some numbers popping up. Note to self: Google this STM32 STlink.

 

Faulty display

  • After examining the connection to my Macbook, I started to play around with the applications that were already installed. I noticed that the touch display wasn’t as responsive as you would expect from a capacitive touch display. I could start some of these applications but with most applications, I came to a point on which the touch display didn’t respond any more.  For example I managed (only once) to record my own voice to an SD card (not included with the kit), but wasn’t able to press the play button to play it back. Later I found the recording on the SD card as “/Record/ Record_2979.wav”. The quality of this wav-file was much higher than I had expected.
  • After a short while I noticed a crack in the display.
  • The display was still working, but after a while, half of the display was distorted.
  • Touching the other half still worked and touching it worked as well (not very responsive).
  • At this point I decided to inform Randall the organizer of this roadtest and we discussed the possibility of replacing the OLED screen itself or to replace the complete discovery board. Although it was very easy to remove the OLED display (it was connected to the board with a special connector), I heard it was not possible to uptain this display separately. So, Randall decided to order me a new discovery kit and at this point I am waiting for it to arrive.
  • Notes about the display. The construction of the display is very fragile. The round display it glued to it’s PCB by a small relatively thick strip of double sided tape. This strip of tape does not cover the entire display, so it is prone to crack when you press it with too much force.
  • In the mean time I decided to take a closer look at the kit and the various ways to enter code in the kit. Although the display is not working anymore, it should be possible to put some code on it. With the display disconnected, the DIS_L4R9AI drive and the /dev/cu.usbmodemFD33 USB-Serial adapter are still available.
  • My first attempt in programming the STM32L4+ kit was through MBED. By opening the MBED.HTM file with a browser I arrived at the ARM MBED website and sice this was my first time, I needed to create a user account, but after logging in with this account, the website told me that the DISCO-L4R9I was not available on MBED. It linked to a description on how to add a new board, but I failed knowledge about the MBED environment.
  • While browsing the MBED website, I noticed that the MICRO:BIT is one of the many supported boards, so I decided to check the MBED programming environment with the MICRO:BIT.
  • So my next step was to explore MBED with a MCU familiar to me and found the needed information at: http://mbed.com/microbit
    • First step was to upload the latest firmware to the MICRO:BIT as was described at: https://www.mbed.com/en/platform/hardware/prototyping-production/daplink/daplink-on-kl26z/#Updating_your_DAPLink_firmware
    • Next step was to return to http://mbed.com/microbit and find the button ADD TO YOUR COMPILER. After clicking on the button, the libraries for the MICROBIT are added to your online compiler at MBED.
    • A first example called MICROBIT-HELLO-WORLD is also available at: http://mbed.com/microbit and by clicking on the IMPORT PROGRAM next to it, you will open the programming environment with this Hello World example loaded.
    • Pressing COMPILE now, gave me an error. This was because the non-existing board DISCO-L4R9I was selected as the target board. After changing this to BBC MICRO:BIT I was able to compile and save a HEX file to the MICRO:BIT drive.
  • With trying MBED with the MICRO:BIT I thought I would get some more knowledge about the MBED environment so when I will find libraries for the DISCO-L4R9I I will be able to add them to MBED. For this moment, as long as I have no libraries for the DISCO-L4R9I, this is a dead end.

 

Software development: MBED (failed)

  • In the mean time I decided to take a closer look at the kit and the various ways to enter code in the kit. Although the display is not working anymore, it should be possible to put some code on it. With the display disconnected, the DIS_L4R9AI drive and the /dev/cu.usbmodemFD33 USB-Serial adapter are still available.
  • My first attempt in programming the STM32L4+ kit was through MBED. By opening the MBED.HTM file with a browser I arrived at the ARM MBED website and sice this was my first time, I needed to create a user account, but after logging in with this account, the website told me that the DISCO-L4R9I was not available on MBED. It linked to a description on how to add a new board, but I failed knowledge about the MBED environment.
  • While browsing the MBED website, I noticed that the MICRO:BIT is one of the many supported boards, so I decided to check the MBED programming environment with the MICRO:BIT.
  • So my next step was to explore MBED with a MCU familiar to me and found the needed information at: http://mbed.com/microbit
    • First step was to upload the latest firmware to the MICRO:BIT as was described at: https://www.mbed.com/en/platform/hardware/prototyping-production/daplink/daplink-on-kl26z/#Updating_your_DAPLink_firmware
    • Next step was to return to http://mbed.com/microbit and find the button ADD TO YOUR COMPILER. After clicking on the button, the libraries for the MICROBIT are added to your online compiler at MBED.
    • A first example called MICROBIT-HELLO-WORLD is also available at: http://mbed.com/microbit and by clicking on the IMPORT PROGRAM next to it, you will open the programming environment with this Hello World example loaded.
    • Pressing COMPILE now, gave me an error. This was because the non-existing board DISCO-L4R9I was selected as the target board. After changing this to BBC MICRO:BIT I was able to compile and save a HEX file to the MICRO:BIT drive.
  • With trying MBED with the MICRO:BIT I thought I would get some more knowledge about the MBED environment so when I will find libraries for the DISCO-L4R9I I will be able to add them to MBED. For this moment, as long as I have no libraries for the DISCO-L4R9I, this is a dead end.

 

 

Software development: STM32CUBE4L (failed for me)

 

 

5-10-2018

Software development: System Workbench for STM32 - Bare Metal Edition (SW4STM32) (hopefull, but failed at OSx High Sierra!!)

  • The next step was to test “Software development: System Workbench for STM32 - Bare Metal Edition” (SW4STM32) from AC6. This is a special (runtime) version of Eclipse with support for STM32 MCU’s.
  • First I had to install Xcode from Apple, you can find this in Apple’s App Store. This takes some time, so be patient.
  • Next I needed to install the STLink driver through brew. STLink is needed to open a debug interface between the SW4STM32 and the Discovery kit:
  • Next step was to register at www.openstm32.org.
  • Lot’s of information about SW4STM32 can be found at: http://www.openstm32.org/HomePage
  • The link for the installer for System Workbench for STM32 can be found at the following page: http://www.openstm32.org/Downloading%2Bthe%2BSystem%2BWorkbench%2Bfor%2BSTM32%2Binstaller
  • The downloaded file is a shell script called: install_sw4stm32_macos_64bits-v2.6.run
  • To run this script, you’ll need to mark it as a executable:
    • Press CMD-SPACE, type terminal and then press ENTER.
    • Go to the folder in which you’ve downloaded install_sw4stm32_macos_64bits-v2.6.run (probably in ~/Downloads)
    • Now type:
      chmod u+x install_sw4stm32_macos_64bits-v2.6.run
  • The installer is now marked executable, so you can execute the installer with the following command:
    ./install_sw4stm32_macos_64bits-v2.6.run
  • Start the software and create and select a folder in which you want to store your projects (workspace).
  • With this environment, I managed to create some code to blink LED2, but SW4STM32 crashed very often.
  • Searching on Google showed that several persons on OSx High Sierra experienced these crashes with “Software development: System Workbench for STM32 - Bare Metal Edition”. Others had better luck with a newer version of Eclipse with the SW4STM32 plugins/tools installed on top of it.

 

Software development: Eclipse with System Workbench for STM32 plugin installed on top (SW4STM32) (Eureka!!!!)

  • To start the installation of Eclipse, I first removed “Software development: System Workbench for STM32 - Bare Metal Edition” and the folder ˜/.ac6.
  • The I downloaded the latest version of “Eclipse IDE for C/C++ Developers” at:
  • I installed Eclipse by opening the downloaded image and ran the installer.
  • To make sure OSx won’t prevent your from installing the SW4STM32 plugin I first had to allow the installation of unsigned software with the following command (don’t forget to undo this):
    • sudo spctl --master-disable
  • I then started Eclipse
  • The following step was to install the SW4STM32 plugin with the following steps:
  • Last step was to enable the check for signed software
    • step sudo spctl --master-enable
  • This environment doesn’t crash all the time, so I finally got the change to figure After watching some Youtube movies I was able to code my first application.

 

First application: Blinky, the equivalent for Hello World

  • WINDOW, SHOW VIEW, C/C++ PROJECT
  • FILE, NEW, C PROJECT
    • Type a project name at: PROJECT NAME
    • Select the toolchain:
      • EXECUTABLE, AC6 STM32 MCU PROJECT, AC6 STM32 MCU GCC
    • Click on NEXT
    • Click on NEXT at the SELECT CONFIGURATIONS dialogue box
    • SERIES: STM32L4PLUS
    • BOARD: STM32L4R9I-DISCO
    • Click on NEXT at the TARGET CONFIGURATION dialogue box (don’t click on FINISH yet!)
    • Select HARDWARE ABSTRACTION LAYER (CUBE HAL)
    • When needed click on DOWNLOAD TARGET FIRMWARE (this takes some time)
    • Click on FINISH
  • Expand your project
  • Expand the SRC folder
  • Double click on MAIN.C
  • Replace the main(void) procedure with the following code lines:
    int main(void)

{

              HAL_Init();

 

              BSP_LED_Init(LED1);

 

              while(1)

              {

                      BSP_LED_Toggle(LED1);

                      HAL_Delay(1000);

              }

}

  • PROJECT, BUILD ALL
  • RUN, DEBUG AS, AC6 STM32 C/C++ APPLICATION
  • RUN, RESUME
  • Et voila, the red LED near the Camera connector is blinking once every second.

 

My road  test is not over yet, but I'm happy with this first success. As soon as I receive the replacement unit with a working LCD display, I will continue this trip.

 

To be continued!

Anonymous
  • Hi Rod,

     

    I managed to progress even further (this weekend). I've bought a very cheap Chinese STM32F030F4P and STM32F103C breakout board.  With these simple boards I got my toolchain up and running. CubeMX, Eclipse with the SW4STM32 plugin and a ST Link V2 adapter. I can now run/debug simple applications. Just yesterday evening I continued on the Disco kit again using the knowledge gained with the cheap Chinese modules. I've even written a step by step on CubeMx and SW4STM32 based on these modules.

     

    I'm not ready yet updating my Disco roadtest, because I got some clock configuration issues. Maybe I'll put them up here later this week.

     

    Bye

     

    Erik

  • Hi Erik,

     

    I respect your perseverance at this roadtest and ability to keep progressing. I think this is the secret for such boards if you have no one to ask....keep chipping away and trying out the different bits until something starts to work. Every time I answered one of my own questions I created another two !

     

    I opted for the SW4STM32 but I'm sure I already had Eclipse installed before getting it added on.

     

    Good luck

     

    Rod

  • Hi Neuromodulator,

     

    As you can see, I've just updated my review. I've succeeded blinking LED2 and can repeat the steps I took to get there. So I've described those steps in my road test including Blinky the equivalent for Hello World.

     

    I've briefly checked on trueStudio on Windows 10, but trueStudio is not available on OSx! And I think this counts for Keil as well.

     

    My road test is not over yet, I'm waiting for my replacement kit (display) and will investigate it further. Off course I will take a look at the videos you've have pointed me to. The results will be added to my review.

     

    Bye

  • Have you given trueStudio a try? You could use Keil for small projects too...

     

    Check this channel: https://www.youtube.com/channel/UCjPRuknkFjqM6UxxTbCQJ5Q/videos
    It has many videos on ST board programming...

    good luck!

  • I really don't know what I am doing, but I am making progress. I managed to get Eclipse and System Workbench for STM32 working and managed to blink LED2 in debug mode. I can repeat these steps, but I'm having problems in creating a correct launch configuration.

     

    At this moment, I am busy writing down the steps involved, but this will take some more time.

     

    Below I've listed a small summary of some of the steps I took to get to this point:

    • Installed System Workbench for STM32 (SW4STM32)
      • Installed the correct Target Firmware (STM32Cube FW L4 V1.13.0)
      • I was able to connect with the STM32L4R9I-DISCO kit through ST-Link, but I wasn't able to launch a piece of code.  SW4STM32 kept saying: "whole bank access must start at beginning of bank".
      • While trying to RUN of DEBUG simple pieces of code, System Workbench crashed all the time. This seams to be a known issue on OSx High Sierra.
    • Started STlinkUpgrade 3.2.12 to update the ST-LINK/V2-1 firmware to firmware V2J32M22. I hoped to get rid of the "whole bank access..." message, but this didn't solve it. I proofed though that the ST-LINK/V2-1 was working correctly.
    • After watching a YouTube movie I tried to install STM32CubeMX, but the installer didn't do anything.
    • At this point I even installed Windows 10 on my MacBook (through bootcamp), so I could investigate some Windows Solution.
      • Installed ST Link Utility (there is no OSx version of this tool) and managed to erase the memory banks
      • Installed System Workbench for STM32 (SWSTM32) and the correct Target Firmware and managed to get LED2 working
      • Installed STM32CubeMX and installed the correct Target Firmware (STM32Cube FW L4 V1.13.0)
        • With STM32CubeMX I created some code, opened it in SW4STM32, but wasn't able to build it.
    • I returned to OSx and finally I found a way to get a piece of code working and blinked LED2.
    • Found a way to get the STMCube32 installer running, but still wasn't able to build the code that was generated with it. SW4STM32 continued crashing very frequently.
    • Remove SW4STM32 and installed a newer version of Eclipse.
    • Added the SW4STM32 software inside Eclipse.
    • At this point I'm having difficulties with launch configurations. I don't understand this subject, but I am sure that I can find information on the web. After some trial on error I can create some code to get the LED2 blinking, but I'm not able to repeat these steps.

     

    Next step will be to find some information about the RUN/DEBUG Launch Configurations. As soon at I get a grasp at this, I will update my road test.

     

    To be continued.

  • Thanks for your helpfull input. At this moment, I'm testing  System Workbench for STM32  from AC6 and it looks promising. I am not yet ready to publish the result.

     

    I will certainly take a look at trueStudio (and offcourse your other suggestions). A very brief search only listed Windows and Linux versions and since I work on Apple based devices I'll first try the OSx route. Later perhaps I'll investigate Windows solutions.

     

    I shall make a note (at the top of my review ) of the fact that I'll only search OSx solutions at first and Windows at a later stage.

     

     

  • ST bought trueStudio and released it for free! Take a look at it!. There are a couple of tutorials and youtube videos on how to use cubemx, they may be a good starting point for you. You can also always check how other roadtesters solved related issues, I'm sure many would gladly answer you any questions you ask them too. And last but not least, you could contact people at ST, eventually they will help you with any questions you have, as they are also interested in that you successfully roadtest their product.