0 ratings 0% found this document useful (0 votes) 8 views 20 pages Module-4 Microcontroller
The document discusses exception handling in ARM processors, detailing how exceptions interrupt normal execution and the various types of exceptions and their priorities. It explains the ARM processor's response to exceptions, including entering specific modes and executing exception handlers. Additionally, it covers the structure of the exception vector table and the importance of memory layout in handling exceptions.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Carousel Previous Carousel Next
Save module-4_microcontroller For Later Hin Inctitioe o Tedwolegy . Le
\
MioDULE- 4
Excepiton f. Tntemsupt Hamdting
= — “
=> Excepifon Hamdling And Excaplion nvvelas :
An Bxceptten fe any tomdftfon that need +0 be halt the nvimal
Sequential Beecotion 4 instircteen -
&xaDblhen ARm love fe Reset
@ hlhen We Lothoare fatersopt fxecect?on Pe Intepopied
® bthen am Belernat frtesupt has been RoPoed
HMMOSt Exceptfs ace assocfated esPtt. Gol-tusace
¥Except¥m handler Poa Soplecaxe Lotfne that Bcecutes
colen an Skeeptfon Occeees.
23 Data akort &xeeptfon
ARM Process ot Scceptfon 4 Moles
Table below tfet fhe ARM procersot Seceptiont fn wlfeh Bact
. Pxcapttor Causes He procenser 10 Enter Spectyfc mode .
Eiccapiton [wwode [punpese
1. Fast Inteuopt Request / rq ised ener lag toc
2-Intesupt Lequest [Feo ‘i ergere es ‘ten " e
3. OMT +4 Reset Bre eae ee
be Pegelea Abort# Bata Pio] peop, | reget memety es
5: Undesivad Taste ton] Ondeptnect | kgait Ematatton ep
# Usexk System modes are te ently moces tact ate not Entered
by lovvesponcttng &xcepifon . Tt can be Srtered only by /
A
1(correspon ctfng yy Chamaing the CPSR,
# hlhen anv &xcepiter Careses amoete change than thar
Processor aeetomat call,
Lovet te cpcr +o per
Lawes te Pe top Chin Retian addvers)
RA. the CPSR 10 Bxeent oon mode .
% Gel® tHe Pc +0 address o Bxcepifon handler
[Reset }
pate Aor}
ELO -—___________
cao
egetcts A-Bovt!
nez—
(#eq] Exq] [bor] [FYC]
paroles
lonctepined
Exceptfons
mI
Above Lfagtarn Brows a Pernple pret Ute % Exception an:
Assockatect modes.
=> Thtenept Vector Table CLV T
VectOr Table 3 ;
Tt Consfet of table h address where ARM Processes has
+O branch jshen @kception Peo Rokeecl . these’ addresses
Comenty tmtebns branch: fretauctfens OF One 8 the
Jollorotng forms.«The ao foims te branch by txcephen a3 gintn below
@.- Bladdress > ¢
THR? branch fnctructfon
Malas Provfcles jomp 40 Retatfve address
@. LDR Pes (pe bgeset] s ;
ThEs loact Leger Erstructfon loads the Bxceptton hancller
C Subyoutfne), Add regs fio memory 40 Pc.
a ADR. Pc, pc, #t- Oppger]
The: toad Regfetes fnetiuction loads Ha % ecBite Entemupt
Savi. Routine address fiom =the memay address
Xp bf)030 +0 the Pc,
- MOV, Pc, +t Prmecfate 2
ThE: Mov fastiucting Coptes and tmmedifats Vales fntothe Pc,
Exception. mode Uector table Set
Rese.
3> Excertion PRioritres
*
eeaetion Prreififess- The fotlortng “table hows +8 \lasdatione
SEHED Otcere
ae ae. on be Pi processeist accoctaledt
| R&cep Ron
Prfor@hy | 2 bite +
fl
Revet ,
Gato abeit 2
fast Frtewupt Request 3
Thtewupt Request. A ! =
=
6
Progetcl. abest
fuoare Fnteesupt
Undeffnned Pntesopt ¢ T 7
The Seset Bxcepifon £5 ths Lsquest prtorPty 4 Olues when power Ke
Appifect +o processer’. LLhen et Oleeers ft takes the preeectence
Over att Hu ofher Bxcepifon.
He blhen date abeit Ouurs % faker the peforthy over afl the
RxcoptPons Bxcept Reset
& the lower proettig & Luared by 2 Bxcepifons Pywore
Prelesupt € enclepfred Enstructions «
Kthe Reset Sueeptions phen ere Agnals i" geset handler
PrllPlRation the System fnetude memety acts. :
eta data abort Bike pifon inben Bret ocemors atlempl
+0 Read piesslle +0 for memery usfthocct the access
eamPcsion.
* th. fast Intessept Acquest [FIGI Occurs when extemal
pertplcrals fs ,
& An Trievopt Lequesitlreg@] Oteus when Beternal ploertpherel
eet TRO,.
KA prgetet'Grtemupt aquest Petdx Abert acceus phen Ha
rods OcusTo fcr a thetrtieo that Lesett fr
4x memoty fautt .
LA Pop {wo-te fniesupt CLutry &xapttn ocuns when Bull
fnstruccton Po Ovecected . A
tned tnctiuction &,
€or ttn ecptin cant hana
> hire Regictes Opserts
Athen an Bxecpiion occurs tte Linked Regidites Bas 40 be Store
cette Lpectife addsess tople below Licks tErt op kinked
thskuth's
Regier based
Excepifor, Addvers Use
4 _ ls Fe noidepfined on Acset
ea L pornts tothe HorrackhM “Hock Conse
Data abert ly -8 dota abert Gecepion.
gp eorrd addres from Past Tupi
=a | fen 4 Gochesctten harelles.
etunns adden om
Tee tay TRA land ter. ane
Pregetc abort Atr-y Ro ecases Pb peicts abot.
Sur er [tn TOncet ate one
a a z a ne: -
Oncteffrecl Inch uctton| Lr ee Re tiepaceenee ee
‘the Bromple betoro Lous Ha tii perent metiods b, waftifog fa
fiom fntewwpt Aequese and fest micmupt Acquest,
Beg Use 4, So8€ retraction axe
handes ny “Use op tnlewept Ltaice
AZhandte cocle > Coe hin, Xe, th
Te er STMED 4135, 8 £0- 45, Lanle
BOBS PC, Rin th - -— peat
8x22 Kanctler Lhandles cocte>.
BoB Im Kiy ety
Zhaneller Codt >
Mov po XinTNTERRveTS
Indewupts 3 S
re ann of types pee Wwoflable on ARIA pri
oi type Fo PRQ and FTQ ther ax cused b
Bxtemnal petpluats a
Khe Second type fe SUIT Enstiucttons CFoptwscare Thi erupt
TnStructfon )
? Assigning Tntexsopts 2
eas Basten, clestasers car deckde whiten Larduvaze peripheral
duce Erferrupt Request fype -
« a Frtessupt Confrotler. Connect mutiple Betetnal tiesupt
40 One fniersupt pin.
x To asstan any Prtexsupt oe a have adopted Hu,
fottousén| Baddest pr pros!
ip @ inte oe ‘neimal ieee austgneal §* qrect prosper
Pntewups , wn gogtwase Enickrupls are as Aes yee
2 40 cat 9 eae tem AoutPnes
2x3 (Enear ' Qe? ee oe J
i 05 Foil exept
ub Past Interuopt Request axe neh matty AReaved fos trienp
Source that Kequbres fest Aspe.
Let Lerect memety acces
> Trtersupt Latency Ct8me ne olelay)
The Prieeal ae a Intersupt Request PGpat
being RaPced 40 ths est f of
an fngtructon
Specttfed frlessupe a Loe:
The Goptware Lancller have 400mMakh metrect +0 mot mt
the fr emupt Latency ia pie Ro nested frtesupenandte
oe Reenabitng’ Pntessopt hagite intesupt handiting fe complete.
6Secarifow
Tatemopt 2
Tntesept 3
ed fnteopt
A
hs Second method priestityation progorrmin tea Dnimeupt
Contotle: +0 Tgnthe thr frreavpt eh Larne pon pi louser
prfoitty. ery tasks
et
= Harnd (Eng Baty, pr Y :
= TRG avd FIO Bees tons 6
‘An TQ FIO Qxceptfor causes Hue prowssot Lasdusare +0
0 tsi a Standard procedets ollows 8, meee
1, the processor Changes 10 0 Bpeeke anteopt AeAveel MER
woth Cuows Emtendpt as Aabeed.
Lethe preuPour mode CPSR Saved fnto ee
3, the | Pe C progtamn Comtex) #8 Faved Frio be Can) gy Erker
Aaquest moc.
fhe Ttesropts au disabled Pius TRQ & Fre +0 Ltop another
fntemvpt 40 be fakced «
6. The prOcoser branches 10 Spe}
-table.
polows Shows han TRA Excaphor std
aaa:
un VEEP mod
7
eg 2 3- Lewet nett
Pe Enkry ea tntemupt VectorMoss below Lrows TRQ Lxcepfon fo Kakeedh ashen procesot
S$ in LSes mode.
IVT
ong, fe ap
(fode]
Th this &le ts Tea and erg Exceptim bfs are Snable -
fr CPSR
kiten TRA Occurs the procesess moves fnto Gate 2
Geding Tha bt 10 + amd tun ueeney the 1 BPE. furtber
+0 Lop amotiur TRA Sccoption .
XKthe cpse mode Fe Chamarel fotea mode and tee Cpse Bix
* mode bs copPed +0 Spse Tntemupt mode CSpse ~ brq) ‘
Kthe £etusim oddvess fs Proved fn Ruy « i
€ The pe fs Set 40 advent fe Stored Fr Sind, Ox 18 CPntemept
Request program address) .
¥% Th Cate 3 the enpiware Damdla calls the Specpfe intersupt
GeavPee Lousine code.
& Upon Completfon te proaort mode Return back 19 the
ute mocdt “fn Cate -L.
Sintlesig,
Sxample o, pra Rxcepiten te Chosen,
8ca ngcva StF -
Spse - Hy = Cpse
Aun - fla, = Pe
Pc=ox1e
> :
Enabling ask Dfeabling TRQ 4_FIQ Exceptions
Ths Jable beteo 2hows Low TLQand FIQ Mntetupts ase &nrablel
Bnacbling an Pntemupt
Cpsy value | TRA T FIO
Pre | ngevghA-sue | nyevat PLC
code” . Gnable — rq gnable- 4g,
ARS LI, cpsr aes 2, psa
Bic &1,K1, O80 BPC At, &, OKO
sR cpsr-cAl BASR Cpss_c,4
Post OBNGIFL NC | ngeatyeseee
In tte aber table Ft uses 3 theticce tone
He waess Copies “the Content o} Cpsr 40 He Aig cites x
2h rcs Cleace He rea andere bes Co = activate)
980 MER Postracdt¢o
optes Ricont Aegis C2. the
: . emt 40 the &
Preghx Co > tn CPSt¥—C fndcfeates control fitid . is
eabtng am Intesept
Crest | Tea
Pre N30N9 Jt a
i aera Sift — Sec 3 cvaliPe— UC
code Akeable—fr9, kPcatde - Fe
rans = Rr, Cpse ops
R tOX8O 1, CPs
ORR a Hi fe ORR 2,41, HOKHD
mee cpsr—> MSR cpsy—C,Ar
nyCrasi Pt — &uc
post | ngevatt _ &uC
yeu above jable fuses 3 fretructfone
Value’ +0 Aagictes Ri
TRA and FIQ C12 cleackvat )
Tn
IP MRS 8 Copfes tou Cpsr
% ORR ORK Incturclisn Set
Seacee Copfes tee &, content +0 cPER.
* Basse arirerrueT “DESIGN & Empl EMENTATION.
“it. Beceptfon Band les
davkng PS Heclkcatect Registers Contofnt;
Qestan 0 Aeeeptfon, Hack depends Upon
Wp Opeiatfing Kystem Requtvements 2
fack 0. £ has tH Own Keg rFremens
2b Target Marduoates Pt provtcles alan. 10 Hu &¢ and
postifin of Hu tack.
make usec Glack wit. Sach mole
Gack epeintes. The
foltorsing factors.
sae Btack designai50 Dettan AecksPons 40 be made fot tle Mack
te the Location deloumtne® where He memory map a Hu tack
beg?n se, For em basect Systeme Praeks are chest ned) 22FR
comding wan. ‘
POks Clack Me depends upon Ype 4 Bamdles (nested 04 non-nesed
Fig below Muoies Stypfeall memory Layooils. the fost Inpout
Li018 Hu-trocdPHoral Clack ifs Frlerrupl Mock Hore inden
cate He EOIe Oo t. the & ke ‘B Ly
fawepiiee a ee econ oyoet BL law8 Hee Entertey
P°
Backs memeky hayouts
a a
ATO see Clack 8 Trtemupt Laer a
Hop at veer Stack te
: Heap
Coole T
x 00008000 cocle
ne AptStacRdp
oxoooposeo | ector table | 9 connogng| Weete? table
he mafn advand memes 8 i
out Bb ove’ fo B
doesnot corrupt 1G vector fale en. Stark evertlocos,
# for Coon proees mode the Hack tat be Cet up, Hue
Ro Cassted ced Qrery dime when He processat fo Acgel , Laat
belo Slows goplemeniation using mem&Y Layout a.
a
P.T.O9 ¥20000 foie EE
Ose Hack +
ox 10000 fa |
. v 2g .
BKROO0 + cocte Bye taife. dota
Ox 8000 code
OX8000 ~ 12.8 TRY ack
exgodg ~ 640 gree Back
oxo0d [pre epa
SF
Lfectet table |
* Memoiy Regions are named whi an addres a Fhown below
vse. gtalee EQU Ox 2000
“tRo. Stack equ ©* 8000
euc. tae EQU TEA ~ atk 128 —
# the prowmot modes Hencectancal wht DF palling 10
et +he epse +0 Rnuo mete, AS Fier below.
“USABIMdA FEQu orto :
PTQ 82mMd FAV Ox
Teggomd EQv OL
@utc 32md Fae aaa
md EQU OxKtE
Abt 3 Oxtb
und, 82md EQU
Sys grzmd EGY oxtt
¥ fare 12 am Bkample 10 how hore 3 Rigerent Macks ax
Getuped .
te “
Gopeavesofingmede L1ack! ths procesor Code tarts Propet~ Lor Aig, @U—ALEKISTACK
Buc — peni@lack Dep Mvc~ Stack.
SETLA Mock Hacks To sel ‘oP TLQ mode Hack ths follorsing
frctietions are usect.
MOV a, , TRQ32 Mel
MER CPSA—C), Aa
EPR Ais, LRQ_blecottack ’
TRQ-Newttack Deo Peg_-Aack.
3b ces mode Back $ khan processet fo Fr uses mode , Hue
ono Breet method 40 mocttyy Cree » He alleinative fe 40
foree tts processed fnto Masten mode tp Set up te viecamocle
0.
Hark got usting axe Ha Tneteuctions t-
Mov 4, Sys32md
Mage Cpsy~c, A2
LDR Kis, VSR- Newstatk
ver. Aew tack DED VSR Stack.
> Ftmecae and Boet loader
Fimuare $ tt Pea Low level Ajrware +Htect prowd
rar 2 ef an Enterta
Blo hardisace & He — + Tt Acseded fr tee Roma bey
Brecates when poner 78 app leect
boot loader ¢ Tes paca a Soe lect. Pnttflies tle bards
amd also Loads tbe. Operating pen.
% Femur Retiro flous é
P.T.0+Hrmware Seeedion flacot
7 wage Fealaaice
fete +
Pieper pakein |e =
: P ‘fats the harcewate &
Ae. petem egies
R plottoim Felenti4i ebion
% Diagmocties
* De Trtertace
i Gnd ta Intcsepretee
ke ABSiract His hardoan | & Hasduoan Abstract hayes
¥ dettr difreus
ehoad a bootable | x Bask fitting Sapte
Fmage
# Rblnquest. corrrol | x Alter the Pe to pofint the next
mdge.
HTC PhSt Cage PS 10 Qctop tea dan
oe +0 boost an Peath Balm oe PrePrse the
¥ Plagnesife Laptusaee promt ef apt Woy fh Fdentiytng baste
basdisase mattonctieon. :
% Ocbug nteroce 2 Tt {00 Plat{oim: ifect, Pt helps 10
find tee ind helps 40 debug Pt.
ete. Keconcl Sage fe fo abStrast He hardoar. The bardiuraee
OAbsivattisn Caper “CHAM feo Satroare Foes that C&dies the
ondertine hardcore.
Xt. HAL Lopware thak ommun
Pecatled a8 ckeviee olfuert.
feats soft Spectre barchoas"dhe herd Giage fs to loada Bootable mage , fesse fmages
axe need “pec sepeeet into tte Ram. Oz Stonply these application
fmages aaa tree 4 fiom tia ROM. ;
RelEngutl, contrpl
ett up He ficuupy Vectot table ancl moclisymn
the progam counter ri
—> ARM Ffemuware rite
ARM has developed a pienvare wacko catted pei FPimuay
Quit (Res). ‘RRs Ps” desfyned parcel iad Aka --based &mbedde
Systems othe frctudes o~nafes preces 2 technology ,
atlacdoan bearer hayes Called pa BE Cprtnd need eee
amd debug monte? calted Angel. o
XB HAL provicles a Low -level deter dafres franumoik tat allors
do Opuats brer igerent Communttation Let ces (for Sxample',
VSC, Ethernet, Or cavos). Tt also provteles a ¢tandard ner.
PPT cate to aceers He hardware «pr Hat Sepports Hose
main deateeres 3 .
—e Buster IntPlyakion : Setifng up Hu target platteim and
dan cose: “Oe em olng onl tes Ce texks 46s faeat
Platfoin , this Can CAthea” be a Ample OF ComPlechted ask.
> potted Serzal olefres t Used 40 provfde .a Baste method 4
Communttalion wsito bret .
—¥ LED Suppeit salloros Corrtrol pvea Hy LEDs P Simple ser
feedback « Thes prowites aw applfea tio tts abs (Pty Lo diplag
Opeialionas £: ;
— Tf, Suppoit 3 alto? a pertodk&e Entetupt +0 be Sedlup.
Tes PS bosent?al te preémptre Context Sustiching Operating
System Heat Aequecre “tess mechamim. nd ,
— Trilessupt Conrtrotiexs?~ Sopport for ity ere tntesp
F Controllers.# the Second 4tcchnetogy , Anger aera alain a
a host beclebsgges amda trget platfeim
'0 fnspect moctty memos | loon and beenat”
fri Get breakpoints and sey PVOcLss or Reatofer
imtent » Atl Goer Control ts gt the host Abbuaacs,
¥ Te as eae m*tok ini Aces 4p tu SutT and
Trg ov Fra ‘betes « Angel uses SLi tngteuct ors +0
Provide a Sek APD s that allow o P Pepe 40 open , Vad
and witke 1 0 best ffling Sysiem eelrre | int esup
due used 4% tommmuntcatten Pes ete the best
clebuager
Red Hct RedBoot s $
t Redbook 70a & frmuate foot deve stag by Red Hot. FH fs
ovided n Source Wuongs vt no
Pgyattes de om Pore feed. Rel Boot Re destyned 40 recute on
Afferent cpute (for Sp Stang ARI, MIPS, th and Soon)
Man fecctivres 8
teCommonttation ¢ Cc ‘mere, Foever Gertal of tdtone! Por Gestel
Ke madtern protocol used 40 Commons Feats with tHe §utu
de (606) « For Eitan Tep & eeseh 40 Communtcattr iH
Ge + RedBoot Sop a 7 network Mandaszels, fuchas
bootp, telnet OP tftp. 4
merck & Portas a Get op fflling
8s Plas Roe memot
Sugtem foutines teal can ‘oon Load , fopdat and Biase Frnaat
nglase ROM «Th asetfor the frno9) an bt be Cornp
ee temcomprevied
5 Fatt Opesatin tem Sopp ts tte lo
“noting Pees t foux, Moe tat nga sah rel hen
Popul opeeating. Kystems.
v
16* Bearples LandSiene
The Froptementatfon £0 Ge chit 40-tte ARM Evatuotor +7 Plaipim,
wien Fnclucks an A “Tower procesct “Table below ike
ths baste Clhatactostics a lew.
Feattinn Conpigciateon
send RIA Pnste ‘
Teel chatn PRM Oeverpu Sublet er
Tage Wy sto bytes
Sousee It kb
Memoty hora pped-
* CondStone Dieecthy assocet
The Afrectoty Shuctun fav Liorm Fn ffrersy below =the Qresstes
Otlos A Ctandard Style Mab areas? Contras 40 cust fn frre
ae tts Coydstone. Sour fe land. Po Located inde
te Land [butid (exc Brectory.
reg Ly :
ee ey
‘eHe7 (obj) Ciiaga hogs tos. bin
-+
. Gand .¢ .
. Land Hh ene Code Lhuctuse
Lamdetime Conscr oa Angle ansembly ffle the fle Shreretur.
¥ brovendousn Gato ares Hleps iebsre Cock Glep Correspm
A849 Rage tn te. Bye atten flow of Samdlstore ,Loma Llore Qreeutfen Plow
Step Deseatpton
\. Take the Reset Exception
2. Pract SPA Ga thor “He hasdeusaee
8. Pema memory
4. Thee Communteodfon Pasdusare
S- Boot Wactes— Copy payleod and Acling ufc eontrot.
Steps take tt Reset Ceeeptfeng
Execatfon begfne whin a Reset Beceptfor . Tt Petes Very Arce
fnstuctioh Kenreted. andaon - Bast Pe tocateHat
adders, 00000000 :
Gepi Clos FnPlhatfon tee hasdwases
Ele prKuos plase fa PnPHFIR adtfsn Tog hardwase Ps Se th'ng op
Syste sgpthese ribose Reggeters hart to be Geto Oe
abcesseng 9 tee hatdeveee’. for RX Ett. ARM Evaluator -#T has
O Oover Veaenenit Afsplay obfou ive Cave Chovten 40 be used af
O feedback’ toot +0 Frcleats the ffermuvare fe actire .
i) agaactt ad drest OX03 FPO000, Anco ics places cu tht hardens
System Reafiter’ awa, Prom bork ROMAnd Pat « Lepeta Bo the
Poriplerale And memory,
£iep3s Remap memory? ie
One & Hla maies acttertes oy Lasdusase IPtiiRodfon 2¢ eet op te
membry Grelensnent. Lamdtone Fe destaned 40 PPE Cepwa
ard Semap. memosy ote plat{pine w fn a Known memety
Bab .aS Prown {in Table.[Vdable We Intifod memory Aa .
temoty type “tart addves — End adders Pic
Flash pore Oy 00600000 Ox00080000 52K
SAM bank Onavaflable UOnavatlable 256K
SRAM bank! UnovoFlable Pnavollable 256K,
nec eeee = ——
In thes Grep Code egnefet aytwo past
The $01 past Atte Cocke calculates tis absolut adolvess gtte
Aoutfne befote w Aemmoppfng takes place . This addres Fe used by
Hone “tofomp tot net Routine tn tte new Rmapped
4nfeonment «the Qecend past Casafes out the memoiy Semoppir
“ha new memety-map dota PS laced Into Aegchers “21 to 212,
Tale 10.5” ‘Rernappfing
‘Type Pract addees —_ Endiactdvers "Pye
Flash Row Ox 01300000 O¥.01880000 SDK
Ram bankO 9 x00090000 px g0010000 = BGK
SRAM bank! =O L0090H ODO 9% 00080008 O56R
Gepys Tnttlifye CommonPeotfon Hardware
Communfcalton EnPlilPaactfon Gnvolves ay anaes a Gevral
Pett and outpatting a Glandard banner bannet ff used 10
SOO that teu 6f WALL 1 dutty fometfona amd Mempty hag been
Successpetty § Aemappect
The Serta post Po St40 4600 baud no pastiy » me Bop. bFt and
Ao flowo Control «Tha Gertal cabel Pe attactsc, to 422 boatd ,
Flan Ru host terminal hat 0 be Conpigrusd with these Petits,
Peps: Boot loacker — Copy poyloact and Retingutch Controt
tte nod A Prvotves Copying a payload and Aalfnguren
ota ae ova 40 ts Copied fea “the fst Patt op He
Code Gels up tha seqisteus ¥1>,413,A14 sed Yn Yee block Copy,
19Destinatren Req kere £3 pohts 10 tu Bact 6 oe aan
te Com evel lei BIA Points +0 tte. Bnet
Using those Remfiters ee Ps tan topfed nto eae
20