Extending Freertos Development Environment 11000746

Extending Freertos Development Environment 11000746

Extending FreeRTOS development environment 11000746 Silvestrs Timofejevs University of the West of England Silvestrs Timofejevs 11000746 Acknowledgements I wish to express my sincere gratitude to Craig Duffy, without whose help I would not have achieved as high a standard of work. I would also like to mention the people who have made the most impact on me throughout the time in university: Ian Johnson, o! "illiams, #igel $unton. %inally, I would like to acknowledge the lovely geese family, who have made my nights in university less lonely. 1 | P a g e Silvestrs Timofejevs 11000746 Table of Contents 1. Introduction.................................................................................................4 1.1 Scope of the project................................................................................4 1.2 Hardware Choice....................................................................................5 1.3 Project Planning and strategy.................................................................6 1.4 Project format.........................................................................................6 2. Risk assessment..........................................................................................7 3. Hardware..................................................................................................... 9 3.1 GPIO`s..................................................................................................10 3.2 CIMSIS and the STM Standard Peripheral Library..................................11 3.3 Linker script..........................................................................................14 3.4 Cortex-M3 boot sequence.....................................................................18 3.5 JTAG and CoreSight debug interface.....................................................19 3.6 On-Chip Debugging and In-system programming.................................24 4. Libraries.....................................................................................................28 4.1 NewLib..................................................................................................29 4.2 Reentrancy and thread safety..............................................................30 4.3 Reentrancy in NewLib and integration with FreeRTOS..........................31 4.4 Porting NewLib......................................................................................32 4.5 NewLib printf on a bare metal olimex STM32-P107..............................35 4.6 Hardware initialization..........................................................................35 4.7 Printf relevant system calls...................................................................38 4.8 Main and the interrupt handler.............................................................41 5. FreeRTOS...................................................................................................43 5.1 Documentation.....................................................................................43 5.2 Porting FreeRTOS..................................................................................44 5.3 FreeRTOS interrupts configuration........................................................51 5.4 A simple application running FreeRTOS................................................53 5.5 Debugging............................................................................................53 6. FreeRTOS + IO...........................................................................................55 6.1 FreeRTOS IO structure...........................................................................56 6.2 Porting FreeRTOS IO..............................................................................58 6.3 FreeRTOS IO types, definitions and prototypes.....................................59 6.4 FreeRTOS_open.....................................................................................64 6.5 FreeRTOS_ioctl......................................................................................68 6.6 FreeRTOS_read......................................................................................71 6.7 FreeRTOS_write.....................................................................................72 6.8 Interrupt Service Routines....................................................................75 2 | P a g e Silvestrs Timofejevs 11000746 6.9 Macros and debug................................................................................78 6.10 Integration with NewLib......................................................................78 7. FreeRTOS + CLI..........................................................................................81 7.1 Fundamentals of the FreeRTOS CLI.......................................................82 8. Conclusion.................................................................................................84 8.1 STMCube...............................................................................................85 8.2 Words of praise to FreeRTOS and STMicroelectronics...........................86 8.3 Work assessment..................................................................................86 9. Bibliography...............................................................................................88 Appendix A.................................................................................................... 91 Cortex-M3 exception model........................................................................91 Exception types..........................................................................................92 Nested Vectored Interrupt Controller (NVIC)...............................................93 Appendix B....................................................................................................96 Development tools and environment..........................................................96 GNU tools and utilities................................................................................96 3 | P a g e Silvestrs Timofejevs 11000746 1. Introduction In modern society, computer technology is an ever&growing 'eld, which has expanded exponentially in the last couple decades, and is promising to advance even faster pace. (ome computer systems are used on daily !asis, usually such systems are la!elled ) interactive. Interactive systems imply user interaction: personal computers, gadgets, laptops and many other. * larger group of computer systems is usually hidden from the unaware pu!lic ) em!edded systems. *n em!edded system can !e a part of a !igger system, it often have to comply with certain eal&+ime constrains, and is expected to run continuously without the human interaction. Just as an overview of the si,e of the em!edded market – every year there are more than -.. !illion * / !ased processors sold alone. 0-1 Computer systems are designed to satisfy different re2uirements, involving different types of hardware, an a!ility to run different software. 3ersonal computers are often re2uired to work with graphics or other highly resource consuming tasks. (uch systems must have vast amounts of */, powerful C34 and a graphics card. 5m!edded systems strive for the lowest cost and energy e6ciency, and usually have got many constraints to !e taken into account. Interactive and modern mo!ile systems, usually are powerful enough, and can !ene't from larger 7perating (ystems. (uch 7perating (ystems could !e: "indows, 8inux distri!utions, i7(, *ndroid, etc. Deeply em!edded systems might have */ limited to only several kilo!ytes. 5ven the 8inux kernel, which can !e shrunk to less than a mega!yte of si,e – can !e too heavy for some deeply em!edded systems. +hus, deeply em!edded systems often are only a!le to run a simple scheduler and9or use lightweight li!raries. -.1 (cope of the project 5m!edded systems play a huge role in our daily lives, yet many of us fail to recognise the importance. It is a common approach !y the software developers to use the 8inux kernel in mo!ile and em!edded systems, there are good reasons !ehind it. 8inux is a 4 | P a g e Silvestrs Timofejevs 11000746 free, open source 7perating (ystem, there are num!er of extremely powerful development tools that make the development process so much easier. 4nfortunately, smaller em!edded systems are not always capa!le of running a 8inux !uild. +he idea of this pro:ect is the research of smaller operating systems and set of standard li!raries to !e used within the deeply em!edded computer systems, and explore the possi!ilities of the improvement of the development environment of such systems. +he eal&+ime 7perating (ystem ; +7(< that I have chosen for the pro:ect & %ree +7(, a free and open source +7(. +he source code consists of :ust several C source and header 'les, hence it has a very small memory footprint, and allows it to 't with constrain of even the smallest em!edded systems. It has grown from !eing a simple executive to an almost complete eal&+ime 7perating (ystem. %ree +7( has got a great support, and there are num!er of additional modules provided with the source code. It allows the developer to add or exclude certain components, making the %ree +7( !uild more =exi!le and con'gura!le. %ree +7( lacks certain features common in the !etter known 7perating (ystems, such as memory management, access control, etc. %ree +7( has !een around on the market for some time, however is still a relatively new product, and is in the phase of an active development. 0>1 "orking with

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    109 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us