FreeRTOS for PIC32MX120F064H using MPLABX IDE - c

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.

Related

PIC16 microcontroller_ no output even after following tutorial

I am using PICKIT 4, PIC16F18446 microcontroller, and MPLAB X IDE. I am following an instruction provided from Microchip, Measuring frequency
Update:
I am not entirely sure what i needs to change but I am consistently getting an output of Frequency: 25536 whether there is an input signal or not. (Image of the output, and pin configuration shown below)
The Original Poster is using a PIC18 tutorial for a PIC16F target.
The MPLABX Code Configurator (MCC) tool is an awful thing for anyone new to the Microchip development tools to use.
An MPLABX project that does what I think this tutorial is about for the PIC16F18446 target is here in my git hub repository.
MCC was used to create most of this code so you should be able to see how it was done.
This code runs in the MPLABX simulator but that is a buggy hot mess. Use it with caution.

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.

Can you open and edit .c files in the Arduino IDE? And subsequently load them to an Arduino board

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

CMSIS DSP in STM32CubeIDE

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"

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.

Resources