Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.

Similar presentations


Presentation on theme: "Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University."— Presentation transcript:

1 Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University

2 2 Outline Introduction to embedded software development Overview of software development tools

3 3 Your lecturer Name… Background: … Contacts: Email: … Office: …

4 4 Some prerequisites … Computer architecture CPU structure Memory management Interrupts C programming Yes, you will have to program in C for the practical part of this unit Please revise in advance !!! Please ask for help if you need it !!! Required !!!

5 5 Study materials Where to find the online materials… Unit web page: … Forums Recommended module texts… Where to get them: …

6 6 Embedded systems

7 7 Embedded software development Desktop software: Written on a PC – can be executed, debugged and tested on a PC Embedded software: Most embedded systems do not have keyboards or monitors, what to do? Cross-development! Development system (Host system) Target system

8 8 Compiling embedded software Cross-compilers: Pentium CPUEmbedded CPU c/c++ source cross- compiler binary for embedded CPU

9 9 Executing embedded software Ok, we ’ ve got a binary for our target system: Obvious choice: run it on the target hardware Alternative: run it on a simulator of the target hardware that is executing on the development system Pentium CPUEmbedded CPU Simulator binary for embedded CPU

10 10 Why simulate? Advantages: Can do without actual hardware Avoid problems of hardware defects Disadvantages: Differences between simulator and the actual device May be difficult to test real-time aspects

11 11 Debugging embedded software Debugger on the host, application on the target – what to do? Need a communication link to the target system … and a program running on the target systems that listens to debugger ’ s commands and controls the application execution (debug agent) Debugger Your embedded application Debug agent communication link

12 12 Operating systems for ES Embedded systems need operating systems too! Real-time operating systems make the life of the software designers easier: tasks – programming abstractions for concurrent processing task scheduling inter-task communications and task synchronisation low-level hardware support (device drivers, etc) and implementations of standard widely-used protocols (networking, etc)

13 13 Start-up process PC: A small boot program in PROM (BIOS) The rest of the software on the hard disk (or CDROM or floppy) Embedded system (production version): Usually, all software is in PROM (e.g. flash memory)

14 14 Start-up process (contd.) Embedded system (development version): Inconvenient/time consuming to reprogram PROM with all the software every time. Alternative? Have a small boot program in PROM on the target and load the rest from the host! boot program OS, applications

15 15 Development cycle Setup the target hardware Setup the host-target communication link(s) Put the boot program on the target Build (rebuild) the OS on the host Write and build your application on the host Start (restart) the target system the boot program downloads the OS from the host possibly, downloads your application as well. Download your application to the target and test

16 16 Software development tools Embedded software development platforms and tools: A set of development tools (IDE, compiler, debugger, etc) RTOS – a real-time embedded operating system Example: NASA ’ s Mars Pathfinder

17 17 Host development platform An integrated environment for software cross- development application building tools (compilers etc) integrated development environment (project management, deployment, debugging, monitoring) support for multiple target RTOS Support a variety of host platforms (hardware and OS)

18 Software components 18 Application RTOS Target agent Target simulator Target server Host system Target system GUIHost shell IDE Editor Project Compiler Debugger…

19 19 Target server Manages communications between IDE host tools and the target Target symbol table (mapping of program symbols onto addresses in the target memory) Object module loader (dynamic linking) Routing and caching of target data for the IDE tools Each target must have own target server on the host – identifies the target for the host tools IDE RTOS Shell Debugger Browser Target Server Target agent Communications link HOST TARGET

20 20 Loading application modules to the target You application may use symbols (functions, variables) defined in RTOS (RTOS system calls) or other modules Dynamic linking resolves these symbols at download time (can be a source of download errors if symbols not found!) Symbol table Target RTOS image: taskDelay() { … } myApp.o: … taskDelay(123); … Dynamic linking Host

21 21 Managing multiple targets Target registry keeps track of target servers available on the network can also run on a computer different from the development host or the target server a single registry on the network allows all users access all targets in the lab, individual registries on each host Target server IDE tools Target network host-target link

22 22 Host-target communications Two communications channels: Target server connection – communications between target server (tools) and target agent (RTOS on the target) Target console (standard input and output from the target) – printf/scanf in your applications Target server Console Host PC RS-232 Ethernet target CPU

23 23 Host-target communications What if all we have is a serial link to the target ? Target server Target (debug) agent Application RTOS Virtual console application I/O control, debug, etc RS-232 Target board

24 24 Booting RTOS FTP can be used to download the OS image Host needs to run FTP server target power-up boot program executes on the target boot program loads RTOS image from the host RTOS starts on the target HostTarget Ethernet C:\Embedded_development\RTOS\OS_image

25 25 Booting RTOS (contd.) Alternative boot scenarios: Via serial link – uses the target server file system (TSFS) From a local disk on the target – obviously, needs a target with a local disk (floppy or hard drive) The software on the target and host needs to be configured appropriately: Target: boot parameters in the boot program; these can also be changed at the boot time! Host: target server configuration, FTP server, networking

26 26 Boot parameters Parameters: boot device, host/target names, host/target IP addresses, FTP user name/password, OS image file name See the manual for more details … RS-232

27 27 IDE project facility Organizing the files that make up a project Adding application initialisation routines to RTOS Grouping related projects into a workspace Customising and scaling RTOS Defining varied sets of build options Building applications and RTOS images (make utility) Downloading application objects to the target

28 28 Managing the target -- Shell Download application modules Invoke both RTOS and application module functions can interpret most C language expressions Invoke build-in shell functions sp – launch an new task td – delete a task i – display information about running tasks: -> i NAME ENTRY TID PRI STATUS PC SP ---- ----- ------ -- ------ -- --- tExcTask _excTask 3ad290 0 PEND 4df10 3ad0c0 tLogTask _logTask 3aa918 0 PEND 4df10 3aa748 tWdbTask 0x41288 3870f0 3 READY 23ff4 386d78 tNetTask _netTask 3a59c0 50 READY 24200 3a5730 value = 0 = 0x0

29 29 Alternatives to Shell Use Target Manager window in IDE to start/stop tasks Get information about tasks, semaphores, queues, etc (Kernel objects) Download and unload applications onto the target

30 30 Application debugging Debugger starting a new task in debugger attaching to already running task breakpoints controlling program execution (e.g. step-by- step) data inspection

31 31 Summary Writing software for embedded systems usually requires cross-development: write on the host execute on the target ES Need a pair of communication agents: one on the host – interface to the host tools one on the target – interface to the target OS Most embedded software development tools/RTOS follow this model


Download ppt "Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University."

Similar presentations


Ads by Google