Bootstrap loader
ST10F276
5.3.5
This process may go through several iterations or may directly execute the final application.
In all cases the ST10F276 still runs in BSL mode, that is, with the watchdog timer disabled
and limited access to the internal Flash area. All code fetches from the internal IFLASH area
(01’0000H...08’FFFFH) are redirected to the special Test-Flash. Data read operations
access the internal Flash of the ST10F276.
Choosing the baud rate for the BSL via UART
The calculation of the serial baud rate for ASC0 from the length of the first zero byte that is
received allows the operation of the bootstrap loader of the ST10F276 with a wide range of
baud rates. However, the upper and lower limits must be kept to ensure proper data transfer.
BST10F276
=
---------------f--C----P----U-----------------
32 ⋅ (S0BRL + 1)
The ST10F276 uses timer T6 to measure the length of the initial zero byte. The quantization
uncertainty of this measurement implies the first deviation from the real baud rate; the next
deviation is implied by the computation of the S0BRL reload value from the timer contents.
The formula below shows the association:
S0BRL = T-----6----–-----3---6--
72
,
T6
=
9--
4
⋅
--f-C----P----U----
BHost
For a correct data transfer from the host to the ST10F276, the maximum deviation between
the internal initialized baud rate for ASC0 and the real baud rate of the host should be below
2.5%. The deviation (FB, in percent) between host baud rate and ST10F276 baud rate can
be calculated using the formula below:
Note:
Function (FB) does not consider the tolerances of oscillators and other devices supporting
the serial communication.
This baud rate deviation is a nonlinear function depending on the CPU clock and the baud
rate of the host. The maxima of the function (FB) increases with the host baud rate due to
the smaller baud rate prescaler factors and the implied higher quantization error (see
Figure 10).
Figure 10. Baud rate deviation between host and ST10F276
I
FB
2.5%
BLow
BHigh
II
BHOST
The minimum baud rate (BLow in Figure 10) is determined by the maximum count capacity
of timer T6, when measuring the zero byte, that is, it depends on the CPU clock. Using the
maximum T6 count 216 in the formula the minimum baud rate is calculated. The lowest
56/229