This page describes how to create a new C project manually.
The InES Pack also offers standardised example projects for C and Assembly.

First create a new directory either locally, when you're using your own Laptop or on the “U:\” drive, when you're working on a ZHAW computer and name it according to the project (e.g. lab1).

Inside this directory create the following two directories:

appThis is for the applications source code
buildThis is for the artifacts and binaries from the build process

Start Keil uVision and create a new project “Project → new uVision Project”.
Give the file a name according to the project and save it to the previously created project-directory (lab1).

After expanding the “STMicroeletronics” section, choose the device for which you want to create a new project.

CT Board HS14 M0This device uses the Cortex-M0 instruction set
CT Board HS14 M4This device has full access to the Cortex-M4 instruction set
If unclear choose CT Board HS14 M0 for the CT Board.




If not already popped up, click the green button “Manage Run-TimeEnvironment” to open the below shown view.
Expand the “Device” group and select the “Startup” component. Now click on the “Resolve” button.




Make sure that the CT Board is connected to the host computer!

By default the project is configured to use the Keil uLink debugger. The CT Board uses the onboard ST-Link debugger.

Change the configuration to “ST-Link Debugger” under “Project → Options for Target, Target 1” in the “Debug” tab.
Then click Settings right next to it.




Make sure the port is set to SW (Serial Wire) instead of JTAG.




Also check the “Flash Download” tab and make sure the “STM32F4xx 2MB Flash” algorithm is visible in the “Programming Algorithm” section.
Otherwise add the algorithm with the add button.




Go back to “Options for Target, Target1” and select the “Output” tab.
Click “Select Folder for Objects…” and choose (double-click) the build folder from your created directory (lab1) as your output folder.

Then go to the “Listing” tab.
Click “Select Folder for Listings…” and choose again (double-click) the build folder from your created directory (lab1) as your listing folder.

Now open your project directory in your explorer and you will find the two self generated folders, Listings and Objects.
Delete them.



During the linking process Keil gives a warning:
warning: L6314W: No section matches pattern *(InRoor$$Sections).

To disable this warning add the following parameter to the linker arguments under
“Project → Options for Target, Target 1” in the “Linker” tab:
--diag_suppress 6314




To create a new file expand the folder “Target 1”, right-click on the folder “Source Group 1” and then choose “Add New Item to Group…”.
If you want to add an existing file, choose “Add Existing Files to Group…”.




Choose the corresponding file type, name and location.



TypeChoose either “C File (.c)” or “Header File (.h)“
NameChoose an appropriate name
LocationChoose correct location (.\app)





Back to Getting Started

  • software/keil/c_project.txt
  • Last modified: 2020/02/07 16:21
  • by akdi