File Exchange

image thumbnail

Embedded Coder Support Package for STMicroelectronics Discovery Boards

Generate code optimized for Discovery boards

150 Downloads

Updated 17 Oct 2018

Editor's Note:

This support package is currently unable to download third-party software for MATLAB R2017a and earlier versions. For details and workaround, see this Bug Report.

MATLAB R2017b and later versions are unaffected.

Embedded Coder® Support Package for STMicroelectronics® Discovery Boards provides support to Embedded Coder that includes automated build and execution, processor-optimized code for ARM® Cortex®-M, the ability to perform processor-in-the-loop (PIL) tests with execution profiling, block libraries for on-chip and on-board peripherals, and deployment support using a built-in scheduler.

This support package is functional for R2013b and beyond.

If you have download or installation issues, please contact Technical Support: www.mathworks.com/contact_ts

Comments and Ratings (83)

hey I got this error, need a solution.

### Generating code into build folder: C:\Users\thanu\Documents\MATLAB\stm32f4discovery_gettingstarted_ert_rtw
### Invoking Target Language Compiler on stm32f4discovery_gettingstarted.rtw
### Using System Target File: C:\Program Files\MATLAB\R2017b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file stm32f4discovery_gettingstarted_types.h
### Writing header file stm32f4discovery_gettingstarted.h
### Writing header file rtwtypes.h
### Writing source file stm32f4discovery_gettingstarted.c
### Writing header file stm32f4discovery_gettingstarted_private.h
### Writing source file stm32f4discovery_gettingstarted_data.c
.
### Writing header file rtmodel.h
### Writing source file ert_main.c
### TLC code generation complete.
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: GNU Tools for ARM Embedded Processors v5.2 | gmake (64-bit Windows)
### Creating 'C:\Users\thanu\Documents\MATLAB\stm32f4discovery_gettingstarted_ert_rtw\stm32f4discovery_gettingstarted.mk' ...
### Building 'stm32f4discovery_gettingstarted': "C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -f stm32f4discovery_gettingstarted.mk all
### Build procedure for model: 'stm32f4discovery_gettingstarted' aborted due to an error.
Error Report: Command "matlabshared.toolchain.gnu_gcc_arm.setup();" threw an error: The path 'bin' does not exist.
Caused by:
Validation error(s):
Command "matlabshared.toolchain.gnu_gcc_arm.setup();" threw an error: The path 'bin' does not exist.

Omar Maaroof

I downloaded on R2018a. Thanks

rizqi uhuy

stuck the progress download when downloading mbed library. Installation on matlab r2015a.

Multiplexer

So, the STM32F4 support consist only of... 6 blocks? Even arduino has more. Could use basic communication I2C, SPI, Serial etc.

Chethan C U

Installation failed in R2018a. With and without the fix.
Error :Failed to download Mbed library.
Request to fix the issue at earliest. Or Point out if there is something missing in my installation steps.

I can't download help please........

ming xie

I can't download the hardware package. why?

R2018a is out!
Here are some of the updates in 18a:
- XCP based external mode on STM32F769I-Discovery and STM32F746G-Discovery Boards which enables streaming to Simulink Data Inspector (SDI) and Dashboard blocks.
- Audio Input and Audio Output blocks for STM32F769I-Discovery board
For more information see the release notes: https://www.mathworks.com/help/releases/R2018a/supportpkg/stmicroelectronicsstm32f4discovery/release-notes.html

Bui Tuan

cc1.exe: fatal error: stm32f4xx.h: No such file or directory compilation terminated? (MATLAB R2016a)
This issue happens when i run simulation in external mode with STM32F4 Discovery Board. Do you have any solutions for this issue? Thank you.

T K

T K (view profile)

Any one please help me how to use PWM, SPI, and other blocks for stm32f4 discovery board. Because in this support package am not able to find out these blocks.

murat

murat (view profile)

Problem1 : "cmsis.instrset" path not found

Method: Download gnu arm embedded toolchain on arm download pages[1] and unzip to folder. After copy all files to "C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\gnuarm-armcortex.instrset"(if not exist create new one). With this package, your gnu arm toolchain ready to build your simulink model.

