EasyManuals Logo

ST STM32F105 series Application Note

ST STM32F105 series
83 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #75 background imageLoading...
Page #75 background image
AN2662 DFU bootloader
Doc ID 14156 Rev 1 75/83
Device is not in the required state/status, the Host has to clear any error (DFU_CLRSTATUS
request) and get again the status till the Device returns to dfuIDLE state.
4.5.1 Write memory
The Write Memory operation is selected when wValue > 1.
The host requests the device to receive a specified number of data bytes (wLength) to load
them into internal Flash, embedded RAM (starting from 0x2000 1000) or into Option Bytes.
The allowed number of bytes to be written depends on the memory target:
For internal Flash and embedded RAM: write size can be from 2 to 2048 Bytes.
For Option Bytes: write size should be 16 Bytes.
Note: A different write size is possible for the Option Bytes but it is recommended to write the
entire block (16 bytes) at one time in order to insure data integrity. When the target is the
Option Byte area, the Address pointer must always be the start address of the Option Bytes,
otherwise, the request is not performed.
The Write operation is effectively executed only when a DFU_GETSTATUS request is
issued by the Host. If the status returned by the device is other than dfuDNBUSY, then an
error has occurred.
A second DFU_GETSTATUS request is needed to check if the command has been correctly
executed, except when the destination is the Option Bytes area (in this case the device will
immediately reset after write operation completion). If the received address is wrong or
unsupported, the device status will then be (Status = dfuERROR, State = errTARGET).
The address, to which the Host requests to write data, is computed using the value of
wBlockNumber (
wValue) and the Address Pointer according to the same formula as for an
upload request:
Address = ((wBlockNum - 2) * wTransferSize) + Addres_Pointer.
Where wTransferSize is the length of the data buffer sent by the host and wBlockNumber is
the value of
wValue parameter.
If the Flash Read Protection is enabled, the Write operation is not performed and the device
status returned is (Status = dfuERROR, State = errVENDOR) whatever the target (internal
Flash, embedded RAM or Option Bytes).
If the Write Memory command is issued to the Option byte area, all options are erased
before writing the new values, and at the end of the command the bootloader generates a
system Reset to take into account the new configuration of the option byte
Note: When writing to the RAM, care must be taken to avoid overlapping the first 4 Kbytes
(0x1000) in RAM because they are used by the bootloader firmware.
Note: No error is returned when performing write operations on write protected sectors.

Table of Contents

Other manuals for ST STM32F105 series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F105 series and is the answer not in the manual?

ST STM32F105 series Specifications

General IconGeneral
BrandST
ModelSTM32F105 series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals