| 数据搜索系统,热门电子元器件搜索 |
|
PM0212 数据表(PDF) 19 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
PM0212 数据表(HTML) 19 Page - STMicroelectronics |
|
19 / 22 page ![]() PM0212 Programming STM8 Flash microcontrollers Doc ID 022351 Rev 2 19/22 First method The first method consists of writing directly into the Flash registers and memory locations through the write memory command of the SWIM protocol. To make sure that the CPU is not accessing the memory during block Flash programming, the core must be stalled by setting the STALL bit in the DM_CSR2 debug module register. The following sequence is required: 1. Apply a RESET 2. Activate the SWIM by sending the entry sequence on the SWIM pin 3. Activate the SWIM_CSR register by writing 1 to the DM bit in SWIM_CSR 4. Disable interrupts by setting the SAFE_MASK bit in SWIM_CSR 5. Release RESET 6. Verify the DeviceID by reading it using ROTF command 7. Send the SWIM SRST command 8. Unlock the memory by writing the MASS keys 9. Program the Flash program memory using the SWIM WOTF command Second method The second method uses the same sequence of operations as the first method except that the ICP driver firmware must be downloaded in RAM before being launched: 1. Apply a RESET 2. Activate the SWIM by sending the entry sequence on the SWIM pin 3. Activate the SWIM_CSR register by writing 1 to the DM bit in SWIM_CSR 4. Disable interrupts by setting the SAFE_MASK bit in SWIM_CSR 5. Release RESET 6. Verify the DeviceID by reading it using ROTF command 7. Send the SWIM SRST command 8. Unlock the memory by writing the MASS keys 9. Download the ICP driver firmware into the device RAM using the SWIM WOTF command 10. Execute the ICP driver: a) Modify the CPU registers (new PC, X, Y, CC...) using the WOTF commands b) Set the FLASH bit in the DM_CSR2 register c) Clear the STALL bit in the DM_CSR2 register 4.6.2 IAP method Refer to application note AN2737- Basic in-application programming example using the STM8 I2C and SPI peripherals. |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| 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 |