Problem2 : gnuarm-armcortex.instrset path not found
Method: Download arm cmsis software[2] to your matlab supportpackages folder "C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\cmsis.instrset" if not exist create it. Copy all downloaded files and unztp to that folder.

[1] https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
[2] https://github.com/ARM-software/CMSIS/tree/v4.4.0

Björn Baas

doesnt seem to be compatible with MacOS High Sierre or Matlab R2016b

I am facing this problem when trying to run the simple mode on SSTM32F4 DISCOVERY KIT using STM32F429
The following error occurred during deployment to your hardware board:
Error while writing the executable to the STM32F4 flash. OpenOCD returned the following diagnostic message:

Error while trying to establish USB communication with the STM32F4-Discovery board. Please reset the USB communication:
1. Disconnect the USB cable from the board.
2. Wait for three seconds.
3. Connect the USB cable again.
For more information look into logfile generated by openOCD: mw_openocd_log.txt.

Is it possible to install this package on Linux? I am using Matlab r2017b on Ubuntu 16.04.
Thanks.

Dominic Hink

I'm trying to establish a SPI communication with a STM32F407G-Discovery Board, but there are no SPI blocks available in Simulink Library Browser for STM32F4-Discovery Boards. Is there any way to do this with my board? Thanks for your help!
Regards
Dom

Sukru:

Using 2017a version, the OpenOCD download link is avaliable.

new address is freddiechopin.info however i don't know how to say the installer this.

i can not install the package. error www.freddiechopin.pl unavailable

Antonin

Antonin (view profile)

R2017b is out!
In addition to the support for STM32F769I-Discovery that I mentioned below here are the new features that you can find in R2017b:
- SD Card logging. You can now log signals on the SD card present on your STM32F746G-Discovery board.
- TCP/IP blocks that you can use on STM32F746G-Discovery and STM32F769I-Discovery.
- External mode over TCP/IP (supporting DHCP and static IP addressing modes)
- The new support for the STM32F769I-Discovery board comes with GPIO, UDP, TCP/IP, SCI, SPI, I2C, PWM, ADC, serial and TCP/IP External mode, PIL, etc. Stay tuned for 4-channel audio support on this board...
- Our installation benefits from new setup screens that sill make the experience better.
Enjoy!
Antonin.

Antonin

Antonin (view profile)

Bonjour monsieur Evrard,

