RoadTest: STM32L4R9I-DISCO Discovery Kit
Author: shwetankv007
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?: STM32F469I-DISCO - Discovery Kit LPCXpresso54608 Development Board, Pre-loaded Draupner Graphic's TouchGFX Software
What were the biggest problems encountered?: For a beginner the getting started with any ARM board is quite a bit hectic due to available IDE options and complex resources. However once the individual gets familiar with the build tools and IDE format, it seems to make sense. However the GUI support is awesome but there are some complexities in getting a full fledged GUI though the setup and hello world of Embedded wizard are really easy but the dev env for STM32 itself needs a bit time and patience.
Detailed Review:
INTRODUCTION
The ARM cortex M4 powered STM32L4R9I-disco board that features ultra-low power functionalities with extended memory capacity giving us 640Kbyte RAM and a 2MB flash for programming. The additional 512MB QSPI flash is another kicker. All of those processing power with other peripheral interfaces including:-
The board is in itself a cool all in one solution for interfacing sensors, communicating with peripherals and giving an AV functionality to any project. I am not experienced with the STMOD+ expansion though, however the Arduino expansion gives the board an edge.
I have worked on the ARM cortex M3 core before using a SAM3X8E Atmel controller and an STM32F blue pill and made some basic interfacing projects using a GCC eclipse IDE on my Ubuntu machine. I was working on a project that can detect the water level of a borewell using acoustic signals the idea was to generate FFT of a reflected sound wave so that I can find the resonating frequency (we will increase the frequency slowly and find adjacent resonant frequencies i.e. the frequency at which we get the maximum sound level) and hence the length of the tube using the mathematical calculations.
I then came across the discovery board with almost all the functionalities that I was looking for, and with the small AMOLED display I had a couple of ideas tinkering in my mind including utilizing the audio jack and the MEMS microphone and the display itself to make a very basic decibel meter that can be further used to make the FFT device.
So we will get to the project part once we get familiar with the board itself and below I have segregated my review in four parts naming:-
THE FIRST VIEW
The kit arrived in a decent bubble wrapped antistatic packaging, everything looked intact and no sign of any break or teardown were present, so somehow the kit survived the long journey.
{gallery} The first view |
---|
IMAGE TITLE: Board features |
IMAGE TITLE: Getting started Guide |
IMAGE TITLE: Unboxed view |
IMAGE TITLE: THEN IMAGE DESCRIPTION |
Quickly I connected the board to power it up and get the demo software started. And yes to take a note, the small pamphlet with the kit gives required information for getting started with the board and few checkpoints before plugging the power to it which requires checking the jumper positions and the switch status on the board. Once we plug in the USB cable the power LED and the COM port LED fires up and the demo software quickly boots up as well.
{gallery} First Boot |
---|
IMAGE TITLE: The first boot |
IMAGE TITLE: Home Screen |
We can see the system information by clicking on the symbol and it jumps to the information page that gives all the details about the Controller, board name, CPU clock (120MHz in our case) and the firmware version as well. Which are sufficient enough to get going however we can get the same from the online guides but the user interface gives more appeal to it.
Moving on we have three separate options to choose from namely the STemWin, Embedded Wizard and the TouchGFX, all the three are more or less a GUI stack that enable easy to implement method for making custom GUIs. Each has their own demo already installed for getting our hands on the board. So I used the embedded wizard for my own development purpose as we will see in the review ahead and searched a bit about the other two and all three were almost similar in terms of features one maybe giving some things better such as the community support or the user manual for making the GUIs, but every platform provides a lot variety of widgets and buttons and tools for getting started to design your own GUI, I guess the STemWin is an STMicroelectronics stack for the same and the other two are the third party platforms for the same in any case all the three gets the job done I guess and provide source codes as well for using them on the IDE of your choice. It was just a personal choice to use the embedded wizard, it features a simple drag and drop environment which we will discuss in the software section.
The Demo software is really intriguing with a lot of small applications including the system diagnostic that gives the current consumption of the system in various modes such as the normal operation mode which turns out to be about 3.15mA (run mode) 970nA (sleep mode) and so on.
{gallery} My Gallery Title |
---|
IMAGE TITLE: Run Mode |
IMAGE TITLE: Sleep Mode |
IMAGE TITLE: Low Power Run Mode |
IMAGE TITLE: Shutdown Mode |
The demo software is really good though it takes some time to know about the working and features such as touch swipes and there is also a bit low sensitivity in the touch screen and it does not detect some touches, anyway the whole software with the applications were very good. Talking about the applications we have the much awaited Chrom-Art accelerated game that resembles the android game flappy bird however some modifications were there, so the game itself when used in using the accelerator works flawlessly and we can also see the CPU load on top of the screen which gets mad once( increases gradually) when we switch the accelerator off. I must admit that the AMOLED display is pretty awesome and gives that extra glow to the UI.
{gallery} Graphics accelerator |
---|
Demo system App |
The demo Game |
Demo Game |
IMAGE TITLE: THEN IMAGE DESCRIPTION |
IMAGE TITLE: THEN IMAGE DESCRIPTION |
LED RGB test |
ELECTRICAL OVERVIEW AND BOARD INVESTIGATION
Moving on and investigating the board schematics, we see the three separate modules for each of the components i.e. the STMOD+ expansion, camera board and the ST-Disco itself.
MB1280 – STMOD expansion
MB1314 – camera module
MB1311 – ST-DISCO
The board design is really good and the components are also laid out very well with the USB and power on separated sides centered with the STML4 microcontroller and other peripherals attached to it throughout the board. Coming back to the schematics, the expansion board is as shown below:-
MB1280
The board has a separate power regulator for a voltage conversion of 3v3 from 5volts input. We have a LDK120 regulator which offers a very low dropout voltage and low quiescent current, I exactly don’t know why we are using a voltage regulator but I guess the MOD expansion is a 3v3 logic and we are getting 5volt from the USB so in order to power it using the USB we are using a regulator. There may be other reason as well.
{gallery} My Gallery Title |
---|
STMOD+ schematics |
Power Regulator |
Bi-directional Regulator |
STMOD+ Pinouts |
Now we also have a level shifter between the 3v3 and 5volt I2C lines that would convert the data lines, I guess this is a bidirectional level shifter so it can be used, from the schematics it seems that the PMOD headers are a
5volt logic so I don’t see the point of the regulator, though I am sure it should be there for some good reason.
So I took a look at the specifications of the MOD expansion and found that some signals are 3v3 and others are 5volt compatible. It offers breakout for one USART, an I2C, an SPI com and few GPIOs as well. As I said I don't have any experience with the STMOD expansion but will surely take a look at them in near future.
MB1314
The schematic of our LED display is as shown, it is very straight forward and just provides a means to connect the wires to motherboard i.e. the STM32-disco board, power supply for the same. We have two connectors for connecting the data lines and other I/Os for touch panel and the display separately.
We can see the two differential signals for data and clock of the display panel and an I2C signal for connecting the touch panel to the motherboard.
The input supply is first filtered using the ferrite beads on both the power rails and ground. The overall circuit is also pretty well laid however the display itself is held to the board using a double sided tape only.
{gallery} My Gallery Title |
---|
LCD schematics |
IMAGE TITLE: THEN IMAGE DESCRIPTION |
IMAGE TITLE: THEN IMAGE DESCRIPTION |
MB1311 Motherboard
The overall circuit has been divided into different sections depending upon their respective peripheral interfaces in the gallery below:-
{tabbedtable} Tab Label | Tab Content |
---|---|
MB1311- The Motherboard | Coming towards the motherboard which has a bunch of its little tricks and features including the all common microcontroller peripherals such as the SPI, I2C etc and the OTG port, SD card interfaced for ready to use, ZIF 8-bit camera port and breakout for other expansions including the Arduino breakout support for shields, the best part of the board is that it comes with an on board ST-LINK/V2-1 that enable USB debugging and programming without any additional need of hardware. Lets examine the board schematics in detail. The first page of the board schematics opens up a block representation of the whole board with list of interfaces connected to the STM32L4R9IA controller some of them are the LCD, Audio and the camera interfaces etc.
.
Now we will examine each and every section separately to get a closer look at the motherboard and understand its operation better. Moreover I can't stop myself to dig deep into the circuit schematics and get to know about the circuit where all the magic happens. |
The power Supply | Now we have the schematics for power supply which is essentially divided into two sections where one section deals in selecting the input supply mode and other helps in generating supply for the logic level, so while taking a closer look at the schematics we get a clear idea of the initial jumpers that we connected before firing up the board. Here we have the jumper JP4 which is a 5*2H header and we connected the ST-LINK 5volt i.e. the USB 5volts to the power LED via a TVS diode which helps in protection against the voltage spikes. Then we have an LD1117S50TR which is a low drop adjustable voltage regulator that outputs 5volts to the board from the Arduino Vin connection that can be supplied from the shield pinout. The above described schematic deals with the 5volts logic level, now we need to shift the voltage level to a lower 3v3 or 1v8 which is done using a TPS62743 that is an adjustable buck convertor that gives output ranging from 1.2volts to 3.3volts depending on the inputs to the select lines. It has three select inputs namely VSEL1, VSEL2 and VSEL3. Two such convertors are used to generate a 3v3 and another 1v8 output which is controller using a single jumper JP7. So currently we are using the 3v3 side of the output for the discovery board. |
Arduino Uno shield connectors | As discussed earlier the board provides expansion for the Arduino V3 connectors i.e. female headers are given for connecting the various Arduino shields available, the pinouts can be found on the STM website or can be deduced from the schematic itself. We have 16digital GPIOs and 6 analogue pins. Also note that some of the Arduino IOs are shared with other functions, below is the table that gives a detail about it. Addition of the arduino footprint headers opens a lot of possibilities for further expansions including addition of a communication mode such as a wireless shield that can elevate the utilization of disco to IoT and connected things. Further sensor integrations would also be really easily done by simply connecting the shields. I believe since the discovery board is a small motherboard with a display, storage and audio ports we can add on a lot of sensors to use this as a node for our projects really efficiently. I was also planning to add some smart features to my motorbike that can help me detect the vehiccle status and the small round display combined with a communication mode and some sensors is what I think really useful for that. |
ST-LINK/V2-1 | Now one of the feature of this particular board that I like is the on-board debugger that eliminates the use of any separate hardware for programming and debugging, as far as the schematic is concerned the heart of the circuit is an STM32F10xx that deals with the communication between the differential USB port to the serial wire debug of the STM32L4R9I. The schematics suggests that a 90ohm matching is done for the USB signals and a two data line ESD protection has also been applied to it i.e. USBLC6-2SC6.
ST-LINK USB: the differential pair from the USB input is carried to the STM32F for further processing
ST-Link controller STM32F1
The SMD switch
There is an SMD 4 pole switch present, and I guess it is there to disconnect the overall circuit from the debugger in case anyone wants to use an external JTAG or the serial wire debugger. More interestingly I found the serial wire headers on the board and hopefully switching of the debugger we can use them to debug other STM boards as well, so basically this can act as our own ST-Link debugger for other controllers as well. I am sure that would be possible but still need to focus on the current board first. |
IDD Measurement | The design requires two pairs of op-amps for the current measurement part, and an STM32L152 as a multifunction expander that acts as a slave controller of some sort which I guess is an I2C slave with a fixed device address that can be accessed from the main controller, though I still need to look at this part in detail but as far as I can understand it supports up to 16GPIOs and some other features such as the IDD measurement and the touchscreen controller, so it is quite interesting to see how the motherboard is segregated with multiple controllers for different purpose including the STM32F1 for the ST-Link debugger part and the STM32L152 for the multifunction expander. So I saw that the MFX-wake, MFX-SWDIO and other lines are not connected to the central STM32L4 controller however the I2C connection is present, so there is a good possibility that the expander circuit is working as a parallel to serial controller to accommodate multiple features and then communicate with the central controller. I still need to see the working in more detail and probably will try to work on this portion separately, possibly finding a way to communicate with the peripheral( if I can call it that) over the I2C. |
OCTOSPI | This is an STM powered and backed interface for extended data throughput over the serial communication medium, this is used where we want to reduce the parallel communication pin count and 8 data lines are used to do so. As described on the sheets “The OctoSPI interface enables the connection of the external compact-footprint Octal-SPI and the HyperBus high-speed volatile and non-volatile memories available today in the market. Thanks to its low-pin count, the OctoSPI interface allows easier PCB designs and lower costs. Its high throughput allows code execution and data storage.” So basically it means that you have more serial lines that share the same control signals, or put differently, a serial port with more than one data line. Now in the schematics we can see that there are two different chips of SPI flash, the MX25LM51245GXDI00 and the MT35XL512ABA1G12-0SIT both of them are however to signify multi input output serial Flash memorio ries es with a memory space of 512Mbits. |
Peripherals including the onboard LEDs and the joystick | So we have small number of peripherals attached to the board including the cool and fancy joystick and the SD card. Apart from the above two we also have a couple of onboard LEDs, an external I2C connector and a much needed reset switch for a hard reset during any system operation. I guess the schematic are pretty much self-explanatory since they use basic discrete components. One thing that I really like about ST boards including the current discovery board is the use of high quality ESD protection and EMI filters wherever necessary to give the board more stability in the long run and better immunity from any spurious voltage difference. The EMIF06-MSD02N16 used between the controller and SD card connections is a highly integrated device designed to suppress EMI/RFI noise for interface line filtering. It is packaged in micro QFN. Similarly, as we have seen earlier all the major components included some sort of ESD protection while be it using a dedicated IC for this purpose or using TVS diodes to maintain everything under ESD regulations. After all the designers at STMicroelectronics understand the beauty of the hardware. |
USB_OTG | The board also features a ready to use on-the-go(OTG) port, the schematic is fairly simple with minimal possible components and all the ESD protections, I guess I should stop talking about the ESD and protections for this board atleast since ST has doen a really good job here. So the micro USB port is provided with differential signal balancing and resistance matching, further the signal is carried to the inputs of our little beast the STM32L4R9I. I honestly don’t have any experience with interfacing and working with USB devices using the hardware libraries, some basic knowledge about the COM port interactions using a software platform is what I can look forward to. However, this one feature is surely that I would like to explore more in future projects that can use USB communication. |
LCD & Camera Connector | To start with the schematic diagram of LCD connectors features a separate block for power unit of the same and outputs three different power signals i.e. 5volt, 3.3volts and 1.8volts for various operations in the DSI pic connector. These are nothing but series MOSFETs whose gate is connected to an enable signal and as soon as the enable is received the power is fed to the pins of the connector. Then we have high speed SMD LCD connectors QSH-030-01-F-D-A-K-TR that connects the DSI lanes, SPI and I2C connections for communicating with the controller. Similarly, the 30pin camera ZIF connector is also populated on the board that connects all the required power, DCMI and I2C pins to the attached module. The camera interface supported by our STM32 is an 8-bit interface however from the ST sheets it states that “Depending on the extended data mode chosen by configuring the EDM bits in the DCMI_CR register, the DCMI receives 8, 10, 12 or 14 bits per pixel clock (DCMI_PIXCLK). The user needs to configure 11, 13, 15 or 17 GPIOs for the DCMI in case of hardware synchronization.” |
PSRAM | PSRAM or psuedostatic RAM is a low power family of memory devices which provides features for both SRAM and FLASH, this is basically a cheap solution to SRAM per se that has an internal structure of a dynamic memory with refresh control signals generated internally in order to operate it as an SRAM. Our little board here uses it in synchronous and asynchronous mode depending upon the selection from the bridges. Here we have a 32Mbit IS66WVC2M16ECLL-7010BLI, it has option for two different power rails including 3v3 and 1v8 for suitable interface with the controller. The chip supports both synchronous and asynchronous operations with an operating frequency upto 133MHz. More interestingly it has another chip description in the schematics IS66WV1M16EBLL-55BLI that is a 16Mbits PSRAM with similar features as that of the earlier one. Though on the board it shows a single chip with the chip name U5U6. I don’t know exactly what is the case here, though the discovery board specification also tells about a 16Mbit asynchronous PSRAM. |
Audio CODEC | Another one of the important features that the board provides is an audio codec with an analog microphone input and stereo headphone amplifiers that can power 46mW to a 16Ohm speaker at 1.8volts. It is a 24-bit convertor with 4-96Khz sample rate that can produce fairly decent sound with giving due respect to the file size so created. A 24-bit resolution is really good for any audio recording system. The chip CS42L51-CNZ requires very less discrete components to get the whole thing working. Talking from the STM32 peripheral documentation SAI ( Serial audio Interface) can be programmed in three different modes:- The free protocol modes allows it to support standards such as the I2S, PCM etc and due to its flexibility it is possible to customize the serial interface if needed. The SPDIF protocol mode allows it to transmit audio samples using the IEC60958 standard. The AC97 protocol is also supported. All the signals from codec chip are fed to the microcontroller using the serial wire protocol and thus can be used using the peripheral drivers. HAL and BSP features a lot of functions for the purpose. |
SOFTWARE SETUP AND GETTING STARTED
So now we have a clear understanding of how all the peripherals have been bundled up in the small discovery board and pretty much all of the necessary information we need about the hardware in order to proceed, however I guess that much info was not required.
In order to getting things started with the little beast we have here, a lot of project ideas come to your mind when we see the enormous memory size and processing capabilities and the peripherals attached to it, all of which can be done while putting the system to life i.e. adding some software/firmware magic to it.
Before we proceed in this section I want to take some time and explain what really goes on when you are trying to get things done on the ARM based controllers and you don’t have any prior background in the same. For a newbie like me who had experience in programming the Atmel AVR family controllers and the good old 8051 it was a confusing and frustrating journey at the very start to getting started with ARM based controllers. So I started doing my work on STM32 controllers about a half year back and as usual I thought it would be easy or atleast similar to working with the AVR controllers i.e. I would install an IDE, write a code and bingo compile and upload it BUT It never goes as expected so here are some things that I learnt during me trying to get going with the STM32 controllers as a noob:-
GUI & Software Setup
Now once we are done with the basic stuff we can proceed with the STM32L4 discovery board which further extends the processing power, complex problem solving capabilities and hence more complex software setup and development, well not exactly since we have a lot of tools including the STM32CUBEMX that can be used to ease out our initial steps. The most interesting of which are
All three of which are essentially tools that can be used to build really good GUI for our 1.2’ AMOLED display. Now I didn’t used all the three but I really liked the Embedded wizard software however it comes with a lot of examples that can be readily used just to get to know the environment.
{gallery} My Gallery Title |
---|
Embedded wizard homepage |
Embedded wizard board selection: In order to choose the board that we are building our GUI for we need to choose the STM32L4R9 discovery |
Embedded Wizard IDE environment with all the windows. |
The application window with a basic message template. |
Build environment console to upload code to the board |
Hello world example |
Using some widgets. |
In order to install the Embedded wizard software one can download the free version right from the official website, the site gives detailed steps in order to get the installation done, Embedded wizard also provide a well documented getting started guide where one can simply follow some examples and get going, it features a separate tutorial section as well where things like the software environment and all abotu the programming level details are shared. For somebody who is interested in the internals of the GUI can dig deeper.
https://doc.embedded-wizard.de/getting-started-stm32l4r9-discovery?v=9.00
So once installed when we fire up the software it shows a basic home screen with a welcome dialogue and the toolbar. In order to getting started with working with the tool and our board we need to follow the basic steps:-
Above steps will get us to our first project creation where we can basically just drag and drop components, build the project and get the board to load the files using the build environment console.
So there are other examples and templets as well that we can check which will help us in understanding the environment better, I tried all the examples myself and all of them worked fine once uploaded to the board. I really like the peripheral interaction example where we can use display buttons to control the on-board LED and joystick hold time is seen on the screen. It was really interactive.
SW4STM: ECLIPSE
With getting my hands on the embedded wizard platform for GUI development and trying to get myself a GUI for the project I was stuck in the intricacies of understanding the development environment and getting the source code for Keil.
Moreover, I had to switch back to using the Eclipse with SW4STM which is an open source IDE for the development and ditch the keil tool since it provides only a support upto 32Kbyte for the free version.
Steps to get started with the SW4STM can be found online and there is a limited but good material on how to set-up your own environment over eclipse by adding ARM toolchains to it.
For further process I installed the SW4STM on the eclipse and created the first baremetal code for the board that blinks the onboard LED using the HAL libraries. In order to create the project follow the below guide:-
File> New C project
Project_name <add_name>
Executable > AC6 STM32 MCU Project > AC6 STM32 MCU GCC now click next
Click next on the configuration window as well
Series > STM32L4PLUS
BOARD > STM32L4R9I-DISCO
Click next and choose the cube HAL checkbox
FINISH
Following the above steps we can build a project for STM32L4R9I-disco board. However we can also use the STM32Cube for getting a basic template and all the initialization files preinstalled in the project to get through the hectic work of adding multiple libraries.
Also I added the BSP example which was in the STM32L4_cube projects examples and uploaded the same to the board, I will further make changes to the existing project to see what goes around with the board, and hopefully get the project started.
CONCLUSION
Though I wanted to use the board on my existing projects and use the MEMS microphone and SAI codec to build an audio frequency detector that can be used in my borewell project to find the depth of water level. I have been working on the principle of sound reflection and resonance to get a standing wave pattern in the borewell and hence find the depth by getting the maximum frequency. The idea was to leverage the huge processing power of the board and on-board peripherals to get the task done, however I just barely managed to get started and understand the working. Though I am confident about the hardware side of the board but a lot of is to be done towards getting the firmware for my project.
The board however seems to be really promising with really good board design built considering all the protections and possible issues. I really found the STMOD+ port interesting and would love to use it and interface the expansions. There are a lot of GUI support on this board and the small AMOLED makes it really appealing towards number of projects. Though in my opinion the learning process can be a bit steep for beginners. The abstraction of third party GUI softwares is really good however, I feel the support and documentation need to be more simple and a video tutorial can be an addon to the same.
Overall the board is really good and performance was way ahead of what I expected, with the low power mode it consumes practically no power or little of the same. I am not sure about the support but the documentations and materials are really descriptive though it takes time for a newbie to get going.
Top Comments
Thank yo so much for the appreciations, and yes I have been working with the STM32F1 for some time now and I admit that it was really difficult at start but things got balanced as the things got familiar…
Having also undertaken this roadtest I found your review really interesting and, like I too found, you seem to have also found the 'STM32 mountain' rather steep. One day I hope I will find a really simple…
I look forward to those, appreciating we are usually all busy on other projects as well
Rod