![]() ![]() If our aim is to create a marketable product based on embedded systems we need to pay attention to resource usage. In general pre-processor switches are very important because they allow removing entire sub-module from our binary when we do not need them. These switches are related to HAL drivers and are often called Driver Switches. #if !defined(HAL_USE_PWM) || defined(_DOXYGEN_) #if !defined(HAL_USE_SERIAL) || defined(_DOXYGEN_) ![]() For example, what follows are two switches: the first one is enabled and includes all the code related to Serial Driver, the second one is disabled and excludes all the code related to PWM Driver. A switch is just a boolean constant definition which includes/excludes a piece of code from the compilation process. From here and out, we will often talk about pre-processor switches. Working with embedded systems,it is extremely usual to deal with textual configuration headers. To re-configure a project, we usually have to edit these files, save them and recompile the entire project. All the configurations are actually pre-processor directives (a series of constant definitions and macros). Configuration headersĮach project comes with some configuration headers. It is actually an XML file contained in the debug folder. The Launch Configuration contains some information about the flash and run procedure required from the debugger. launch file represents the Launch Configuration. We already have used this file before: do you remember the steps required by flash and run? Just after the start-up of OpenOCD, we have to select the Launch Configuration from the Debug Menu. It is specifically related to our project because it contains a. The debug folder instead is a real folder. If you broke ChibiOS accidentally editing its code you can always restore it downloading the latest relase from Sourceforge and manually replacing the broken folder with the new one taking care to preserve the folder name and its hierarchy. ![]() Anyway, it contains the ChibiOS’s sources: if we edit this code we can potentially break the code and, thus, every project linked to this folder. The os folder is linked to the folder C:\ChibiStudio\chibios182\os. In our case, it links to ChibiOS191 because, during the previous article ( Developing on STM32: introducing ChibiStudio), we have imported demos from this release. Let’s make an example to clarify this concept. It is not a good idea to edit the linked folders and their content because changes will affect all the demos. These folders are usually shared between different demos and projects. This means that editing a file within these folders we will affect more than a project. You can notice they are because there is a small arrow on their icons in the bottom right corner. Some of the folders contained in our project are actually links. Additional notes about the demo are usually reported in a “read me” file which is actually a plain text file ( readme.txt). In general, all the ChibiOS’ projects are characterized by similar anatomy.Īll demos have some folders, some configuration headers, a source file named main.c and a makefile. For example, in figure, we can see the resources of the default demo for STM32 Nucleo F401RE. ChibiOS projects’ anatomy The anatomy of ChibiOS demoĪ ChibiOS’ default demo is usually composed of some different folders and files. We will also see how to create a new project and how to modify it in in order to create our own applications. In this article, we are going to take a deep look to ChibiOS default demos explaining how they work. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |