CMSIS DSP in STM32CubeIDE - arm

I want to use the DSP functions that are present in CMSIS. I'm using STM32CubeIDE with my target board being the ST32F411RE Discovery. Using CMSIS DSP with Keil uVision is extremely simple, you just select thew pack you want and use it but it's not so simple with STM32CubeIDE. CMSIS is included with the latest firmware pack STM32Cube_FW_F4_V1.24.2 but there doesn't seem to be any option within CubeMX or the IDE to add the DSP libraries (which are present in the firmware pack). The CORE libraries are added by default. I have added the DSP Include and Source folders to my workspace, I have added the include paths to the IDE but when I add
#include "arm_math.h to main.c
I get an error telling me that
fatal error: arm_math.h: No such file or directory and it is directed at each DSP source file.
I've spent the last few days trying to get past this. Has anyone used the CMSIS DSP functions in STM32CubeIDE and if so, how have they managed to set up CMSIS DSP to work with the IDE? Are there any further things that I could try with my setup? I'm surpised that the integrated CubeMX code generator doesn't provide the option to include DSP.
Many thanks

this guy has the answer to your question:
https://www.youtube.com/watch?v=vCcALaGNlyw
ok, you have to spend 15 minutes to watch the video, but it's worth it, as he explains it pretty well.
TL/DW:
download the library from github: https://github.com/ARM-software/CMSIS_5
copy the lib into your project directory
change the linker settings in the project properties to include the file
In Cube-MX click on "software packages" and activate CMSIS and DSP. Then you can select the packages for code generation ...
Requirements: the CMSIS package needs to beinstalled
this can be done by
downloading the package form github
open cubeMX and select "install from local"

Related

Convert an existing code from STM32F0 to Atmel SAMD21 (both are arm-based cortex-M0)

The existing project is running well on STM32F0. The code should be converted to Atmel SAMD21.
The code is written in Visual Studio and using the IntelliSense configuration (ARM Paths). Both projects should use the I2C interface. The package which is used is ChibiOS for STM32.
Because I didn't write the code from scratch, Which part should I change in the code or read carefully? In other words, what is common and different in programming 2 different arms?
Do I need to do my own bootstrap (I mean the initialization part) and linker script? What else is needed?
Also, is there any configuration file for arm definition that I should change?
As I should change chibiOS and add the libraries for Atmel, Which library or package is better to use for Atmel SAMD?
Is there any idea or example that is helpful to compare between these
2 arms?
Much appreciated for any helpful suggestion, in advance.

Where should I get the header files for an STM32 microcontroller?

I have this STM32F3 Discovery board, and I'm trying to flash a simple blink program to it. All of the examples I've found have several stm32*.h header files, such as this for an F4 Discovery board tutorial:
#include "stm32f4xx.h"
#include "fm_stm32f4_led.h"
#include "fm_stm32f4_delay.h"
Where and how do I get the header files for my board? (STM32F3) I can't seem to find anything in the datasheet or documentation to point me at where to get them. Also, what would be a good source for examples and learning material?
Firstly you have a STM32F3 discovery board this means that the stm32f4xx.h header is the wrong one. You'll need the stm32f3xx.h. Also tutorials for a F4 microcontroller will need to be interpreted to be useful for a F3. Some features of a F4 are not present on a F3.
You can download the headers/library for the STM32F3 from ST.com using a ST account. The page you linked to contains a section called Embedded Software which contains a link with the text: STM32CubeF3. Following through the redirections you'll get an opportunity to download the library by clicking: Get Software.
This contains a complete project structure for several boards.
You can also download STM32CubeMX. This "is a graphical tool that allows a very easy configuration of STM32 microcontrollers and microprocessors, as well as the generation of the corresponding initialization C code for the Arm® Cortex®-M core or a partial Linux® Device Tree for Arm® Cortex®-A core), through a step-by-step process." It allows you to generate new projects and lets you easily included required (or all) library files.
fm_stm32f4_led.h and fm_stm32f4_delay.h are header files created by RoanFourie and are meant to target a F4 board. I suppose they are not that useful for you.
I can recommend this tutorial from an ex professor of mine. It is targeted at the F0 microcontroller and uses Keil but the general rules still apply. You'll have to figure the ports and pins out for yourself though.
Like Lee Daniel Crocker mentioned all HAL libraries shipped with the STM32Cube initialization code generator. You can download it here:
https://www.st.com/en/development-tools/stm32cubemx.html
Also you can simple download only the HAL library sources: STM32CubeF3, STM32CubeF4
Moreover the header files fm_stm32f4_led and fm_stm32f4_delay are some custom implementations from your tutorial. The associated code is probably this one:
https://github.com/RoanFourie/STM32F4-DISCO-EMBITZ-Blinky/tree/master/STM32F407Disco/LED
Therefore there is no F3 header/source files for this example.
Anyway it should be easily reused or ported for the F3.

