This guide will walk you through the steps to set up a new solution in Keil Studio within Visual Studio Code (VS Code), select your target board, include necessary software components, and compile and run your code.
- Visual Studio Code (VS Code): Download and install from here.
- Keil Studio Extension: Install the Keil Studio extension from the VS Code Marketplace.
- Connected Target Board: Ensure your ARM target board is connected to your computer.
- Open VS Code.
- Navigate to the Keil Studio extension.
- Create a new solution.
- The extension should automatically detect your connected target board. Verify that the correct board is selected.
- Set the appropriate target type for your project.
- Within your new solution, navigate to the software components section.
- Select and include all necessary software components required for your project.
From Lab Module 3 onwards, we will be using an RTOS (Real-Time Operating System). Therefore, it is essential to include the following RTOS libraries and edit the configuration file accordingly.
- Navigate to the software components section within your solution.
- Add the following RTOS libraries to your project:
- CMSIS-RTOS2 (API v2.1.0)
- RTX (RTOS Kernel v5)
- After including the RTOS libraries, open the configuration file located in your project directory.
- Modify the configuration settings as shown below:
To add the tunes.h
file to your source files, follow these steps:
- Open your project in your development environment.
- Locate the section where you manage your source files.
- Add the following file to your source files:
tunes.h
- Once all components are included, save your solution.
- Click on the build/compile button to compile your code.
- After a successful build, run the code on your target board.