Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN3156 Datasheet(PDF) 17 Page - STMicroelectronics

Part # AN3156
Description  USB DFU protocol used in the STM32 bootloader
PDF  26 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3156 Datasheet(HTML) 17 Page - STMicroelectronics

Back Button AN3156 Datasheet HTML 13Page - STMicroelectronics AN3156 Datasheet HTML 14Page - STMicroelectronics AN3156 Datasheet HTML 15Page - STMicroelectronics AN3156 Datasheet HTML 16Page - STMicroelectronics AN3156 Datasheet HTML 17Page - STMicroelectronics AN3156 Datasheet HTML 18Page - STMicroelectronics AN3156 Datasheet HTML 19Page - STMicroelectronics AN3156 Datasheet HTML 20Page - STMicroelectronics AN3156 Datasheet HTML 21Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 17 / 26 page
background image
DocID017068 Rev 4
17/26
AN3156
DFU_DNLOAD request commands
25
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 valid memory addresses (see note) in internal Flash memory, embedded RAM or
option bytes.
Note:
Refer to Section 4: DFU_UPLOAD request commands for more details about the valid
memory addresses for the device you are using.
The allowed number of bytes to be written depends on the memory target:
•
For the internal Flash memory and embedded RAM: write size can be from 2 to 2048
bytes
•
For the option bytes: write size should be equal to the option byte block size
•
For other memory locations, refer to the section "Important considerations” depending
on the product in AN2606.
Note:
A different write size is possible for the option bytes but it is recommended to write the entire
block at a time in order to ensure 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 memory operation is effectively executed only when a DFU_GETSTATUS request
is issued by the host. If the status returned by the device is not 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 byte area (in this case the device is
immediately reset after the write operation completion). If the received address is wrong or
unsupported, the device status is then (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: length of the data buffer sent by the host
–
wBlockNumber: value of the wValue parameter
If the Flash Read Protection is enabled, the Write memory operation is not performed and
the returned device status 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 bytes.
Note:
1
When writing to the RAM, you should take care not to overlap the first RAM memory used by
the bootloader firmware.
2
No error is returned when performing write operations on write protected sectors.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com