Write Memory - ST STM32F105 Series Application Note

System memory boot mode
Hide thumbs Also See for STM32F105 Series:
Table of Contents

Advertisement

AN2662
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
The host requests the device to receive a specified number of data bytes (
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 (
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
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.
) and the Address Pointer according to the same formula as for an
wValue
parameter.
wValue
Doc ID 14156 Rev 1
> 1.
wValue
DFU bootloader
) to load
wLength
75/83

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Stm32f107 series

Table of Contents

Save PDF