- Installation
- Creating a new project
- Configuring the ioc
- Adding code
- Debugging
- I2C
- Writing to the SD card
- UART 9.Videos
Additional guides:
Install stm32CubeIDE from here and follow the instructions. This IDE is based on eclipse and is the official IDE for STM32 microcontrollers. It has debugging and ST-Link support built in. It can also generate code for HAL drivers based on the microcontroller you are using.
- Open STM32CubeIDE
- Click on File -> New -> STM32 Project
- Select the microcontroller you are using. For example, MARTHA uses a STM32F103C8T6
- Give a project name, leave the rest of the settings as default and click finish
- Open the .ioc file in the project explorer
- In the IOC editor, you can change clock settings, pin settings, and enable peripherals
- Enable SPI, UART, and I2C2 for MARTHA.
- SPI is used for the SD card, UART is used for printing to the console, and I2C2 is used for the IMU and altimeter.
- Inside of system core | sys, set the debug to serial wire, so we can use the ST-Link's swd pins for debugging.
- Save the ioc file to generate the code for the peripherals you enabled.
- To start messing around, try adding code to the main.c file in the Core/Src folder.
- To debug, click on the debug button in the toolbar.
- The first time you click this, you will be prompted to select a debug configuration.
- Within the configuration window go inside the debugger tab and enable Serial Wire Viewer.
- Click debug, and you should be able to step through code and see the values of variables.
- You can also add breakpoints by double-clicking on the left side of the code editor.
Not explored fully yet
Not explored fully yet
Not explored fully yet
Here are some helpful videos to help you get started:
I think it goes without saying, that you do not have to watch the entirety of these videos, the only one I reccomend watching entirely through is the Programming In C Quick. Ideally you should skim through the longer ones and watch the parts your confused about; but the best way to tackle this is honestly to just start coding and google things as you go and try and make a quick little hello world or command line calculator in C to get a handle on things. Remember practice is the best way to learn so don't spend too long listening to the videos.