0% found this document useful (0 votes)
164 views6 pages

MC - Module - 4 Firmware (BCS402)

The document discusses firmware and bootloaders in ARM-based systems, detailing their roles as interfaces between hardware and software, and outlining the firmware execution flow. It covers stages such as platform setup, hardware abstraction, loading bootable images, and relinquishing control to the operating system. Additionally, it introduces the ARM Firmware Suite and Red Hat RedBoot, highlighting their features and functionalities in embedded systems.

Uploaded by

nandakishor425
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views6 pages

MC - Module - 4 Firmware (BCS402)

The document discusses firmware and bootloaders in ARM-based systems, detailing their roles as interfaces between hardware and software, and outlining the firmware execution flow. It covers stages such as platform setup, hardware abstraction, loading bootable images, and relinquishing control to the operating system. Additionally, it introduces the ARM Firmware Suite and Red Hat RedBoot, highlighting their features and functionalities in embedded systems.

Uploaded by

nandakishor425
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

MICROCONTROLLERS(BCS402)

MODULE-4 CONT………..
FIRMWARE
• Firmware: Firmware and bootloader, ARM firmware suite, Red Hat redboot, Example:
sandstone, sandstone directory layout, sandstone code structure.
Textbook 1: Chapter 10
1. Andrew N Sloss, Dominic Symes and Chris Wright, ARM system developers guide, Elsevier,
Morgan Kaufman publishers, 2008.

Firmware and Bootloader


Firmware: It is an Interface between the hardware and the Application/operating system level
software.
o It resides in the ROM and executes when power is applied to the embedded hardware
system.
o It remains active after initialization to support basic system operation.
o The choice of which firmware to use for a particular ARM-based system depends upon
the specific application.
o One of the main purposes of firmware is to provide a stable mechanism to load and boot
an operating system.
Bootloader: It is a small application that installs the operating system or applications onto a hardware
target.
o It only exists up to the point that the operating system or application is executing, and it is
commonly incorporated into the firmware.
Explain firmware execution flow MQP 2024 10M

Abstraction of Firmware Execution Flow


We have a common execution flow to help understand the features of different firmware
implementations. Table 4.7 lists the basic firmware execution flow.

Table 4.7 Firmware execution flow

Dept. of CSE (Data Science), SVIT , Asst. Prof. Anitha C S Page 1


MICROCONTROLLERS(BCS402)

The first stage is to Set up target platform. It include following stages.


Platform Identification
• It’s common for the same executable to operate on different cores and platforms.
• In that case firmware has to identify and discover the exact core and platform it is operating on.
• The core is normally recognized by reading register0 in coprocessor15, which holds both the
processor type and the manufacturer name
Diagnostics
• Diagnostics software provide a useful way for quickly identifying basic hardware malfunctions.
• Debug capabiliy is provided in the form of a module or monitor that provides software assistance
for debugging code running on a hardware target.
• This assistance includes the following:
■ Setting up breakpoints in RAM. A breakpoint allows a program to be interrupted and the state of
the processor core to be examined.
■ Listing and modifying memory (using peek and poke operations).
■ Showing current processor register contents.
■ Disassembling memory into ARM and Thumb instruction mnemonics.
Debug Interface:
Debug capabiliy is provided in the form of a module or monitor that provides software assistance for
debugging code running on a hardware target. This assistance includes the following:
■ Setting up breakpoints in RAM. A breakpoint allows a program to be interrupted and the state of the
processor core to be examined.
■ Listing and modifying memory (using peek and poke operations).
■ Showing current processor register contents.
■ Disassembling memory into ARM and Thumb instruction mnemonics.
Interactive Method(CLI):
• We can send the commands through a command line interpreter(CLI)(via RS-232).
• A dedicated host debugger(via LAN + C/S).
• The CLI is commonly available on the more advanced firmware implementations.
• It allows us to change the operating system to be booted by altering the default configurations
through typing commands at a command prompt.
• For embedded systems, the CLI is commonly controlled through a host terminal application.
• Communication between the host and the target is normally over a serial or network connection.

The second stage is Abstract the Hardware:


• Hardware Abstraction Layer(HAL) is a software layer that hides the underlying hardware by
providing a set of defined programming interfaces.
• The HAL software that communicates with specific hardware peripheral is call a device driver.
• Device driver provides a standard application programming interface(API) to read and write to a
specific peripheral.

The third stage is to load a bootable image:


• The ability of firmware to carry out this activity depends upon the type of media used to store the
image.

Dept. of CSE (Data Science), SVIT , Asst. Prof. Anitha C S Page 2


MICROCONTROLLERS(BCS402)

• not all operating system images or application images need to be copied into RAM.
• The operating system image or application image can simply execute directly from ROM.
• In small devices which include flash ROM, simple flash ROM filing system (FFS), which allows
multiple executable images to be stored.
• The firmware must also understand the network protocol as well as the Ethernet hardware to load
the image from the network.
• A popular image format for ARM-based systems are
• Executable and Linking Format (ELF).
• Plain binary: doesn’t contain any header or debug information.
• Compressed image
Most firmware systems must deal with the executable form. Loading an ELF image involves
deciphering the standard ELF header information (that is, execution address, type, size, and so on). The
image may also be encrypted or compressed, in which case the load process would involve performing
decryption or decompression on the image.