FreeRTOS for PIC32MX120F064H using MPLABX IDE

I want to use FreeRTOS for PIC32MX120F064H using MPLABX IDE. I tried a lot but couldn't find any simple LED blinking project for this specific microcontroller that I am using. I even tried demo projects given by FreeRTOS but they are for specific microcontrollers and doesn't work with my microcontroller. I only need the project structure (meaning what/how files to include) and a simple LED blinking demo. I know from the FreeRTOS site that we have to include task.c, queue.c and list.c as basic files but I tried everything but no luck. Please somebody help me with this.
The FreeRTOS.org site has a page describing how to convert a demo from one device in an MCU family to another device in the same family. Alternatively have the MPLAB Harmony tool create a FreeRTOS project for your chip.

Cross compiling with existing rootfs and external toolchain (buildroot? qemu?)

I am working on an arm embedded platform based on the Cortex A9, very similar to the hummingboard (http://www.solid-run.com/products/hummingboard/).
I am working on porting over some of our software that was previously running on a beaglebone. Our software is python based but uses some ctypes, an internal c library as well as several python modules and a rabbitmq server. On the beaglebone, setting this up was easy because there is a lot of support and ubuntu based distros that make it simple to install packages.
I have a linaro cross compiler and a uboot and rootfs image given to us by the manufacturer of the platform. Manually cross compiling and building all of our necessary dependencies is turning into quite a headache, as everything has little quirks. I do not have a native development toolchain that can run on the arm device.
I am looking for a simpler way to do some of these tasks. Buildroot sounds like exactly what I need, but I am not sure how I would make it work with an already existing rootfs and toolchain. Unfortunately, I don't know all the details of the rootfs and how the hardware is brought up, so I don't think I can replicate the settings exactly using buildroot.
Another option I was looking into was somehow using the rootfs with QEMU and building a native toolchain to run on it, which would allow me to manually build the dependencies without needing to deal with the headaches of cross compiling.
Any help is very much appreciated. Thanks.
Buildroot is designed to generate an entire rootfs, not to "complement" an existing one. So if you were to use Buildroot, you should get rid of the existing root filesystem, and use the new one generated by Buildroot.
Also, note that if you were happy with the Debian distro running on your BeagleBone, you can also run Debian on your Hummingboard.

IAR Embedded Workbench MSP430 and *.lib files linking

I was assuming that it was a really simple task but I did not find anything relevant or my mistake.
So putting my problem here i.e. I have some project for MSP430 which is actually in code composer studio. I have to run this whole code into IAR embedded workbench now. There are some library files(*.lib) that are also provided with the project and that should have to be linked to build the project. After little modifications code is compiling fine but I am unable to link the libraries and getting linker errors. I worked on IAR with avr but very very little just to test some sample codes. I did not find the option where to mention these library names and their respective paths. I checked out the linker tab but I am not getting any clue to link these .lib files with project.
I believe that you are asking
How do I include a function that is in a binary library file supplied by one compiler vendor (Texas Instruments) into a project that is being compiled and built using a toolchain that is supplied by another vendor (IAR)
I would be very surprised if this is possible as the binary formats and calling conventions used by the two toolchains are probably different. The fact that you are getting an error message sayng that the library is not in UBROF format points to this fact. You need to do one of the following:
Compile the source for the old library module using the IAR toolchain (Even if you have the source for this file, it may well contravene the licence that allows you to use the function in your first toolchain)
You will have to find an equivalent function in the IAR toolchain libraries
Write your own clean function that performs the same purpose as the original library routine.

Resources