From the log you sent, it seems like you are trying to target a NUCLEO-F446RE board with our support for the STM32F4Discovery board (http://www.st.com/en/evaluation-tools/stm32f4discovery.html).
Unfortunately these are not compatible, that's the reason why the download fails.
Here is the list of ST Discovery boards supported by this package:
- STM32F4Discovery (http://www.st.com/en/evaluation-tools/stm32f4discovery.html)
- STM32F746G-Discovery (http://www.st.com/en/evaluation-tools/32f746gdiscovery.html)
- STM32F769I-Discovery (New in R2017b!) (http://www.st.com/en/evaluation-tools/32f769idiscovery.html)
For ST Nucleo support, check out the Simulink Coder Support Package for STMicroelectronics Nucleo Boards:
https://www.mathworks.com/matlabcentral/fileexchange/58942-simulink-coder-support-package-for-stmicroelectronics-nucleo-boards
I'm afraid F446 is not part of the list of supported NUCLEO boards in that package but you may get luckier with compatibility as the difference with other NUCLEO boards may be minimal. On the list of NUCLEO boards supported, we have F031K6, F103RB, F302R8, F401RE, F411RE, F746ZG, F767ZI (new in R2017b!), L053R8, L476RG.
I hope it helps,
Good luck!

Antonin.

Hello, I'm try using a Nucleo64 with STM32F446 but after the compilation I have this error :
The following error occurred during deployment to your hardware board:
Error while writing the executable to the STM32F4 flash. OpenOCD returned the following diagnostic message:

Error while trying to establish USB communication with the STM32F4-Discovery board. Please reset the USB communication:
1. Disconnect the USB cable from the board.
2. Wait for three seconds.
3. Connect the USB cable again.
For more information look into logfile generated by openOCD: mw_openocd_log.txt.

the content of mw_openocd_log.txt :

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.9.0-00073-gdd34716-dirty (2015-05-19-09:55)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 473
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked

The board work fine with ST-LINK ...

Any help?

Regards

yichao he

United State

If error occurred (R2017a version), you may try:

1. Make sure you had setup for package as required.
Add-On Explorer -> Manage Add-Ons -> Find STM package and click on Setup.

2. Check if packet installation folder (\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset) has the 2 following folders "cmsis.instrset" and "gnuarm-armcortex.instrset".
* If not, unpack from package install files (\Downloads\MathWorks\SupportPackages\R2017a\archives\3p):
** Unzip *.zip file in "gnuarm-armcortex.instrset_win64_xxxx" folder into "gnuarm-armcortex.instrset" folder (create new in installation folder).
** Unzip *.zip file in "cmsis.instrset_common_xxxx" folder into "cmsis.instrset" folder (create new in installation folder).

ToniG31

Hi. I have a stm32f411 discovery board. When I load the "getting started" program (blinking LED) it doesn't work (not blinking). I don't know why. If someone can help me I will be grateful. Thanks.

bjk

bjk (view profile)

I would also like a UART block.

Chris

Chris (view profile)

Hi, currently there are no USART or UART blocks available. Is support planned for these?

bjk

bjk (view profile)

Hello Sandeep
Thank you for your answer. I have resolved the problem by a workaround. I unmask the UDP-Block in the library.

But I have still a other question.
Why have the UDP-receive-block a diffrent second output as in other support packages. In the support package for the K64F or also in the Realtime-UDP-block of the Simulink realtime there is the number of data bytes in the received message as second output. Thats allow to receive messages with different lenght.

In this support package is the second output the status without concret information about the number of received bytes. Does this have a technical background?
Regards
bjk

Hello bjk
I am sorry that was a bug from our side, this has been corrected now. The latest version of the support package shall be available for download shortly (in a day or 2) for MATLAB R2017a. Please use that version.
Regards
Sandeep

" Timed out waiting for an event at the socket"
is the error I am getting when I try to perform PIL testing for my model using stm32f4 discovery board.
does any one knows how to fix this?

Dear Govind Malaghan ,
I had the same problem, I turned my firewall off and deleted some proxy settings files from my PC and then downloaded the library and it worked.

bjk

bjk (view profile)

I have the support package installed (Matlab 2017a), but I have a problem with the UDP blocks in Simulink.
I can not edit any of the parameters of the blocks (IP address, ports, data size, etc.).
When I open the block parameter panel, all fields are grayed out.
What could be the problem?

Error: "download error:freddiechopin.pl"

Hi Soner, this support package doesn't support the generation of a2l fine and CCP.

Please, I have problem with downloading the package of the STM32 F4 . After downloading some components a window pop ups telling there is a connection problem or the proxy is not configured.
Could you help me please

It is somehow possible to use this package with HAL libraries rather than the standard peripheral library?

SONER OZDEMIR

Hello,
Does this package supports .a2l file generation and CCP(Can Calibration Protocol) support?
Thank you

Hosam

Hosam (view profile)

Hello together,

I use Matlab-R2014a with Hardware Support Packages for STM32F4 Discovery Board. I'm not able to download program to STM32F4 Discovery Board using OpenOCD and simulink. I got the following error-message:

### Launching openOCD server C:\MATLAB\SupportPackages\R2014a\openocd-0.6.1/bin/openocd-0.6.1.exe -f board/stm32f4discovery.cfg: Following error captured during invoking of openOCD server:

Open On-Chip Debugger 0.6.1 (2012-10-07-10:34) Licensed under GNU GPL v2 For bug reports, read <http://openocd.sourceforge.net/doc/doxygen/bugs.html> adapter speed: 1000 kHz srst_only separate srst_nogate srst_open_drain Info : clock speed 1000 kHz Error: open failed in procedure 'transport' in procedure 'init'

"### Done invoking postbuild tool." ### Successful completion of build procedure for model: stm32f4discovery_led4

I installed the driver for ST-Link and ST-Link V2. I can download the program to the board using ST-Link Ultility.

Could someone please help me? Thank you in advance!

Helmuth

Hi,

first of all: thanks for this support package.

I use STM32F4 Discovery board. When I try to run in SIL mode, I get this error message:

C:/PROGRA~1/MATLAB/R2014a/sys/lcc64/lcc64/bin/lcclib64 /out: ../../../../../slprj/ert/_sharedutils/sil/hostobj/rtwshared.lib ../../../../../slprj/ert/_sharedutils/sil/hostobj\const_params.obj ../../../../../slprj/ert/_sharedutils/sil/hostobj\look1_iflf_binlc.obj
Fatal error: can't open file for writing.
gmake: *** [../../../../../slprj/ert/_sharedutils/sil/hostobj/rtwshared.lib] Error -1

Any idea what is wrong? It seems that rtwshared.lib can not be found or is not created. How can I fix this?

Best regards,
Helmuth

Jim Jamoses

Bart's Solution works! Thank You!

KHALED

KHALED (view profile)

Please, I couldn't download nor install the STM32F4 support package. Can anyone send me the downloaded packages?

Bart

Bart (view profile)

When trying to install this package, i got the error that a swst-dtm32068.zip was invalid. This persisted aftre downloading it several times, and installing it in different ways.(straight from the web or dnload first)

After some researching i discovered that the zip file IS in fact a htm file with the zip extension given to it, wrongly. This zip extensioned htm file is supposed to be present in an actual zip called swst-stm32068.

SOLUTION for other users:
I changed the zip's extension to .htm and placed it in a new zip named swst-stm32068, and now the installation succeeded. A weird mistake from mathworks, but guys please fix this for other users.

KHALED

KHALED (view profile)

Hello,
Please, I have problem with downloading the package of the STM32 F4 and the beaglebone_black as well. After downloading some components a window pop ups telling there is a connection problem or the proxy is not configured.

Could you help me please
thanks

Christian

As a Response to my Problem I received an answer from the EMEA-Team at Mathworks.

The Problem might be on my side, regarding my Connection. Maybe related to my security-software or a Proxy configuration. (Based on my experience it's most likely my Kaspersky ... again, especialy since I usually don't use Proxy connections).

The EMEA Support, was so nice to configure a simple SFTP Login for me, so I coukd securely download a copy of the Installation-files for an standalone installation.

So if any of you might have similar issues, the Mathworks Support will probably know an easy andquick answer to your solution.

Again thanky towards the support-Team, a great help!

Christian

Unfortunately I still receive the same error as "Hamed Hmd" before me.

Has there been an update to adress this problem, as stated by "Mathworks Embedded Coder Team"?

Image: https://abload.de/img/zwischenablage01aqsgt.jpg

The 3rd party tools related STM32F4-Discovery support package are changed and corresponding checksum is failing. So, the installation is failing.
We have updated the check for 3rd party tools and should soon get published which will enable installing of STM32F4-Discovery support package.

khelil

khelil (view profile)

Hello dear
I'm tiring to use simulink with STM32F4-Discovery Board.
So I started with some tutorials and examples and I build 'stm32f4discovery_led4' example project.
Out of my expectation, it occurs error and I couldn't find the solution
here are the build messages.
### Generating code into build folder: C:\Users\khelil\Documents\MATLAB\stm32f4discovery_led4_ert_rtw
### Invoking Target Language Compiler on stm32f4discovery_led4.rtw
### Using System Target File: C:\Program Files\MATLAB\R2014a\rtw\c\ert\ert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code ...........

TLC Compiler encountered an OUT_OF_MEMORY condition. Attempting to clean up... Error: File: C:\Program Files\MATLAB\R2014a\rtw\c\tlc\mw\formatwide.tlc Line: 37 Column: 2 The %function directive on this line has no matching %endfunction directive Main program: ==> [00] C:\Program Files\MATLAB\R2014a\rtw\c\tlc\mw\formatwide.tlc:<NONE>(230) Error: File: C:\Program Files\MATLAB\R2014a\rtw\c\tlc\mw\formatwide.tlc Line: 18 Column: 1 The %if directive on this line has no matching %endif directive Main program: ==> [00] C:\Program Files\MATLAB\R2014a\rtw\c\tlc\mw\formatwide.tlc:<NONE>(230)

### Build procedure for model: 'stm32f4discovery_led4' aborted due to an error.

Fatal error in slbuild
Component: Simulink | Category: Model error

thank you for your help
best regards

Hi,
The Embedded Coder Support Package for STM32F4-Discovery Board support 'STM32F4-Discovery' board with STM32F407VG processors.
The STM32F429i-Disco board doesn't work with the support package.

Adriano

abdel ghany

Dear all,

in STlink mode or serial mode, I have a "timeout" problem:

### Preparing to start PIL block simulation: stm32f4discovery_pil_block/Controller1 ...
### Connectivity configuration for "C:\Users\dell\Downloads\Controller_ert_rtw": STM32F4-Discovery (ST-LINK) ###
### Starting application: Controller_ert_rtw\pil\Controller.elf
### Started new OpenOCD process with PID 8008.
### Terminated OpenOCD process with PID 8008.

Error in 'stm32f4discovery_pil_block/Controller1/Controller_sfcn' while executing C MEX S-function 'Controller_pbs', (mdlStart), at time 0.0.

Timed out waiting for an event on the socket.

Is the STM32F429i compatible avec the proposed embbeded software or note?

thank you for your help.

abdel ghany

Dear all,

I have problem with PIL.

### Preparing to start PIL block simulation: stm32f4discovery_pil_block/Controller1 ...
### Connectivity configuration for "C:\Users\dell\Downloads\Controller_ert_rtw": STM32F4-Discovery (Serial) ###
### Starting application: Controller_ert_rtw\pil\Controller.elf
### Started new OpenOCD process with PID 11088.
### Terminated OpenOCD process with PID 11088.

The timeout of 10 seconds for receiving data from the rtiostream interface has been exceeded. There might be multiple reasons for this failure.
You should:

(a) Check that the target hardware configuration is correct, for example, check that the byte ordering is correct.
(b) Confirm that the target is running.
(c) Consider the possibility of application run-time failures (e.g. divide by zero exceptions, incorrect custom code integration, etc.).

If you cannot find a solution, consider using the method setTimeoutRecvSecs of rtw.connectivity.RtIOStreamHostCommunicator to increase the timeout value.
Component: Simulink | Category: Model error

I use STM32F429i with openOCD (0.9.0) renamed 0.6.1 to be used by the embbeded developed coder.

I on't know if the problem is just a programming time who exeeds 10s or if it's an uncompatibility between soft and board.

Hi, I am getting following error while building:
In file included from C:/MATLAB/SupportPackages/R2015a/armcortexm/toolbox/target/supportpackages/arm_cortex_m/cmsis_rtos_rtx/src/cmsis_rtos_init.c:8:0:
C:/MATLAB/SupportPackages/R2015a/armcortexm/toolbox/target/supportpackages/arm_cortex_m/cmsis_rtos_rtx/include/mw_cmsis_rtos.h:6:22: fatal error: cmsis_os.h: No such file or directory
#include "cmsis_os.h"
^
compilation terminated.
gmake: *** [cmsis_rtos_init.o] Error 1

C:\Users\Shail\Documents\MATLAB\stm32f4discovery_gettingstarted_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2

C:\Users\Shail\Documents\MATLAB\stm32f4discovery_gettingstarted_ert_rtw>An_error_occurred_during_the_call_to_make
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.

Is because I am using the latest version of CMSIS(4.5) and the recommended version is CMSIS -4.2 ? How do I solve this?

Hi Team,

I'm using the STM32F429IDiscovery board I followed all the step including Support package installation and everything, while trying to test the Push Button Led example into Simulink's library it show that the model has been compiled and successfully loaded into the Board but nothing happens, is there any specific Support Package for the STM32F429 ? if yes how to get it?
It's urgent! Thanks.

senthils2k

i run the example Pgm audio equaliser
i got the error below

how can i solve that?
IC:/MATLAB/SupportPackages/R2015a/stmicroelectronicsstm32f4discovery/toolbox/target/supportpackages/stm32f4discovery/@slCustomizer/../include -IC:/MATLAB/SupportPackages/R2015a/armcortexm/toolbox/target/supportpackages/arm_cortex_m/cmsis_rtos_rtx/include -IC:/MATLAB/SupportPackages/R2015a/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery -IE:/WIN81/CMSIS-SP-00300-r4p3-00rel0/CMSIS_RTX/INC -IE:/WIN81/CMSIS-SP-00300-r4p3-00rel0/CMSIS_RTX/SRC -o "SysTickScheduler.o" "C:/MATLAB/SupportPackages/R2015a/armcortexm/toolbox/target/supportpackages/arm_cortex_m/scheduler/src/SysTickScheduler.c"
arm-none-eabi-gcc -std=c99 -MD -ffunction-sections -fdata-sections -Wall -c -O0 -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -include stm32f4xx.h -DMW_MIC_SAMPLING_FREQ_IN_KHZ=44 -DMW_MIC_FRAME_LENGTH=882 -DMW_MIC_IN_BLOCK_AVAILABLE=1 -DMW_ENABLE_CLOCK_TO_I2S=1 -DMW_I2S_CLOCK_PLLN=271 -DMW_I2S_CLOCK_PLLR=2 -DMW_SPEAKER_FRAME_LENGTH=882 -DMW_AUDIO_OUT_BLOCK_AVAILABLE=1 -DMW_SPEAKER_NUMBER_OF_CHANNELS=1 -DMODEL=stm32f4discovery_parametric_equalizer -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DUSE_STDPERIPH_DRIVER -DUSE_STM32F4_DISCOVERY -DSTM32F4XX -DARM_MATH_CM4=1 -D__FPU_PRESENT=1 -D__FPU_USED=1 -DHSE_VALUE=8000000 -DNULL=0 -D__START=_start -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DOS_ROBIN=0 -DOS_TIMERS=1 -DOS_TIMERPRIO=6 -DOS_TIMERSTKSZ=200 -DRT -DSTACK_SIZE=64 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DUSE_STDPERIPH_DRIVER -DUSE_STM32F4_DISCOVERY -DSTM32F4XX -DARM_MATH_CM4=1 -D__FPU_PRESENT=1 -D__FPU_USED=1 -DHSE_VALUE=8000000 -DNULL=0 -D__START=_start -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DOS_ROBIN=0 -DOS_TIMERS=1 -DOS_TIMERPRIO=6 -DOS_TIMERSTKSZ=200 -DRT -DSTACK_SIZE=64 -DMODEL=stm32f4discovery_parametric_equalizer -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/senthil/stm32f4discovery_parametric_equalizer_ert_rtw -IC:/Users/senthil -IC:/MATLAB/SupportPackages/R2015a/stmicroelectronicsstm32f4discovery/toolbox/target/supportpackages/stm32f4discovery/stm32f4discoveryexamples -IE:/WIN81/PROGRA~2/MATLAB/MATLAB~1/R2015a/extern/include -IE:/WIN81/PROGRA~2/MATLAB/MATLAB~1/R2015a/simulink/include -IE:/WIN81/PROGRA~2/MATLAB/MATLAB~1/R2015a/rtw/c/src -IE:/WIN81/PROGRA~2/MATLAB/MATLAB~1/R2015a/rtw/c/src/ext_mode/common -IE:/WIN81/PROGRA~2/MATLAB/MATLAB~1/R2015a/rtw/c/ert -IE:/WIN81/PROGRA~2/MATLAB/MATLAB~1/R2015a/rtw/c/src/ext_mode/serial -IC:/MATLAB/SupportPackages/R2015a/armcortexm/toolbox/target/supportpackages/arm_cortex_m/scheduler/include -IC:/MATLAB/SupportPackages/R2015a/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/ST/STM32F4xx/Include -IE:/WIN81/CMSIS-SP-00300-r4p3-00rel0/CMSIS/Include -IC:/MATLAB/SupportPackages/R2015a/STM32F4-Discovery_FW_V1.1.0/Project/Peripheral_Examples/SysTick -IC:/MATLAB/SupportPackages/R2015a/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32F4xx_StdPeriph_Driver/inc -IC:/MATLAB/SupportPackages/R2015a/stmicroelectronicsstm32f4discovery/toolbox/target/supportpackages/stm32f4discovery/@slCustomizer/../include -IC:/MATLAB/SupportPackages/R2015a/armcortexm/toolbox/target/supportpackages/arm_cortex_m/cmsis_rtos_rtx/include -IC:/MATLAB/SupportPackages/R2015a/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery -IE:/WIN81/CMSIS-SP-00300-r4p3-00rel0/CMSIS_RTX/INC -IE:/WIN81/CMSIS-SP-00300-r4p3-00rel0/CMSIS_RTX/SRC -o "arm_cortex_m_multitasking.o" "C:/Users/senthil/stm32f4discovery_parametric_equalizer_ert_rtw/arm_cortex_m_multitasking.c"
gmake: *** No rule to make target `E:/WIN81/CMSIS-SP-00300-r4p3-00rel0/CMSIS_RTX/LIB/GCC/libRTX_CM4.a', needed by `../stm32f4discovery_parametric_equalizer.elf'. Stop.

C:\Users\senthil\stm32f4discovery_parametric_equalizer_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2

C:\Users\senthil\stm32f4discovery_parametric_equalizer_ert_rtw>An_error_occurred_during_the_call_to_make
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.

Samir, The Embedded Coder Support Package for STMicroelectronics STM32F4-Discovery Board is available from 2013b. So you cannot get the installation in 2012b.

Samir

Samir (view profile)

Hello,

i can not open the installer. I´m using MATLAB 2012b in my computer. How should I install it?

Thanks for your help.

Hi Cao,
Did you try to install the HW support package from the download button present on the top right corner of this page?

cao vu

cao vu (view profile)

i don't install support package Help me

Thank you! I send e-mail with my model.

We are not referring to any such libraries in the build process. I am not sure, how this is getting added to the build information of the model. Can you please send your model and the generated code to support@mathworks.in for further investigation.

Yes, I ran this command and downloaded CMSIS 3.20 (like on screen-shot in help). The registration process is OK. But I see still:

gmake: *** No rule to make target `F:/MATLAB/SupportPackages/R2014a/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Lib/GCC.lib'

What is the library file (GCC.lib) in make? CMSIS doens't content it.

Please run the following command to open help for CMSIS registration process:

helpview(fullfile(matlabroot, 'help\ecoder\ug\install-support-for-arm-cortex-m-processors_btx8_db-2.html'))

Kindly let me know your feedback.

Raghavendra Kandur, I have got MATLAB 2014a and don't find 'Examples and How to' section and link 'Install Support for ARM Cortex-M Processors'. In late June I will install MATLAB 2015a with all latest support packages. I hope everything will be well.

Thank you!

Viacheslav Klimentyev, Sorry for the delayed response. The CMSIS package available in STM32F4-Discovery firmware doesn't contain the required library for STM32F4-Discovery support package. Please follow the steps following steps to download and register CMSIS.

1. Run the command 'arm_cortex_m_examples' in MATLAB command window. This opens help for ARM Cortex-M support package.
2. Click on the link 'Install Support for ARM Cortex-M Processors' under 'Examples and How to' section of the page.
3. Follow the steps to download and register CMSIS.
Please let me if you are having any problems.

Raghavendra Kandur, thanks for your answer.
I updated CMSIS to v. 3.01 and registered it. But now I have next errors and warnings:

1. gmake: *** No rule to make target `F:/MATLAB/SupportPackages/R2014a/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Lib/GCC.lib', needed by `buildobj'. Stop.
The make command returned an error of 2
"An_error_occurred_during_the_call_to_make"

I think, should be: LIBS = F:/MATLAB/SupportPackages/R2014a/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a
as in make for LED example. When I changed this string (choose read-only file property to eleminate overwrite string), I had error:
File I/O error on file 'C:\Users\Slava\Documents\MATLAB\Controller_ert_rtw\Controller.mk'
Operation that caused an error: open

2. Also I have this warning:
[Warning: The following error was caught while executing 'onCleanup' class destructor:
Invalid or deleted object.]
### Build procedure for model: 'Controller' aborted due to an error.

Viacheslav Klimentyev, it seems you have not completed the support package installation completely. If you have already installed STM32F4-Discovery support package then follow below steps to complete the installation:
1. In MATLAB command window, run 'targetupdater' command
2. Select 'STMicroelectronics STM32F4-Discovery' in drop-down in popped up GUI
3. Follow the instructions in GUI to download and install CMSIS
4. After successful registration of CMSIS, the error you are reporting should resolve.

Now I am trying to start PIL simulation, but i have this error:

Error evaluating 'InitFcn' callback of S-Function block (mask) 'stm32f4discovery_pil_block/Controller1/Controller_sfcn'.

An error occurred while calling into the SIL or PIL target connectivity implementation.

Path "$(CMSIS)\CMSIS\Lib\GCC\libarm_cortexM4lf_math.a" specified in the application framework BuildInfo is not an absolute path. To avoid this error, specify only absolute paths when adding files and paths to the application framework BuildInfo.

How can I solve this problem?

Raghavendra Kandur, thanks! It works!
Yes, after writing a message, I looked the log file and saw that board is not supported (error device ID). I downloaded openocd-0.9.0 and renamed folder and cfg. files, but I did not think to rename .exe.
Thanks again!

The openocd-0.6.1 doesn't support stm32f429I-Disco board. For reference, you can open 'mw_openocd_log.txt' file inside <model_name>_ert_rtw folder where openOCD logged a warning saying the stm32f4 board is not detected.

To overcome this issue, you can download newer version of openOCD and follow the below stesps:

1. download openocd from http://www.freddiechopin.info/en/download/category/4-openocd?download=109%3Aopenocd-0.8.0/openocd-0.8.0.7z
2. Unzip the download openocd using 7-zip.
3. Rename the folder unzipped folder to openocd-0.6.1
4. Search for openocd-0.8.0.exe in above folder and rename it to openocd-0.6.1.exe
5. Take a copy of the 'F:\MATLAB\SupportPackages\R2014a\openocd-0.6.1'
5. Replace 'F:\MATLAB\SupportPackages\R2014a\openocd-0.6.1' folder with the newly renamed folder and should work.

Please note, The Embedded Coder Support Package for STM32F4-Discovery Board supports only STM32F4-Discovery (STM32F407VG processor) board. There could be incompatibilities with peripheral blocks with STM32F429I-DISCO (STM32F429ZI processor) board. Please use the support package at your own risk.

MathWorks Embedded Coder Team, thanks for your answer! I installed these products and work with them.
Addition: STM32F429-Discovery can work with Embedded Coder without STM32-MAT/TARGET. I generate .hex from Simulink and Embedded Coder and load it into my device by STM32 ST-LINK. But now I want to work with PIL. I'm trying to load the program using Simulink (call openOCD).

Log from Simulink (after compiling and generating .hex):
### Launching openOCD server F:\MATLAB\SupportPackages\R2014a\openocd-0.6.1/bin/openocd-0.6.1.exe -f board/stm32f4discovery.cfg: Success
### Open telnet port for communction with openOCD server.
### Reset and halt the processor.
### Erase flash sectors.
### Download the executable ../stm32f4discovery_led.hex: Success
### Reset and run the board.
### Close the server.
"### Done invoking postbuild tool."
### Successful completion of build procedure for model: stm32f4discovery_led

Program on microcontoller doesn't work. I am connecting to STM by ST-LINK, reading memory and seeing empty memory.
Win7 64bit, Matlab 2014a 64 bit.

Very easy way to get set up and running on hardware. I was able to install the TSP quickly and get the demos up and running in no time.

Currently, only STM32F4-Discovery board is supported by MathWorks. MathWorks consulting services can be employed for customizations.

However, additional STM32 device support from Simulink and Embedded Coder is available with the STM32-MAT/TARGET by STMicroelectronics.

STM32-MAT/Target uses a flexible approach for supporting devices using an abstraction layer (HAL) output from their STM32CubeMX software.

For more information please see here:
http://www.st.com/web/en/catalog/tools/PF258513

I have STM32F429-Discovery with CPU Clock = 180 MHz. Do I understand correctly that I can't choose CPU Clock = 168 MHz in Coder Target? Can my board work with Matlab?

Antonin

Antonin (view profile)

R2015a is out, check out the CMSIS-RTOS RTX support for the STM32F4-Discovery board.

Nkosingiphile

Attila

Attila (view profile)

Yuhang

Yuhang (view profile)

Murat Belge

Evgeniy: The STM32F4-Discovery board is only supported for R2013b or later.

Do you have target for R2013b release only?

MATLAB Release Compatibility
Created with R2013b
Compatible with R2013b to R2018b
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor