0% found this document useful (0 votes)
4 views

MicrocontrollersPPT-1

The document discusses the Sandstone code structure, focusing on its execution flow and the initial setup for a target platform environment. It details the first step, which involves handling the reset exception and the use of a vector table in ARM assembly language to manage exceptions and interrupts. The code structure includes directives for defining code areas and entry points, as well as instructions for branching to exception handlers.

Uploaded by

vinaypgowda00
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

MicrocontrollersPPT-1

The document discusses the Sandstone code structure, focusing on its execution flow and the initial setup for a target platform environment. It details the first step, which involves handling the reset exception and the use of a vector table in ARM assembly language to manage exceptions and interrupts. The code structure includes directives for defining code areas and entry points, as well as instructions for branching to exception handlers.

Uploaded by

vinaypgowda00
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

MICROCONTROLLERS

BCS402

SEMINAR ON
“Sandstone Code Structure And Step1:
Take the
Reset exception

Under The Guidance Of: Submitted By:


Prof.Dr.DIVAY PRAKRUTHI K S
Submitted On:
06/05/25
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.
We will take you through these steps, trying to
avoid as much as possible the platform specific
parts. You should note that some specific parts
are unavoidable (for example, configuring
system registers and memory remapping).

The initial goal of sandstone is to set up the


target platform environment so that it can
provide some form of feedback to indicate that
the firmware is running and has control of the
platform.
Step 1: Take 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.

you can see from the code here that all the vectors, apart
from the reset vector, branch to a unique dummy handler
—a branch instruction that causes an infinite loop.

it is assumed that no exception or interrupt will occur


during the operation of sandstone. The reset vector is
used to move the execution flow to the second stage.
.
Code Explanation the code defines the startup
sequence for an Arm-based System, handling various
exceptions and interrupts. It Consists Of Several
Sections:

1. AREA Directive: Defines a new area of code or data.


- AREA Start, CODE, READONLY: Specifies the start of
the code area, which is read-only.

2. ENTRY Directive: specifies the entry point of the


program.
- ENTRY: Marks the beginning of the program.

3. Vector Table: defines the vector table, which contains


jump instructions to handle various exceptions and
interrupts.
- In the provided Sandstone code, B is an instruction in
ARM assembly language.

B Instruction, B stands for "Branch" and is used to transfer


control to a different location in the code.
Code Explanation

In the context of the Sandstone code, B is used to:


1. Jump to exception handlers: When an exception occurs,
the processor jumps to the corresponding exception
handler using the B instruction.
2. Loop forever: In each exception handler, the B
instruction is used to loop forever, effectively
halting the program.

Sandstone_start B Sandstone_initl: jumps to the


sandstone_initl label, which is likely the
initialization routine.

- B Ex_und, B Ex_swi, B Ex_pabt, B Ex_dabt, B


Int_irq, B Int_fiq: Jumps To Respective Exception
Handlers.
THANK YOU

You might also like