Advanced C Programming

Many engineers work with the C programming language everyday for real-time embedded development. However, some hit a plateau and never feel comfortable with certain aspects of the language.This course aims to progress individuals and give them a fuller appreciation of the more advanced aspects of the language.

Due to the requirements for programming real-time embedded systems, this course goes beyond just addressing the language issues and explores compile, link and run-time issues. In addition it covers interrupts and multi-tasking areas specific to C.

50% of the course is spent writing code for a real target
.

AC-401
4 days
£1960 - 10% discount given if a previous Feabhas C course has been attended
pdf download

Dates:

9 - 12 Jul 2013
7 - 10 Oct 2013

Course Outline

 

Day 1
Introduction Program Structure:

  • Importance of good structure
  • Quality and style

Pointers, Arrays & Dynamic Allocation:

  • Arrays & pointers; compatibility and incompatibility

Function Pointers:

  • Basics
  • Callbacks
  • State machine

Unscrambling Declarations:

  • Rules
  • Using typedef

Day 2
Enumerations, Structures and Unions:

  • Enum vs. #define
  • Struct layout
  • Uses of union

Interrupts:

  • Hardware interrupt models
  • Software interrupts

Multi-Tasking (Multi-Threading)

  • Terminology
  • Advantages and disadvantages
  • Intertask Communication & Synchronisation

Day 3
The Linker:

  • Memory sections

Start-up, Runtime and the Stack:

  • What happens before main
  • What is happening at runtime
  • Estimation of stack requirements

Dynamic Memory:

  • Malloc, calloc and realloc
  • Variable sized structures
  • Dangers

Memory Management and Protection:

  • Memory protection
  • MMU
  • Segmentation and paging

Day 4
Writing Safer C:

  • MISRA-C Guidelines

OOP with C:

  • Object-based and object-oriented
  • Classes, inheritance and polymorphism
  • Associations and aggregation

Number Crunching:

  • Floating-point and fixed-point number systems
  • IEEE Standard 754

The Standard Library:

  • Major issues

C99:

  • Summary of significant new features

Course Overview

 

An intensive four day course covering the advanced aspects of C programming for the real-time embedded programmer.

Course Objectives:

  • To become comfortable with the advanced aspects of the C programming language
  • To gain an in-depth knowledge on what is happening at compile, link and runtime on a target processor
  • To introduce good quality and style for real-time embedded programming
  • To gain hands-on experience of programming up interrupts and real-time operating systems (RTOS).

Delegates Will Learn:

  • Advanced aspects of the C programming language
  • The traps and pitfalls of the language (e.g. structure packing, dynamic memory, etc.)
  • Compile, link, and run-time memory models
  • MISRA-C (www.misra.org.uk) guidelines
  • What parts of C should and should not be used in real-time embedded systems programming

Pre-requisites:

  • A good grasp of the fundamentals of C

OR

Who Should Attend:
This course is designed for engineers who want to improve their grounding and understanding of the C programming language. It is specifically aimed at issues relevant to real-time embedded software engineers.

 Duration:

  • Four days

Course Materials:

  • Delegate handbook

Related Courses:

Course Workshop:
The course workshop uses the IAR compiler and the NXP LCP2129 ARM7TDMI microcontroller as a target for the hands-on sessions. Exercises are designed to stretch attendees’ abilities and explore subtleties of the language. A good working knowledge of the C programming language is essential as some of the exercises involve extensive programming.