This application note describes the features of the SystemMemory boot mode developed for
STR75x Flash microcontrollers providing all the basic functionality to support the
programming of the embedded Flash. As well as the general features, this document also
covers the specific features of the UART boot mode.
Note:The bootloader feature is unavailable on some devices soldered on development tools
(starter kits or evaluation boards). Please refer to Section 4 on page 22 for further
information.
The STR75x is usually woken up in SystemMemory boot Mode when the Flash is still not
programmed in the manufacturing line environment. In this case the system boot is
performed from SystemMemory sector in the Flash bank0. This mode allows initialization of
the Flash programming via a serial interface and the use of the Internal Free Running
Oscillator.
1.1 Entering SystemMemory boot mode
The STR75x enters the SystemMemory Boot Mode if the BOOT pins are configured as
follows:
●BOOT0 = 1
●BOOT1= 0
The value of the BOOT pin is latched on the 4th rising edge of CK_SYS after Reset.
After Reset, the STR75x CPU begins execution of the SystemMemory code which resides
in the SystemMemory sector.
Table 1.STR75x device configuration in SystemMemory Boot Mode
Feature/PeripheralStateComment
Instruction SetTHUMBSave code space with 16-bit instructions
CPU ModeSupervisorFull access with IRQ Enabled and FIQs disabled
Input Clock
UART0_RX PinInputUART0 Receive
UART0_TX PinOutputUART0 Transmit
UART0 RegistersDefaultOnly configured for UART Boot
Internal
FREEOSC
1.2 Hardware requirements
The hardware required to put the STR75x into SystemMemory boot mode consists of any
circuitry, switch, or jumper capable of holding the BOOT0 pin high and the BOOT1 pin low
during Reset.
To connect to the STR75x during SystemMemory boot mode, a RS232 serial interface must
be directly linked to UART0 pins.
For more details, refer to the STR75x hardware development getting started application note
(AN2419).
Allow a Frequency in a range of 2 to 10MHz
3/24
General descriptionAN2430
1.3 Using SystemMemory boot mode
The SystemMemory boot mode is executed from RAM and uses the last 4K of 16K RAM,
i.e. from 0x40003000 to 0x40003FFF. So when downloading code to RAM, the user has to
consider only the 12K RAM (from 0x40000000 to 0x40002FFF).
After the serial link initialization sequence (see the following chapters) the SystemMemory
code waits for the user to run some commands.
The supported commands are listed in the table below.
Table 2.Allowed commands
Command
Command
Code
Command Description
Get0x01
Read Memory0x11
Go0x21
Write Memory0x31
Erase0x43Erase from one to all the Flash sectors
Write Protection0x63
Write Unprotection0x71Temporarily disable the write protection for all Flash sectors
Readout Permanent
Protect
Readout Temporary
Unprotect
Readout Permanent
Unprotect
0x82Permanently enable the the Readout protection
0x91Temporarily disable the Readout protection
0x92Permanently disable the Readout protection
Get the SystemMemory version and the number of times
the readout protection is disabled/enabled.
Read until 256 bytes of memory starting from an address
specified by the user
Jump to an address specified by the user to execute a
loaded code
Write until 256 bytes to the RAM or the Flash starting from
an address specified by the user
Permanently enable the write protection for the needed
sectors
4/24
AN2430General description
1.4 Command description
1.4.1 Get command
Description:
This command allows the user to get the version of the bootloader, the number of times the
Readout protection is both disabled and enabled.
When the bootloader receives the Get command, it transmits four bytes to the user: the first
byte contains the version, the second contains the number of times the Readout protection
is disabled, the third contains the number of times it’s enabled and finally the ACK byte.
Figure 1.Get command flowchart
Start GC
Received byte
== 0x01?
Send the version of the bootloader
Send the number of times the Readout
protection is Disabled
Send the number of times the Readout
protection is enabled
Send ACK byte
End of GC
No
Send NACK byte
5/24
General descriptionAN2430
1.4.2 Read Memory command
Description:
This command allows the user to read the memory (RAM, Flash and registers).
When the bootloader receives the Read Memory command, it transmits the ACK byte.
After the transmission of the ACK byte, the bootloader waits for an address (4 bytes, byte 1
is the MSB and byte 4 is LSB of the address), checks this address, if the address is valid, it
transmits an ACK byte otherwise it transmits a NACK byte (0x3F) and exits from the
command.
When the address is valid, the bootloader waits for the number of bytes to be transmitted (N
bytes) and then returns to the user the needed data ((N + 1) bytes) starting from the
received address.
Figure 2.Read memory flowchart
Start RM
Received byte
== 0x11?
Send ACK byte
Receive the start address (4 bytes)
Valid Address?
Send ACK byte
Receive the number of bytes to be read
(1 byte)
Send data to the user
End of RM
No
No
Send NACK byte
6/24
AN2430General description
1.4.3 Go command
Description:
This command allows the user to execute the downloaded code or any other code by
making a branch to an address specified by the user.
When the bootloader receives the GO command, it transmits the ACK byte.
After the transmission of the ACK byte, the bootloader waits for an address (4 bytes, byte 1
is the MSB and byte 4 is LSB of the address), checks this address, if the address is valid, it
transmits an ACK byte otherwise it returns a NACK byte (0x3F) and exits from the
command.
When the address is valid, the program counter of the CPU jumps automatically to this
address. Therefore, the SystemMemory boot mode is exited.
Note:During SystemMemory mode, the CPU is in Thumb state.
Figure 3.Go command flowchart
Start GO
Received byte
== 0x21?
Send ACK byte
Receive the start address (4 bytes)
Valid Address?
Send ACK byte
Jump to start address
Exit SystemMemory
boot mode
No
No
Send NACK byte
End of GO
7/24
General descriptionAN2430
1.4.4 Write Memory command
Description:
This command allows the user to write data to any address memory (RAM, Flash or
registers).
When the bootloader receives the Write Memory command, it transmits to the user the ACK
byte.
After the transmission of the ACK byte, the bootloader waits for an address (4 bytes, byte 1
is the MSB and byte 4 is LSB of the address), checks this address, if the address is valid, it
transmits an ACK byte otherwise it returns a NACK byte (0x3F) and exits from the
command.
When the address is valid, the bootloader:
●Gets a byte which describes the amount of data to be received (N bytes),
●Receives the user data ((N + 1) bytes),
●Programs the user data to memory starting from the received address,
Finally, at the end of the command, the bootloader transmits the ACK byte if the write
operation is completed successfully otherwise a NACK byte (0x3F) is returned and the
command is exited.
8/24
Loading...
+ 16 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.