The fourth stage is to relinquish control.


• Relinquishing control on an ARM system means updating the vector table and modifying the pc.
• Updating the vector table involves modifying particular exception and interrupt vectors so that
they point to specialized operating system handlers.
• The pc has to be modified so that it points to the operating system entry point address.
• For Linux OS, relinquishing control requires that a standard data structure be passed to the
kernel. This data structure explains the environment that the kernel will be running in. For
example, one field may include the amount of available RAM on the platform, while another
field includes the type of MMU being used.
• After relinquishing control, the Machine Independent Layer (MIL) or Hardware Abstraction
Layer (HAL) part of the firmware can remain active. This layer exposes, through the SWI
mechanism, a standard application interface for specific hardware devices.

ARM Firmware Suite:


• ARM has developed a firmware package called the ARM Firmware Suite (AFS).
• AFS is designed purely for ARM-based embedded systems.
• . It provides support to ARM processors including the Intel XScale and Strong ARM processors.
• The package includes two major technologies
1) Hardware Abstraction Layer called μHAL
2) Debug monitor called Angel
Micro Hardware Abstraction Layer (μHAL):
• It provides a low-level device driver framework that allows it to operate over different
communication devices (for example, USB, Ethernet, or serial).
• This has the advantage of making the porting process relatively straightforward since it has a
standard function framework to work within.
• μHAL supports these main features:
• System initialization
• Polled serial driver
• LED support
Dept. of CSE (Data Science), SVIT , Asst. Prof. Anitha C S Page 3
MICROCONTROLLERS(BCS402)

• Timer support.
• Interrupt controllers—support for different interrupt controllers.
Debug Monitor- Angel:
• It allows communication between a host debugger and a target platform.
• It allows to inspect and modify memory, download and execute images, set breakpoints, and
display processor register contents.
• The Angel debug monitor must have access to the SWI and IRQ or FIQ vectors.
• . Angel uses SWI instructions to provides a set of APIs that allow a program to open, read, and
write to a host filing system.
• . IRQ/FIQ interrupts are used for communication purposes with the host debugger.
Explain Red Hat RedBoot MQP 2024 10M
Red Hat RedBoot:
• RedBoot is a firmware tool developed by Red Hat.
• It is an open source license with no royalties or up front fees.
• RedBoot is designed to execute on different CPUs (for instance, ARM, MIPS, SH, and so on).
• It provides both debug capability through GNU Debugger (GDB), as well as a bootloader.
• The RedBoot software core is based on a HAL.
• RedBoot supports these main features:
1) Communication: configuration is over serial or Ethernet. For serial, X-Modem protocol is
used to communicate with the GNU Debugger (GDB). For Ethernet, TCP is used to
communicate with GDB. RedBoot supports a range of network standards, such as bootp,
telnet, and tftp.
2) Flash ROM memory management—provides a set of filing system routines that can
download, update, and erase images in flash ROM. In addition, the images can either be
compressed or uncompressed.
3) Full operating system support—supports the loading and booting of Embedded Linux, Red
Hat eCos, and many other popular operating systems. For Embedded Linux, RedBoot
supports the ability to define parameters that are passed directly to the kernel upon booting.
Example : Sandstone:
Sandstone is a static design and cannot be configured after the build process is complete. It carries out
the following task.
1) Setting up target platform
2) Loading a bootable image.
3) Relinquish control to OS
The implementation is specific to the ARM Evaluator-7T platform, which includes an ARM7TDMI
processor. Table 4.8 lists the basic characteristics of Sandstone.

Dept. of CSE (Data Science), SVIT , Asst. Prof. Anitha C S Page 4


MICROCONTROLLERS(BCS402)

Table 4.8: Summary of Sandstone.

Sandstone Directory Layout:


The directory layout shows where the source code is located and where the different build files are
placed. The directory structure is as shown in Figure 4.8.

Figure4.8: Stanstone Directory layout

Sandstone Code Structure:


Sandstone consists of a single assembly file. The file structure is broken down into a number of steps,
where each step corresponds to a stage in the execution flow of Sandstone. Table 4.9 lists the steps of
execution flow.

Table 4.9 Standstone execution flow.


. Sandstone initializes the hardware and then loads and boots an image following this procedure:
Step-1 Takes the Reset exception.
Execution begins with a Reset exception. Only the reset vector entry is required in the default
vector table. It is the very first instruction executed.
Step-2 Starts initializing the hardware;
The primary phase in initializing hardware is setting up system registers. These registers have to
be set up before accessing the hardware.
Dept. of CSE (Data Science), SVIT , Asst. Prof. Anitha C S Page 5
MICROCONTROLLERS(BCS402)

Step-3 Remaps memory;


One of the major activities of hardware initialization is to set up the memory environment.
Sandstone is designed to initialize SRAM and remap memory. This process occurs fairly
early on in the initialization of the system.
Step-4 Initializes the communication hardware.
Communication initialization involves configuring a serial port and outputting a standard banner.
The banner is used to show that the firmware is fully functional and memory has been
successfully remapped.
Step-5 Bootloader:
The final stage involves copying a payload and relinquishing control of the pc over to the copied
payload.

Dept. of CSE (Data Science), SVIT , Asst. Prof. Anitha C S Page 6

You might also like