Embedded Software Development: The Open-Source Approach delivers a practical introduction to embedded software development, with a focus on open-source components. This programmer-centric book is written in a way that enables even novice practitioners to grasp the development process as a whole. Incorporating real code fragments and explicit, real-world open-source operating system references (in particular, FreeRTOS) throughout, the text: Defines the role and purpose of embedded systems, describing their internal structure and interfacing with software development tools Examines the inner workings of the GNU compiler collection (GCC)-based software development system or, in other words, toolchain Presents software execution models that can be adopted profitably to model and express concurrency Addresses the basic nomenclature, models, and concepts related to task-based scheduling algorithms Shows how an open-source protocol stack can be integrated in an embedded system and interfaced with other software components Analyzes the main components of the FreeRTOS Application Programming Interface (API), detailing the implementation of key operating system concepts Discusses advanced topics such as formal verification, model checking, runtime checks, memory corruption, security, and dependability Embedded Software Development: The Open-Source Approach capitalizes on the authors’ extensive research on real-time operating systems and communications used in embedded applications, often carried out in strict cooperation with industry. Thus, the book serves as a springboard for further research. Content: IntroductionBASICS OF EMBEDDED SOFTWARE DEVELOPMENTEmbedded Applications and Their RequirementsRole and Purpose of Embedded Systems Microcontrollers and Their Internal StructureGeneral-Purpose Processors versus Microcontrollers Embedded Software Development Process SummaryGCC-Based Software Development ToolsOverviewCompiler Driver WorkflowC Preprocessor WorkflowThe Linker The C Runtime LibraryConfiguring and Building Open-Source SoftwareBuild Process Management: GNU Make SummaryExecution Models for Embedded SystemsThe Cyclic ExecutiveMajor and Minor CyclesTask Splitting and Secondary Schedules Task-Based SchedulingTask State DiagramRace Conditions in Task-Based Scheduling SummaryConcurrent Programming TechniquesTask ManagementTime and Delays SemaphoresMessage Passing SummaryScheduling Algorithms and AnalysisScheduling Algorithms for Real-Time Execution Scheduling Analysis SummaryConfiguration and Usage of Open-Source Protocol StacksIntroduction to the LwIP Protocol Stack Operating System Adaptation Layer Configuration Options Netconn InterfaceNetwork Buffer Management POSIX Networking InterfaceSummaryDevice Driver DevelopmentGeneral Structure of a Device Driver Interrupt Handling Device Driver Interfaces Synchronization Issues Example: Ethernet Device Driver SummaryPortable SoftwarePortability in Embedded Software Development Portability Issues in C-Language Development Application Programming InterfacesGCC Extensions to the C Language SummaryThe FreeRTOS Porting LayerGeneral InformationBasic Data Types Time Representation and Architectural DetailsContext SwitchInterrupt Handling and Critical RegionsTask Stack InitializationTick Timer Architecture-Dependent Scheduler Startup SummaryPerformance and Footprint at the Toolchain LevelOverview of the GCC Workflow and Optimizations Optimization-Related Compiler OptionsArchitecture-Dependent Compiler OptionsSource-Level Optimization: A Case StudySummaryExample: A Modbus TCP DeviceToolchain and Operating SystemGeneral Firmware Structure Modbus Slave Protocol StackUSB-Based Filesystem Application CodePerformance and Footprint SummaryADVANCED TOPICSModel Checking of Distributed and Concurrent SystemsIntroductionThe SPIN Model Checker The Promela Modeling LanguageProperty SpecificationPerformance Hints SummaryModel Checking: An ExampleIntroductionDistributed Master Election Protocol Formal Promela Protocol ModelFormal Verification Results SummaryMemory Protection TechniquesMemory Management Units (MMUS) Memory Protection Units (MPUS) MPUS versus MMUSMemory Checksumming CRC CalculationData Structure Marking Stack Management and Overflow Detection SummarySecurity and Dependability AspectsIntroduction to SplintBasic ChecksMemory ManagementBuffer Overflows Function Interface Annotations SummaryReferences