Formation - Langage C pour les applications temps réel et embarquées (référence 002603A)
 
    Partners
  • The labs have been developed under the IAR Embedded Workbench
  • Attendees develop programs on PCs and use the JLINK IAR probe to download executable files to the STR712 evaluation board and control code execution
   
           
    Related trainings
  • The STR712 ARM based microcontroller from ST has been selected for this course since it is a basic 16-bit/32-bit processor
  • MVD offers a large set of processor trainings, whose prerequisite is the knowledge of C language
   
           
    Prerequisites
  • Basic knowledge of C or other programming language is recommended even if the C syntax is revised at the beginning of the course
  • This is not a C course for beginners
   
             
  Course objectives
  • The course shows how to parameterize the linker according to a board mapping
  • Access to peripheral registers by using unions and bitfield structures is explained
  • An interrupt handler enabling nesting is developed in C
  • The course shows how to connect read() and write() functions to a low level driver
  • The course shows how to design a proprietary task scheduler
  • Communication between tasks is highlighted
  • Implementation of the ST I/O library is explained
   
           
    Duration
  • 5-day course
   
           
    Topics

(The full description of this course can be provided on request)

PARAMETERIZING THE COMPILER SUITE

  • Becoming familiar with the IAR development environment
  • Organization of a C program
  • Project definition
  • Compiler parameterizing
  • Linker parameterizing
  • Sections automatically generated by the compiler
  • Creation of custom sections
  • The linker script file, declaration of memory areas, group command
  • Cstart file
  • Description of a map file

THE PRE-PROCESSING

  • Inclusion of header filesMacros
  • Assembly macros, volatile vs non-volatile registers
  • Conditional compilation
  • Recommendation to avoid re-declarations in multi files projects

TYPES AND OPERATORS

  • Storage classes : register, extern, static and auto
  • Local variables vs global variables
  • C types
  • Constants
  • Implicit and explicit casting
  • volatile attribute
  • const attribute

STATEMENTS

  • Selective statements : if...else, ternary operator, switch...case
  • Iterative statements : while(), do...while(), for()
  • Control statements : break, continue, return

POINTER AND ARRAY

  • Addressing modes of the ARM core
  • Position independent code and data
  • Pointers : declaration, initialization
  • Single dimension arrays
  • Multi dimension arrays, location of data in memory

STRUCTURE AND UNION

  • Structure : declaration, initialisation, access to fields, nested structures
  • Array of structures
  • Bitfield structures
  • Benefit of typedef
  • enum type
  • Union : declaration, initialisation, access to field
  • Modelling IO registers through bitfield structures and unions
  • Padding, implicit alignment of fields

FUNCTIONS

  • static and extern attributes
  • Function call, argument passing
  • Return value
  • main() function, reset to main sequence
  • Pointer to function
  • C -to- assembly interface : description of the stack frame
  • Line assembler

DYNAMIC ALLOCATION AND LINKED LISTS

  • Benefit of the heap compared to static data sections
  • Related functions : malloc(), calloc(), realloc() and free()
  • Description of the memory allocation first fit algorithm
  • Linked lists : single-linked, double- linked, tree lists
  • Basic operations : item insertion and deletion

SPECIFIC INPUT / OUTPUT DRIVERS

  • Exception management in C, the vector table of the ARM core
  • Introduction to STR712 timers
  • Generic drivers, description of the set of functions designed to control the timer
  • Libraries, creation of an archive file
  • Description of the UARTs present in the STR712
  • Studying the serial driver developed by MVD

STANDARD INPUT / OUTPUT FUNCTIONS

  • open() and close() functions, opening modes
  • read() and write() functions
  • Connection to the specific serial input and output functions
  • Standard input and output functions, definition of stdin, stdout and stderr
  • Buffered inputs outputs
  • Formatted input and output functions printf() and scanf()
  • File input output functions, description of fopen() and fclose()

TASK SCHEDULING

  • Definitions : thread vs process, preemptive vs non preemptive RTOS
  • Task states and transition between states
  • Multitask and real time
  • Task switch
  • Determinism
  • Implementation of a task scheduler : definition of a scheduling algorithm
  • Management of task descriptor lists
  • Assignation of a stack to each task
  • Task suspend and resume mechanism
   
           
    Documentation

Training manuals will be given to participants during training. Precise and easy of use, those notes can be used as a reference afterwards.
   
           
    Other trainings :

If you want to know our other training courses and their contents, you can consult or download our complete training courses list on this page : Training courses - General presentation