Upload
carlos-raul
View
10
Download
0
Embed Size (px)
DESCRIPTION
este archivo nos explica lo que es bootloader, como funciona, ejemplos en algunos disposivos
Citation preview
7/18/2019 bootloader funcionamiento y descripcion
1/22
Chapter 9Chapter 9
BootloaderBootloader
7/18/2019 bootloader funcionamiento y descripcion
2/22
Dr. NaimChater !, "li#e 2
Learning ObjectivesLearning Objectives
Need for a bootloader.Need for a bootloader. What happens during a reset.What happens during a reset.
Boot modes and processes.Boot modes and processes.
Memory map.Memory map.
7/18/2019 bootloader funcionamiento y descripcion
3/22
Dr. NaimChater !, "li#e $
What is the bootloaderWhat is the bootloader
When the !"# is NO$ po%ered or underWhen the !"# is NO$ po%ered or underreset the internal program memory is in areset the internal program memory is in arandom state.random state.
!M&!M&L'C
ache
L'C
ache
L(# CacheL(# Cache
L(! CacheL(! Cache
C#)C#)
Boot ConfigBoot Config
*M+,
*M+,
*#-OM*#-OM
C'((/C0((C'((/C0((
1CC1CC1CC1CC
&ddr&ddr00000000
00010001
00020002
00030003
......
7/18/2019 bootloader funcionamiento y descripcion
4/22
Dr. NaimChater !, "li#e 4
What is the bootloaderWhat is the bootloader
When the !"# is po%ered and the C#) is ta2en outWhen the !"# is po%ered and the C#) is ta2en outof reset the internal memory is still in a random stateof reset the internal memory is still in a random stateand the program %ill start running for address 3ero.and the program %ill start running for address 3ero.
!M&!M&L'C
ache
L'C
ache
L(# CacheL(# Cache
L(! CacheL(! Cache
C#)C#)
Boot ConfigBoot Config
*M+,
*M+,
*#-OM*#-OM
C'((/C0((C'((/C0((
1CC1CC1CC1CC
&ddr&ddr00000000
00010001
00020002
00030003
......
PC=0000PC=0000PC=0001PC=0001PC=0002PC=0002PC=0003PC=0003
00000000
00010001
00020002
00030003
7/18/2019 bootloader funcionamiento y descripcion
5/22
Dr. NaimChater !, "li#e %
What is the bootloaderWhat is the bootloader
With the boot4 a portion of code can beWith the boot4 a portion of code can beautomatically copied from e5ternal toautomatically copied from e5ternal tointernal memory.internal memory.
!M&!M&L'C
ache
L'C
ache
L(! CacheL(! Cache
C#)C#)
Boot ConfigBoot Config
*M+,
*M+,
*#-OM*#-OM
C'((/C0((C'((/C0((
1CC1CC1CC1CC
L(# CacheL(# Cache
7/18/2019 bootloader funcionamiento y descripcion
6/22
Dr. NaimChater !, "li#e &
What happens at reset6 "ystem timelineWhat happens at reset6 "ystem timeline
When the device is held in reset6When the device is held in reset6
$he device is initialised to the default state.$he device is initialised to the default state.
Most 78state outputs are in the high impedance state.Most 78state outputs are in the high impedance state.
!evice -eset!evice -eset
/-" pin/-" pin
C#) -esetC#) -eset
7/18/2019 bootloader funcionamiento y descripcion
7/22
Dr. NaimChater !, "li#e '
What happens at reset6 "ystem timelineWhat happens at reset6 "ystem timeline
On the rising edge of the /-" pin6On the rising edge of the /-" pin6
$he processor chec2s the boot mode configuration :!; and starts the boot loader.$he processor chec2s the boot mode configuration :!; and starts the boot loader.
$he *!M& automatically copies (? bytes from the beginning of C*( location to the internal program memory starting at address 3ero.$he *!M& automatically copies (? bytes from the beginning of C*( location to the internal program memory starting at address 3ero.
!evice -eset!evice -eset C#) -esetC#) -eset
Boot load inBoot load in
operationoperation
/-" pin/-" pin
C#) -esetC#) -eset
7/18/2019 bootloader funcionamiento y descripcion
8/22
Dr. NaimChater !, "li#e
What happens at reset6 "ystem timelineWhat happens at reset6 "ystem timeline
Once the boot loader has finished initialising the internal memory the C#) is ta2en out of reset.Once the boot loader has finished initialising the internal memory the C#) is ta2en out of reset.
$he C#) starts running from address 3ero.$he C#) starts running from address 3ero.
!evice -eset!evice -eset C#) -esetC#) -eset
Boot load inBoot load in
operationoperation
/-" pin/-" pin
C#) -esetC#) -eset
7/18/2019 bootloader funcionamiento y descripcion
9/22Dr. NaimChater !, "li#e !
@@C'(( and @C0(( Memory mapC'(( and @C0(( Memory map
$he @C'(( and @C0(( has only one$he @C'(( and @C0(( has only onememory map4 MA.memory map4 MA.
+nternal memory is al%ays located at+nternal memory is al%ays located ataddress 3ero.address 3ero.
+nternal memory can be used as either+nternal memory can be used as eitherprogram or data.program or data.
7/18/2019 bootloader funcionamiento y descripcion
10/22Dr. NaimChater !, "li#e 0
@@C'(( and @C0(( Memory mapC'(( and @C0(( Memory map
7/18/2019 bootloader funcionamiento y descripcion
11/22Dr. NaimChater !, "li#e
Boot modes and processesBoot modes and processes
$%o uestions need to be ans%ered$%o uestions need to be ans%eredabout the bootloader4 these are6about the bootloader4 these are6
What methods of boot are available andWhat methods of boot are available andho% are they selectedho% are they selected
:o% does the !"# 2no% %hat type of:o% does the !"# 2no% %hat type ofmemory it is going to boot frommemory it is going to boot from
7/18/2019 bootloader funcionamiento y descripcion
12/22Dr. NaimChater !, "li#e 2
Bootloader operational modesBootloader operational modes
$he $M"7'AC'(( and @C0(( support$he $M"7'AC'(( and @C0(( supportthe follo%ing boot configurations6the follo%ing boot configurations6
(>(> :ost #ort +nterface :#+> boot.:ost #ort +nterface :#+> boot.
'>'> 8bit -OM boot.8bit -OM boot.
7>7> (8bit -OM boot.(8bit -OM boot.
7'8bit -OM boot.7'8bit -OM boot.
Note6 %ith the @C'(( and @C0(( there is noNote6 %ith the @C'(( and @C0(( there is noDno8bootE mode as for the other @CAAADno8bootE mode as for the other @CAAAprocessors.processors.
7/18/2019 bootloader funcionamiento y descripcion
13/22Dr. NaimChater !, "li#e $
Bootloader configurationBootloader configuration
$he boot mode is selected by pulling the$he boot mode is selected by pulling the:!; high:!; highor lo% at reset.or lo% at reset.
!epending on the voltages on this pins!epending on the voltages on this pins
one of the four modes is selected.one of the four modes is selected.
Boot modeBoot mode
:#+ boot:#+ boot
8bit -OM boot8bit -OM boot
(8bit -OM boot(8bit -OM boot
7'8bit -OM boot7'8bit -OM boot
:!;
7/18/2019 bootloader funcionamiento y descripcion
14/22Dr. NaimChater !, "li#e 4
*ndianess configuration*ndianess configuration
$he endian mode is determined at the$he endian mode is determined at thesame time as boot mode.same time as boot mode.
#ulling pin :!;= high or lo% selects the#ulling pin :!;= high or lo% selects thefollo%ing endian modes.follo%ing endian modes.
!evice operation!evice operation
Big endianBig endian
Little endianLittle endian
:!;=:!;=
AA
((
Note6 ensure that the soft%are developmentNote6 ensure that the soft%are developmenttools are also configured %ith the sametools are also configured %ith the sameendian type as the hard%are.endian type as the hard%are.
7/18/2019 bootloader funcionamiento y descripcion
15/22Dr. NaimChater !, "li#e %
Cloc2 mode configurationCloc2 mode configuration
$he input cloc2 mode is also determined at$he input cloc2 mode is also determined atthe same time as boot mode.the same time as boot mode.
#ulling CL?MO!*A pin high or lo%#ulling CL?MO!*A pin high or lo%selects the follo%ing modes.selects the follo%ing modes.
#LL freuency multiplier#LL freuency multiplier
No multiplicationNo multiplication
+nput freuency is multiplied by
7/18/2019 bootloader funcionamiento y descripcion
16/22Dr. NaimChater !, "li#e &
Boot process6 :#+ boot modeBoot process6 :#+ boot mode
+n this mode the follo%ing seuence is+n this mode the follo%ing seuence isused6used6
$he C#) is held in reset %hile the remaining$he C#) is held in reset %hile the remainingof the device is released.of the device is released.
$he host processor initialises the C#)Fs$he host processor initialises the C#)Fsmemory space through the :#+.memory space through the :#+.
When all the necessary memory is initialisedWhen all the necessary memory is initialisedthe host processor ta2es the C#) out of resetthe host processor ta2es the C#) out of reset
by %riting a @(F to the !"#+N$ bit filed ofby %riting a @(F to the !"#+N$ bit filed ofthe :ost #ort +nterface Control :#+C>the :ost #ort +nterface Control :#+C>register.register.
!"#+N$ :#+C!"#+N$ :#+C
''
7/18/2019 bootloader funcionamiento y descripcion
17/22Dr. NaimChater !, "li#e '
Boot process6 :#+ boot modeBoot process6 :#+ boot mode
!M&!M&L'C
ache
L'C
ache
L(! CacheL(! Cache
C#)C#)
Boot ConfigBoot Config
*M+,
*M+,
!-&M!-&M
C'((/C0((C'((/C0((
/-"/-"
L(# CacheL(# Cache
:#+
:#+
:O"$:O"$
7/18/2019 bootloader funcionamiento y descripcion
18/22Dr. NaimChater !, "li#e
Boot process6 :#+ boot modeBoot process6 :#+ boot mode
Guestion6 :o% does the host processorGuestion6 :o% does the host processorchec2 that the memory has beenchec2 that the memory has beeninitialised correctlyinitialised correctly
&ns%er6 $he host can read and %rite to&ns%er6 $he host can read and %rite to
any address so it can chec2 by reading theany address so it can chec2 by reading the@initialisedF memory.@initialisedF memory.
7/18/2019 bootloader funcionamiento y descripcion
19/22Dr. NaimChater !, "li#e !
Boot process6 :#+ boot modeBoot process6 :#+ boot mode
Guestion6 +f an e5ternal memory needs toGuestion6 +f an e5ternal memory needs tobe initialised via the :#+ ho% do yoube initialised via the :#+ ho% do youensure that the *M+, is set correctlyensure that the *M+, is set correctly
&ns%er6 $he first thing the :ost should&ns%er6 $he first thing the :ost should
do is to %rite the *M+, register thendo is to %rite the *M+, register then%rite to the e5ternal memory locations.%rite to the e5ternal memory locations.
7/18/2019 bootloader funcionamiento y descripcion
20/22Dr. NaimChater !, "li#e 20
Boot process6 -OM boot modeBoot process6 -OM boot mode
+n this mode the follo%ing seuence is+n this mode the follo%ing seuence isused6used6
$he C#) is held in reset %hile the$he C#) is held in reset %hile thebootloader operates.bootloader operates.
$he bootloader copies (?bytes from C*($he bootloader copies (?bytes from C*(%ith the default settings to internal memory%ith the default settings to internal memoryat address 3ero.at address 3ero.
C#) is ta2en out of reset.C#) is ta2en out of reset.
C#) starts running code from address 3ero.C#) starts running code from address 3ero.
7/18/2019 bootloader funcionamiento y descripcion
21/22Dr. NaimChater !, "li#e 2
Boot process6 -OM boot modeBoot process6 -OM boot mode
!M&!M&L'C
ache
L'C
ache
L(! CacheL(! Cache
C#)C#)
Boot ConfigBoot Config
*M
+,
*M
+,
!-&M!-&M
C'((/C0((C'((/C0((
/-"/-"
L(# CacheL(# Cache
-OM-OM
1CC1CC
7/18/2019 bootloader funcionamiento y descripcion
22/22
Chapter 9Chapter 9
BootloaderBootloader8 *nd 88 *nd 8