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.
Related
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.
I have been trying to open c files in the Arduino IDE (which some people claim is possible).
I have not been able to do so.
How can I program the Arduino in c given that I have a project/files in another IDE? (for example, MPLABX)
I am not sure what you are trying to archive. Is it that you want to open it via the Arduino IDE or also compile the source code?
I am not aware of programming in bare c in the Arduino IDE. But if you're looking into using real c code, it might be a good time start either compiling and uploading via terminal yourself, or use an IDE which is suited for development with micro controllers.
I think you can tell the Arduino IDE to more elaborately log outputs. This would tell you exactly the commands the IDE is using (uses avrdude). Then you can use an IDE/Editor of your choice for coding.
Otherwise, have a look at eg. Atmel Studio. They also support Arduino.
There are two answers in one:
If you really want to use the ArduinoIDE you have to have a basic *.ino file having at least the defines and includes which are in the project file and the reqiured setup() loop() usually whats in main in c goes to loop() in ArduinoIDE. Thats the stoney path because there are some specific issues coming from the philosophy behind ArduinoIDE (help makers with little (no?) programming skills to get started quickly).
If you just need the Arduino tool-chain and want to work more comfortable you have two other options:
EclipseIDE with the Sloeber add-on. Download the Sloeber-AllInOne-Package for an easy start and THEN add the other modules you need (like for web development or similar)
PlatformIO an IDE for micro controller development - there is also a cloud based version for testing around.
All mentioned tools are real open source and available cross PC platform and not a gift from a company like MS for probably later lockin of devs
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"
I am Embedded Developer (fresher) by profession. I have written firmware (in C and C++) for ARM Cortex-M, PIC, Atmel 8-bit controller. I am aware of the source code management and that's why I used to have Board Specific, Compiler Specific information in different C header files.
I have written firmware for custom boards which had same microcontroller (PIC24F) but their on-board peripherals, debug interface, LEDs, buttons and other stuff keeps on changing across various versions of the boards. So, I used to have a BSP folder which contains header files for each of the board and a top level header file which includes a specific header file based on macros (one macro for each board). Then, a config header files define one macro to enable all the required peripherals, configuration for one specific board.
The BSP header files looks like this:
And the final board specific header file looks like this:
Now, I am working on yocto project and device tree. I am wondering how BSP actually looks like in yocto project and embedded linux. Is it just device tree which contains board specific, SoC specific and may be Core specific information? Or There is something more to it?
I know this question could be considered as TOO BOARD but what I am looking for is a brief overview of the BSP structure in Yocto Project or Embedded Linux. Pointers to specific directors or online links will be really helpful to get started. I have tried google few times but didn't find a concise picture of it. Please help.
Sorry for what is likely a simple question -- still getting a handle on Linux.
I've been attempting to install the 'FreeMODBUS' library, however judging from the website, it is somewhat outdated. The download link leads to nowhere, however the source code is still accessible via Sourceforge as a .zip download. In the past I've only dealt with libraries that come via .tar, however the bigger issue is that there seems to be no config, makefile nor README detailing the installation process.
Additionally I tried including all of the source code and header files supplied within my Eclipse project. I was hoping that this would be the lazy man's solution to all of my problems -- or at the very least I could compile the .so file myself -- however I'm still getting 'undefined reference to [Function]' errors. From what I understand this is a linking issue. To the best of my knowledge all inclusions are correctly set up.
Is this library deprecated, or is there a step to the process that I'm overlooking? Thanks!
Some superfluous project information:
I'm using modbus for a C project. The network is ideally going to be setup so that a number of modbus enabled devices are configured on a single daisy chained RS-485 hub -- therein containing all our modbus communications to a single comm port in a rather complex system.
The problem however is that popular open source modbus library, 'libmodbus', doesn't appear to lend itself to this configuration. In order to instantiate a modbus node instance, it requires the comm port to be passed, as opposed to the unit's modbus id.