Activate uVision with the free STM32F0/L0/G0 license available in the top right corner of this page. This unlocks the software Flash size limitations and enables you to develop and compile code for most of our standard modules. Steps for activating your license:
Open uVision as administrator.
Click on File >> License Management >> Get LIC via Internet.
Enter the PSN for F0/L0/G0 license from here and fill out the rest of the form.
You will receive an email with your LIC code. Paste it in License Management and click “Add LIC”.
Download device packs required for STM32F0 MCUs through uVision pack installer >> Devices >> Select STMicroelectronics > STM32F0 Series > STM32F091 (or other F0 MCUs) >> On the right side, make sure Keil:STM32F0xx_DFP is up-to-date.
Clone or download the module firmware you are working on. Latest stable release is always on master branch.
GitHub’s firmware repositories can be accessed from module page >> Resources tab.
Note that if you download the firmware as ZIP, submodule folders BOS and Thirdparty will be empty. You need to click on each submodule link on GitHub, download its content as ZIP, then unzip it and copy its content directly inside the submodule folder on your drive.
Sometimes when you clone a repository, your Git tool might not initiate (clone) the submodules on its own. In this case, you will find submodule folders (BOS and Thirdpaty) empty. Just make a double-click on the submodules in your Git tool or update/initiate them, and they will be cloned.
Check out this article for a review of standard module project folders and files. Your application code should be mainly written in main.c file for easy portability to future revisions.
Add your one-time initialization code in the top of UserTask before the endless loop.
Add your recurring code inside the endless loop in UserTask.
Add your project global definition and constants in project.h header file.
Do not write anything in main() function.
Do not write anything after the endless loop in UserTask.
Add your own callbacks and functions anywhere in main.c file before the UserTask.
Add your other .c/.h application files inside User folder for portability. Make sure to add your source files to uVision project structure by right-clicking User folder in Project tree >> Add Existing Files to Group “User”. Your header files will show up automatically once you include them in main.c and compile the project.
If you are using a predefined fixed array topology, design and activate your project topology and create new targets as explained here.
Learn how to program your module firmware via Serial Wire Debug (SWD) pads here. You need to select your programmer/debugger device from uVision Options for Target >> Debug tab (ST-Link, ULINK2, etc.) and adjust its settings if needed.