Keil is an IDE. It doesn't have any fixed folder structure.
Huh? In my experience, it is usually the IDE that has some sort of concept of a "project" that DOES impose a folder structure.
A folder structure that is frustratingly inconsistent between different IDEs :-( (That's OK. Big, popular, non-embedded software projects have inconsistent folder structures as well! Sigh,)
However, there are some things that tend to be common:
- Separation of the built "object" files and the user source code. Sometimes, the generated files are further divided - intermediate files and final "Product" files, "debug" vs "production" builds, different configurations, etc.
- Separation of the user source code from vendor-provided source code. Well; usually. In the case of ARM, you have user code, ARM code, chip-vendor code, and compiler-vendor (ie Keil) code. They can be distributed across the folder structure in various ways.
- Special files that describe the "project configuration."
- Some care is usually taken to the "version control" of the various components. Either carefully versioned vendor files (Keil uses "packs", and has a "pack manager"), or sometimes copying all of the vendor files into the project folder structure ("Atmel Start")
In general, the IDE will manage the directory structure for you, and all you have to do is use the appropriate "add file" command, which will create the file in the appropriate spot AND tell the IDE that it is part of the project.
I dusted off my Keil install, which I used for a class once (and never had to actually create new projects), and created a trivial SAMC21 project. After the "new project" dialog (being sure to create a new directory for the project - some IDEs will do that by default), which includes chip selection, and picking various intermediate-level code (in this case "redirect stdout"), I just "added C file" main.c, and did a build, and got this:
C:\Users\billw\Documents\KeilProject1>tree /f
C:.
│ keilproject.uvoptx
│ keilproject.uvprojx
│ main.c
│
├───Listings
│ keilproject.map
│ startup_samc21.lst
│
├───Objects
│ keilproject.axf
│ keilproject.build_log.htm
│ keilproject.htm
│ keilproject.lnp
│ keilproject_Target 1.dep
│ main.crf
│ main.d
│ main.o
│ retarget_io.crf
│ retarget_io.d
│ retarget_io.o
│ startup_samc21.d
│ startup_samc21.o
│ system_samc21.crf
│ system_samc21.d
│ system_samc21.o
│
└───RTE
├───Device
│ └───ATSAMC21G18A
│ startup_SAMC21.s
│ system_samc21.c
│
└───_Target_1
RTE_Components.h
main.c is up there in the top-level directory where it'll be obvious, along with te project description files. Then there's a separate directory for Listings (human consumable output), and one for Objects (machine consumable output.)
startup... and system... are down in a "Run Time Envionment diretory"