{"id":123582,"date":"2026-11-07T18:25:31","date_gmt":"2026-11-07T10:25:31","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/123582.html"},"modified":"2026-11-07T18:25:31","modified_gmt":"2026-11-07T10:25:31","slug":"stm32%e5%86%85%e9%83%a8flash%ef%bc%88stm32%e6%a0%87%e5%87%86%e5%ba%93%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/123582.html","title":{"rendered":"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09"},"content":{"rendered":"<p>\u5728\u4e0a\u4e00\u7ae0\u300aSTM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\u300b\u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 WDG \u770b\u95e8\u72d7&#xff0c;\u638c\u63e1\u4e86\u5982\u4f55\u901a\u8fc7\u72ec\u7acb\u770b\u95e8\u72d7\u548c\u7a97\u53e3\u770b\u95e8\u72d7\u6765\u76d1\u63a7\u7a0b\u5e8f\u8fd0\u884c\u3001\u5728\u7cfb\u7edf\u8dd1\u98de\u65f6\u53ca\u65f6\u590d\u4f4d&#xff0c;\u4ece\u800c\u63d0\u5347\u7a0b\u5e8f\u7684\u53ef\u9760\u6027\u3002\u672c\u7ae0\u6211\u4eec\u628a\u76ee\u5149\u8f6c\u5411\u53e6\u4e00\u5757\u540c\u6837\u91cd\u8981\u7684\u7247\u4e0a\u8d44\u6e90\u2014\u2014STM32 \u7684\u5185\u90e8 FLASH\u3002<\/p>\n<p>FLASH \u662f STM32 \u5b58\u653e\u7a0b\u5e8f\u4ee3\u7801\u7684\u5730\u65b9&#xff0c;\u4f46\u5b83\u5e76\u4e0d\u53ea\u662f\u201c\u53ea\u8bfb\u201d\u7684\u4ee3\u7801\u4ed3\u5e93&#xff1a;\u5229\u7528\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\u5269\u4f59\u7684\u7a7a\u95f4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4fdd\u5b58\u6389\u7535\u4e0d\u4e22\u5931\u7684\u7528\u6237\u6570\u636e&#xff0c;\u4f8b\u5982\u7cfb\u7edf\u914d\u7f6e\u53c2\u6570\u3001\u6821\u51c6\u7cfb\u6570\u3001\u8fd0\u884c\u8ba1\u6570\u7b49&#xff1b;\u66f4\u8fdb\u4e00\u6b65&#xff0c;\u8fd8\u53ef\u4ee5\u901a\u8fc7 IAP&#xff08;\u5728\u7a0b\u5e8f\u4e2d\u7f16\u7a0b&#xff09;\u5b9e\u73b0\u7a0b\u5e8f\u7684\u81ea\u6211\u66f4\u65b0&#xff0c;\u4e3a Bootloader \u548c\u5728\u7ebf\u5347\u7ea7\u6253\u4e0b\u57fa\u7840\u3002\u672c\u7ae0\u5c06\u4ece FLASH \u7684\u5185\u90e8\u7ed3\u6784\u8bb2\u8d77&#xff0c;\u4f9d\u6b21\u4ecb\u7ecd\u95ea\u5b58\u6a21\u5757\u7ec4\u7ec7\u3001FLASH \u89e3\u9501\u4e0e\u52a0\u9501\u3001\u4f7f\u7528\u6307\u9488\u8bbf\u95ee\u5b58\u50a8\u5668\u3001\u7a0b\u5e8f\u5b58\u50a8\u5668\u7684\u7f16\u7a0b\u4e0e\u64e6\u9664\u3001\u9009\u9879\u5b57\u8282\u4ee5\u53ca\u5668\u4ef6\u7535\u5b50\u7b7e\u540d&#xff0c;\u6700\u540e\u901a\u8fc7\u201c\u8bfb\u5199\u5185\u90e8 FLASH\u201d\u548c\u201c\u8bfb\u53d6\u82af\u7247 ID\u201d\u4e24\u4e2a\u5b9e\u4f8b&#xff0c;\u628a\u6807\u51c6\u5e93\u51fd\u6570\u771f\u6b63\u7528\u8d77\u6765\u3002<\/p>\n<p>\u9605\u8bfb\u672c\u7ae0\u5efa\u8bae\u7ed3\u5408 STM32F1 \u53c2\u8003\u624b\u518c\u4e2d\u7684\u95ea\u5b58\u7ae0\u8282\u4e00\u8d77\u770b&#xff0c;\u91cd\u70b9\u5173\u6ce8\u89e3\u9501\u5e8f\u5217\u3001\u64e6\u9664\u4e0e\u7f16\u7a0b\u7684\u5148\u540e\u987a\u5e8f&#xff0c;\u4ee5\u53ca\u64e6\u5199\u6b21\u6570\u548c\u5b58\u50a8\u533a\u89c4\u5212\u8fd9\u4e24\u4e2a\u5bb9\u6613\u8e29\u5751\u7684\u5730\u65b9\u3002\u4e0b\u9762\u6b63\u5f0f\u5f00\u59cb\u3002<\/p>\n<p style=\"margin-left:0.0001pt;text-align:justify\">\u5982\u679c\u89c9\u5f97\u6709\u6536\u83b7\u53ef\u4ee5\u4e3a\u6211\u7684\u6587\u7ae0\u70b9\u70b9\u5c0f\u8d5e&#xff0c;\u8fd9\u5c06\u6fc0\u52b1\u6211\u521b\u4f5c\u66f4\u597d\u7684\u5185\u5bb9&#xff01;\u8c22\u8c22&#xff01;<\/p>\n<h3 style=\"margin-left:0.0001pt;text-align:justify\">\u4e00\u3001STM32\u5185\u90e8FLASH\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0<\/h3>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.1 FLASH\u7b80\u4ecb<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">STM32F1\u7cfb\u5217\u7684FLASH\u5305\u542b\u7a0b\u5e8f\u5b58\u50a8\u5668\u3001\u7cfb\u7edf\u5b58\u50a8\u5668\u548c\u9009\u9879\u5b57\u8282\u4e09\u4e2a\u90e8\u5206&#xff0c;\u901a\u8fc7\u95ea\u5b58\u5b58\u50a8\u5668\u63a5\u53e3&#xff08;\u5916\u8bbe&#xff09;\u53ef\u4ee5\u5bf9\u7a0b\u5e8f\u5b58\u50a8\u5668\u548c\u9009\u9879\u5b57\u8282\u8fdb\u884c\u64e6\u9664\u548c\u7f16\u7a0b<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u8bfb\u5199FLASH\u7684\u7528\u9014&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5229\u7528\u7a0b\u5e8f\u5b58\u50a8\u5668\u7684\u5269\u4f59\u7a7a\u95f4\u6765\u4fdd\u5b58\u6389\u7535\u4e0d\u4e22\u5931\u7684\u7528\u6237\u6570\u636e<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u901a\u8fc7\u5728\u7a0b\u5e8f\u4e2d\u7f16\u7a0b&#xff08;IAP&#xff09;&#xff0c;\u5b9e\u73b0\u7a0b\u5e8f\u7684\u81ea\u6211\u66f4\u65b0<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5728\u7ebf\u7f16\u7a0b&#xff08;In-Circuit Programming \u2013 ICP&#xff09;\u7528\u4e8e\u66f4\u65b0\u7a0b\u5e8f\u5b58\u50a8\u5668\u7684\u5168\u90e8\u5185\u5bb9&#xff0c;\u5b83\u901a\u8fc7JTAG\u3001SWD\u534f\u8bae\u6216\u7cfb\u7edf\u52a0\u8f7d\u7a0b\u5e8f&#xff08;Bootloader&#xff09;\u4e0b\u8f7d\u7a0b\u5e8f<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5728\u7a0b\u5e8f\u4e2d\u7f16\u7a0b&#xff08;In-Application Programming \u2013 IAP&#xff09;\u53ef\u4ee5\u4f7f\u7528\u5fae\u63a7\u5236\u5668\u652f\u6301\u7684\u4efb\u4e00\u79cd\u901a\u4fe1\u63a5\u53e3\u4e0b\u8f7d\u7a0b\u5e8f<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.2 \u95ea\u5b58\u6a21\u5757\u7ec4\u7ec7<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102525-6aeefc958b99d.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.3 FLASH\u57fa\u672c\u7ed3\u6784<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102525-6aeefc95c74fe.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.4 FLASH\u89e3\u9501<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">FPEC\u5171\u6709\u4e09\u4e2a\u952e\u503c&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">RDPRT\u952e &#061; 0x000000A5<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">KEY1 &#061; 0x45670123<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">KEY2 &#061; 0xCDEF89AB<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u89e3\u9501&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u590d\u4f4d\u540e&#xff0c;FPEC\u88ab\u4fdd\u62a4&#xff0c;\u4e0d\u80fd\u5199\u5165FLASH_CR<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5728FLASH_KEYR\u5148\u5199\u5165KEY1&#xff0c;\u518d\u5199\u5165KEY2&#xff0c;\u89e3\u9501<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u9519\u8bef\u7684\u64cd\u4f5c\u5e8f\u5217\u4f1a\u5728\u4e0b\u6b21\u590d\u4f4d\u524d\u9501\u6b7bFPEC\u548cFLASH_CR<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u52a0\u9501&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u8bbe\u7f6eFLASH_CR\u4e2d\u7684LOCK\u4f4d\u9501\u4f4fFPEC\u548cFLASH_CR<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.5 \u4f7f\u7528\u6307\u9488\u8bbf\u95ee\u5b58\u50a8\u5668<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u4f7f\u7528\u6307\u9488\u8bfb\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u5b58\u50a8\u5668&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">uint16_t Data &#061; *((__IO uint16_t *)(0x08000000));<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u4f7f\u7528\u6307\u9488\u5199\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u5b58\u50a8\u5668&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">*((__IO uint16_t *)(0x08000000)) &#061; 0x1234;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5176\u4e2d&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">#define __IO volatile<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.6 \u7a0b\u5e8f\u5b58\u50a8\u5668\u7f16\u7a0b<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102525-6aeefc95efdaa.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.7 \u7a0b\u5e8f\u5b58\u50a8\u5668\u9875\u64e6\u9664<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc960f8b0.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.8 \u7a0b\u5e8f\u5b58\u50a8\u5668\u5168\u64e6\u9664<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc9623a42.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.9 \u9009\u9879\u5b57\u8282<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc96367fa.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">RDP&#xff1a;\u5199\u5165RDPRT\u952e&#xff08;0x000000A5&#xff09;\u540e\u89e3\u9664\u8bfb\u4fdd\u62a4<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">USER&#xff1a;\u914d\u7f6e\u786c\u4ef6\u770b\u95e8\u72d7\u548c\u8fdb\u5165\u505c\u673a\/\u5f85\u673a\u6a21\u5f0f\u662f\u5426\u4ea7\u751f\u590d\u4f4d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">Data0\/1&#xff1a;\u7528\u6237\u53ef\u81ea\u5b9a\u4e49\u4f7f\u7528<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">WRP0\/1\/2\/3&#xff1a;\u914d\u7f6e\u5199\u4fdd\u62a4&#xff0c;\u6bcf\u4e00\u4e2a\u4f4d\u5bf9\u5e94\u4fdd\u62a44\u4e2a\u5b58\u50a8\u9875&#xff08;\u4e2d\u5bb9\u91cf&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.10 \u9009\u9879\u5b57\u8282\u7f16\u7a0b<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">1.\u68c0\u67e5FLASH_SR\u7684BSY\u4f4d&#xff0c;\u4ee5\u786e\u8ba4\u6ca1\u6709\u5176\u4ed6\u6b63\u5728\u8fdb\u884c\u7684\u7f16\u7a0b\u64cd\u4f5c<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">2.\u89e3\u9501FLASH_CR\u7684OPTWRE\u4f4d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">3.\u8bbe\u7f6eFLASH_CR\u7684OPTPG\u4f4d\u4e3a1<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">4.\u5199\u5165\u8981\u7f16\u7a0b\u7684\u534a\u5b57\u5230\u6307\u5b9a\u7684\u5730\u5740<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">5.\u7b49\u5f85BSY\u4f4d\u53d8\u4e3a0<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">6.\u8bfb\u51fa\u5199\u5165\u7684\u5730\u5740\u5e76\u9a8c\u8bc1\u6570\u636e<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.11 \u9009\u9879\u5b57\u8282\u64e6\u9664<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">1.\u68c0\u67e5FLASH_SR\u7684BSY\u4f4d&#xff0c;\u4ee5\u786e\u8ba4\u6ca1\u6709\u5176\u4ed6\u6b63\u5728\u8fdb\u884c\u7684\u95ea\u5b58\u64cd\u4f5c<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">2.\u89e3\u9501FLASH_CR\u7684OPTWRE\u4f4d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">3.\u8bbe\u7f6eFLASH_CR\u7684OPTER\u4f4d\u4e3a1<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">4.\u8bbe\u7f6eFLASH_CR\u7684STRT\u4f4d\u4e3a1<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">5.\u7b49\u5f85BSY\u4f4d\u53d8\u4e3a0<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">6.\u8bfb\u51fa\u88ab\u64e6\u9664\u7684\u9009\u62e9\u5b57\u8282\u5e76\u505a\u9a8c\u8bc1<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.12 \u5668\u4ef6\u7535\u5b50\u7b7e\u540d<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7535\u5b50\u7b7e\u540d\u5b58\u653e\u5728\u95ea\u5b58\u5b58\u50a8\u5668\u6a21\u5757\u7684\u7cfb\u7edf\u5b58\u50a8\u533a\u57df&#xff0c;\u5305\u542b\u7684\u82af\u7247\u8bc6\u522b\u4fe1\u606f\u5728\u51fa\u5382\u65f6\u7f16\u5199&#xff0c;\u4e0d\u53ef\u66f4\u6539&#xff0c;\u4f7f\u7528\u6307\u9488\u8bfb\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u5b58\u50a8\u5668\u53ef\u83b7\u53d6\u7535\u5b50\u7b7e\u540d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u95ea\u5b58\u5bb9\u91cf\u5bc4\u5b58\u5668&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u57fa\u5730\u5740&#xff1a;0x1FFF F7E0<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5927\u5c0f&#xff1a;16\u4f4d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u4ea7\u54c1\u552f\u4e00\u8eab\u4efd\u6807\u8bc6\u5bc4\u5b58\u5668&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u57fa\u5730\u5740&#xff1a; 0x1FFF F7E8<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u5927\u5c0f&#xff1a;96\u4f4d<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.13 \u5b9e\u4f8b\u4e00 15.1.1 \u8bfb\u5199\u5185\u90e8FLASH<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc964602d.png\" \/><\/p>\n<h5 style=\"margin-left:0.0001pt;text-align:justify\"><span style=\"color:#1a439c\">\u8bfb\u5199\u5185\u90e8FLASH\u7684\u7a0b\u5e8f\u7ed3\u6784<\/span><\/h5>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e00\u6b65&#xff0c;\u5efa\u7acb\u4e00\u4e2a\u5e95\u5c42\u6a21\u5757&#xff0c;\u6700\u5e95\u5c42\u662fMyFLASH&#xff0c;\u8981\u5b9e\u73b0\u95ea\u5b58\u6700\u57fa\u672c\u76843\u4e2a\u529f\u80fd&#xff1a;\u8bfb\u53d6\u3001\u64e6\u9664\u548c\u7f16\u7a0b&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e8c\u6b65&#xff0c;\u5728MyFLASH\u4ee3\u7801\u6a21\u5757\u7684\u57fa\u7840\u4e0a&#xff0c;\u518d\u5efa\u4e00\u4e2aStore\u6a21\u5757&#xff0c;\u4e3b\u8981\u5b9e\u73b0\u53c2\u6570\u6570\u636e\u7684\u8bfb\u5199\u548c\u5b58\u50a8\u7ba1\u7406&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u6700\u540e&#xff0c;\u5c31\u662fmain.c\u91cc\u9762\u7684\u5e94\u7528\u5c42\u90e8\u5206&#xff0c;\u60f3\u8981\u4fdd\u5b58\u53c2\u6570&#xff0c;\u5c31\u5199\u5230Store\u5c42\u7684\u6570\u7ec4&#xff0c;\u518d\u8c03\u7528\u4fdd\u5b58\u51fd\u6570&#xff0c;\u5907\u4efd\u5230\u95ea\u5b58\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u8bfb\u5199\u5185\u90e8\u95ea\u5b58\u7684\u57fa\u672c\u6d41\u7a0b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u9996\u5148&#xff0c;\u95ea\u5b58\u5e76\u4e0d\u9700\u8981\u521d\u59cb\u5316&#xff0c;\u76f4\u63a5\u64cd\u4f5c\u5373\u53ef&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e00\u6b65&#xff0c;\u8bfb\u53d6\u6570\u636e&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e8c\u6b65&#xff0c;\u89e3\u9501&#xff0c;\u89e3\u9664FLASH\u5199\u4fdd\u62a4&#xff0c;\u64e6\u9664\u95ea\u5b58\u6570\u636e&#xff0c;\u9009\u62e9\u5168\u64e6\u9664\u6216\u662f\u9875\u64e6\u9664&#xff0c;\u7136\u540e\u52a0\u9501&#xff0c;\u6062\u590d\u5199\u4fdd\u62a4&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e09\u6b65&#xff0c;\u7f16\u7a0b\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u53ef\u80fd\u7528\u5230\u7684<span style=\"color:#0000ff\">FLASH<\/span>\u5e93\u51fd\u6570:<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u89e3\u9501\u5185\u90e8FLASH<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void FLASH_Unlock(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u52a0\u9501\u5185\u90e8FLASH<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void FLASH_Lock(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u64e6\u9664\u5185\u90e8\u95ea\u5b58\u7684\u67d0\u4e00\u9875<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_ErasePage(uint32_t Page_Address);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u64e6\u9664\u5168\u90e8\u7684\u5185\u90e8\u95ea\u5b58<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_EraseAllPages(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u64e6\u9664\u9009\u9879\u5b57\u8282<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_EraseOptionBytes(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u5728\u6307\u5b9a\u5730\u5740\u5199\u5165\u5b57\u3001\u5728\u6307\u5b9a\u5730\u5740\u5199\u5165\u534a\u5b57<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u5199\u5165\u9009\u9879\u5b57\u8282\u7684\u81ea\u5b9a\u4e49Data0\u4e0eData1<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_ProgramOptionByteData(uint32_t Address, uint8_t Data);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u5199\u5165\u9009\u9879\u5b57\u8282\u7684\u5199\u4fdd\u62a4<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_EnableWriteProtection(uint32_t FLASH_Pages);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u5199\u5165\u9009\u9879\u5b57\u8282\u7684\u8bfb\u4fdd\u62a4<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_ReadOutProtection(FunctionalState NewState);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u5199\u5165\u9009\u9879\u5b57\u8282\u7684\u7528\u6237\u9009\u9879\u7684\u4e09\u4e2a\u914d\u7f6e\u4f4d<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_UserOptionByteConfig(uint16_t OB_IWDG, uint16_t OB_STOP, uint16_t OB_STDBY);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u83b7\u53d6\u9009\u9879\u5b57\u8282\u5f53\u524d\u7684\u72b6\u6001\u2014\u2014\u83b7\u53d6\u7528\u6237\u9009\u9879\u7684\u4e09\u4e2a\u914d\u7f6e\u4f4d<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">uint32_t FLASH_GetUserOptionByte(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u83b7\u53d6\u9009\u9879\u5b57\u8282\u5f53\u524d\u7684\u72b6\u6001\u2014\u2014\u83b7\u53d6\u5199\u4fdd\u62a4\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">uint32_t FLASH_GetWriteProtectionOptionByte(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u83b7\u53d6\u9884\u53d6\u7f13\u51b2\u533a\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FlagStatus FLASH_GetPrefetchBufferStatus(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u4e2d\u65ad\u4f7f\u80fd<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u83b7\u53d6\u6807\u5fd7\u4f4d\u3001\u6e05\u9664\u6807\u5fd7\u4f4d<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void FLASH_ClearFlag(uint32_t FLASH_FLAG);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u83b7\u53d6\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_GetStatus(void);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u7b49\u5f85\u4e0a\u4e00\u6b21\u64cd\u4f5c\/\u7b49\u5f85\u5fd9<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#0000ff\">STM32\u5185\u90e8\u95ea\u5b58\u7684\u6570\u636e\u662f\u4ee5\u5c0f\u7aef\u6a21\u5f0f\u5b58\u50a8\u7684&#xff0c;\u4e5f\u5c31\u662f\u4f4e\u4f4d\u5b57\u8282\u5b58\u50a8\u5728\u4f4e\u4f4d\u5730\u5740&#xff0c;\u4f8b\u5982\u5730\u57400x0800 0000\u5b58\u6709\u4e00\u4e2a\u5b57\u7684\u6570\u636e0x2000 0660&#xff0c;\u5b9e\u9645\u4e0a\u6570\u636e\u201c0x2000 0660\u201d\u5728\u5b58\u50a8\u5668\u7684\u5730\u5740\u7531\u4f4e\u5230\u9ad8\u662f\u4ee50660 0002\u7684\u987a\u5e8f\u5b58\u653e\u7684<\/span><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc966529d.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#0000ff\">\u53ef\u4ee5\u5728Keil\u8f6f\u4ef6\u8bbe\u7f6e\u5199\u5165\u7a0b\u5e8f\u4f7f\u7528\u7684ROM\u548cRAM\u7684\u8d77\u59cb\u5730\u5740\u548c\u7a0b\u5e8f\u53ef\u4f7f\u7528\u7684\u5b58\u50a8\u5927\u5c0f<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">MyFLASH.h<\/span><span style=\"color:#7030a0\">\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#ifndef __MYFLASH_H<br \/>\n#define __MYFLASH_H<br \/>\nuint32_t MyFLASH_ReadWord(uint32_t Address);<br \/>\nuint16_t MyFLASH_ReadHalfWord(uint32_t Address);<br \/>\nuint8_t MyFLASH_ReadByte(uint32_t Address);<br \/>\nvoid MyFLASH_EraseAllPages(void);<br \/>\nvoid MyFLASH_ErasePage(uint32_t PageAddress);<br \/>\nvoid MyFLASH_ProgramWord(uint32_t Address,uint32_t Data);<br \/>\nvoid MyFLASH_ProgramHalfWord(uint32_t Address,uint16_t Data);<br \/>\n#endif<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">MyFLASH.c\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u8bfb\u53d6\u4e00\u4e2a32\u4f4d\u7684\u5b57<br \/>\n\u53c2    \u6570&#xff1a;Address \u8981\u8bfb\u53d6\u6570\u636e\u7684\u5b57\u5730\u5740<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u6570\u636e<br \/>\n*\/<br \/>\nuint32_t MyFLASH_ReadWord(uint32_t Address)<br \/>\n{<br \/>\nreturn *((__IO uint32_t *)(Address));\/\/\u4f7f\u7528\u6307\u9488\u8bbf\u95ee\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u6570\u636e\u5e76\u8fd4\u56de<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u8bfb\u53d6\u4e00\u4e2a16\u4f4d\u7684\u534a\u5b57<br \/>\n\u53c2    \u6570&#xff1a;Address \u8981\u8bfb\u53d6\u6570\u636e\u7684\u534a\u5b57\u5730\u5740<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u6570\u636e<br \/>\n*\/<br \/>\nuint16_t MyFLASH_ReadHalfWord(uint32_t Address)<br \/>\n{<br \/>\nreturn *((__IO uint16_t *)(Address));\/\/\u4f7f\u7528\u6307\u9488\u8bbf\u95ee\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u6570\u636e\u5e76\u8fd4\u56de<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u8bfb\u53d6\u4e00\u4e2a8\u4f4d\u7684\u5b57\u8282<br \/>\n\u53c2    \u6570&#xff1a;Address \u8981\u8bfb\u53d6\u6570\u636e\u7684\u5b57\u8282\u5730\u5740<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u6570\u636e<br \/>\n*\/<br \/>\nuint8_t MyFLASH_ReadByte(uint32_t Address)<br \/>\n{<br \/>\nreturn *((__IO uint8_t *)(Address));\/\/\u4f7f\u7528\u6307\u9488\u8bbf\u95ee\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u6570\u636e\u5e76\u8fd4\u56de<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u5168\u64e6\u9664<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n\u8bf4    \u660e&#xff1a;\u8c03\u7528\u6b64\u51fd\u6570\u540e&#xff0c;FLASH\u7684\u6240\u6709\u9875\u90fd\u4f1a\u88ab\u64e6\u9664&#xff0c;\u5305\u62ec\u7a0b\u5e8f\u6587\u4ef6\u672c\u8eab&#xff0c;\u64e6\u9664\u540e&#xff0c;\u7a0b\u5e8f\u5c06\u4e0d\u590d\u5b58\u5728<br \/>\n*\/<br \/>\nvoid MyFLASH_EraseAllPages(void)<br \/>\n{<br \/>\nFLASH_Unlock();\/\/\u89e3\u9501<br \/>\nFLASH_EraseAllPages();\/\/\u5168\u64e6\u9664<br \/>\nFLASH_Lock();\/\/\u52a0\u9501<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u9875\u64e6\u9664<br \/>\n\u53c2    \u6570&#xff1a;PageAddress \u8981\u64e6\u9664\u9875\u7684\u9875\u5730\u5740<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid MyFLASH_ErasePage(uint32_t PageAddress)<br \/>\n{<br \/>\nFLASH_Unlock();\/\/\u89e3\u9501<br \/>\nFLASH_ErasePage(PageAddress);\/\/\u9875\u64e6\u9664<br \/>\nFLASH_Lock();\/\/\u52a0\u9501<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u7f16\u7a0b\u5b57<br \/>\n\u53c2    \u6570&#xff1a;Address \u8981\u5199\u5165\u6570\u636e\u7684\u5b57\u5730\u5740<br \/>\n\u53c2    \u6570&#xff1a;Data \u8981\u5199\u5165\u768432\u4f4d\u6570\u636e<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid MyFLASH_ProgramWord(uint32_t Address,uint32_t Data)<br \/>\n{<br \/>\nFLASH_Unlock();\/\/\u89e3\u9501<br \/>\nFLASH_ProgramWord(Address,Data);\/\/\u7f16\u7a0b\u5b57<br \/>\nFLASH_Lock();\/\/\u52a0\u9501<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;FLASH\u7f16\u7a0b\u534a\u5b57<br \/>\n\u53c2    \u6570&#xff1a;Address \u8981\u5199\u5165\u6570\u636e\u7684\u534a\u5b57\u5730\u5740<br \/>\n\u53c2    \u6570&#xff1a;Data \u8981\u5199\u5165\u768416\u4f4d\u6570\u636e<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid MyFLASH_ProgramHalfWord(uint32_t Address,uint16_t Data)<br \/>\n{<br \/>\nFLASH_Unlock();\/\/\u89e3\u9501<br \/>\nFLASH_ProgramHalfWord(Address,Data);\/\/\u7f16\u7a0b\u534a\u5b57<br \/>\nFLASH_Lock();\/\/\u52a0\u9501<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">Store.h\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#ifndef __STORE_H<br \/>\n#define __STORE_H<br \/>\nextern uint16_t Store_Data[];<br \/>\nvoid Store_Init(void);<br \/>\nvoid Store_Save(void);<br \/>\nvoid Store_Clear(void);<br \/>\n#endif<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">Store.c\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n#include &#034;MyFLASH.h&#034;<br \/>\n#define STORE_START_ADDRESS   0x0800FC00\/\/\u5b58\u50a8\u7684\u8d77\u59cb\u5730\u5740<br \/>\n#define STORE_COUNT           512\/\/\u5b58\u50a8\u6570\u636e\u7684\u4e2a\u6570<br \/>\nuint16_t Store_Data[STORE_COUNT];\/\/\u5b9a\u4e49SRAM\u6570\u7ec4<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;\u53c2\u6570\u5b58\u50a8\u6a21\u5757\u521d\u59cb\u5316<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n\/<br \/>\nvoid Store_Init(void)<br \/>\n{<br \/>\n\/\u5224\u65ad\u662f\u4e0d\u662f\u7b2c\u4e00\u6b21\u4f7f\u7528\/<br \/>\nif( MyFLASH_ReadHalfWord(STORE_START_ADDRESS) !&#061; 0xA5A5 )<br \/>\n{<br \/>\nMyFLASH_ErasePage(STORE_START_ADDRESS);\/\/\u64e6\u9664\u6307\u5b9a\u9875<br \/>\nMyFLASH_ProgramHalfWord(STORE_START_ADDRESS,0xA5A5);\/\/\u5728\u7b2c\u4e00\u4e2a\u534a\u5b57\u5199\u5165\u81ea\u5df1\u89c4\u5b9a\u7684\u6807\u5fd7\u4f4d&#xff0c;\u7528\u4e8e\u5224\u65ad\u662f\u4e0d\u662f\u7b2c\u4e00\u6b21\u4f7f\u7528<br \/>\nfor (uint16_t i&#061;1;i&lt;STORE_COUNT;i&#043;&#043;)\/\/\u5faa\u73afSTORE_COUNT\u6b21&#xff0c;\u9664\u4e86\u7b2c\u4e00\u4e2a\u6807\u5fd7\u4f4d<br \/>\n{<br \/>\nMyFLASH_ProgramHalfWord(STORE_START_ADDRESS&#043;i2,0x0000);\/\/\u9664\u4e86\u6807\u5fd7\u4f4d\u7684\u6709\u6548\u6570\u636e\u5168\u90e8\u6e050<br \/>\n}<br \/>\n}<br \/>\n\/\u4e0a\u7535\u65f6&#xff0c;\u5c06\u95ea\u5b58\u6570\u636e\u52a0\u8f7d\u56deSRAM\u6570\u7ec4&#xff0c;\u5b9e\u73b0SRAM\u6570\u7ec4\u7684\u6389\u7535\u4e0d\u4e22\u5931\/<br \/>\nfor (uint16_t i&#061;0;i&lt;STORE_COUNT;i&#043;&#043;)\/\/\u5faa\u73afSTORE_COUNT\u6b21&#xff0c;\u5305\u62ec\u7b2c\u4e00\u4e2a\u6807\u5fd7\u4f4d<br \/>\n{<br \/>\nStore_Data[i] &#061; MyFLASH_ReadHalfWord(STORE_START_ADDRESS&#043;i*2);\/\/\u5c06\u95ea\u5b58\u7684\u6570\u636e\u52a0\u8f7d\u56deSRAM\u6570\u7ec4<br \/>\n}<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;\u53c2\u6570\u5b58\u50a8\u6a21\u5757\u4fdd\u5b58\u6570\u636e\u5230\u95ea\u5b58<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n\/<br \/>\nvoid Store_Save(void)<br \/>\n{<br \/>\nMyFLASH_ErasePage(STORE_START_ADDRESS);\/\/\u64e6\u9664\u6307\u5b9a\u9875<br \/>\nfor (uint16_t i&#061;0;i&lt;STORE_COUNT;i&#043;&#043;)\/\/\u5faa\u73afSTORE_COUNT\u6b21&#xff0c;\u5305\u62ec\u7b2c\u4e00\u4e2a\u6807\u5fd7\u4f4d<br \/>\n{<br \/>\nMyFLASH_ProgramHalfWord(STORE_START_ADDRESS&#043;i2,Store_Data[i]);\/\/\u5c06SRAM\u6570\u7ec4\u7684\u6570\u636e\u5907\u4efd\u4fdd\u5b58\u5230\u95ea\u5b58<br \/>\n}<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;\u53c2\u6570\u5b58\u50a8\u6a21\u5757\u5c06\u6240\u6709\u6709\u6548\u6570\u636e\u6e050<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid Store_Clear(void)<br \/>\n{<br \/>\nfor (uint16_t i&#061;1;i&lt;STORE_COUNT;i&#043;&#043;)\/\/\u5faa\u73afSTORE_COUNT\u6b21&#xff0c;\u9664\u4e86\u7b2c\u4e00\u4e2a\u6807\u5fd7\u4f4d<br \/>\n{<br \/>\nStore_Data[i] &#061; 0x0000;\/\/SRAM\u6570\u7ec4\u6709\u6548\u6570\u636e\u6e050<br \/>\n}<br \/>\nStore_Save();\/\/\u4fdd\u5b58\u6570\u636e\u5230\u95ea\u5b58<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">main.c\u2193<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n#include &#034;Delay.h&#034;<br \/>\n#include &#034;OLED.h&#034;<br \/>\n#include &#034;Store.h&#034;<br \/>\n#include &#034;Key.h&#034;<br \/>\nuint8_t KeyNum;<br \/>\nint main(void)<br \/>\n{<br \/>\nOLED_Init();<br \/>\nKey_Init();<br \/>\nStore_Init();<br \/>\nOLED_ShowString(1,1,&#034;Flag:&#034;);<br \/>\nOLED_ShowString(2,1,&#034;Data:&#034;);<br \/>\nwhile(1)<br \/>\n{<br \/>\nKeyNum &#061; Key_GetNum();<br \/>\nif (KeyNum &#061;&#061; 1)<br \/>\n{<br \/>\nStore_Data[1]&#043;&#043;;<br \/>\nStore_Data[2]&#043;&#061;2;<br \/>\nStore_Data[3]&#043;&#061;3;<br \/>\nStore_Data[4]&#043;&#061;4;<br \/>\nStore_Save();<\/p>\n<p>}<br \/>\nif (KeyNum &#061;&#061; 2)<br \/>\n{<br \/>\nStore_Clear();<br \/>\n}<\/p>\n<p>OLED_ShowHexNum(1,6,Store_Data[0],4);<br \/>\nOLED_ShowHexNum(3,1,Store_Data[1],4);<br \/>\nOLED_ShowHexNum(3,6,Store_Data[2],4);<br \/>\nOLED_ShowHexNum(4,1,Store_Data[3],4);<br \/>\nOLED_ShowHexNum(4,6,Store_Data[4],4);<br \/>\n}<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc969c2be.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\u9875\u64e6\u9664<\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102526-6aeefc96d024f.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\u5168\u64e6\u9664<\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102527-6aeefc97107e5.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\u5411\u95ea\u5b58\u7684\u6700\u540e\u4e00\u9875\u7684\u7b2c\u4e00\u4e2a\u534a\u5b57\u5199\u5165\u6807\u5fd7\u4f4dA5A5<\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102527-6aeefc9744eda.png\" \/><\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\u4f7f\u7528Store\u4ee3\u7801\u6a21\u5757\u5411\u95ea\u5b58\u7684\u6700\u540e\u4e00\u9875\u5199\u5165\u6570\u636e<\/p>\n<p style=\"margin-left:0.0001pt;text-align:center\">\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102527-6aeefc977952d.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.14 \u5b9e\u4f8b\u4e8c 15.2.1 \u8bfb\u53d6\u82af\u7247ID<\/h4>\n<p style=\"margin-left:0.0001pt;text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102528-6aeefc98edc63.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">main.c\u2193<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n#include &#034;Delay.h&#034;<br \/>\n#include &#034;OLED.h&#034;<br \/>\nint main(void)<br \/>\n{<br \/>\nOLED_Init();\/\/OLED\u521d\u59cb\u5316<br \/>\nOLED_ShowString(1,1,&#034;F_SIZE:&#034;);\/\/\u663e\u793a\u9759\u6001\u5b57\u7b26\u4e32<br \/>\nOLED_ShowHexNum(1,8,*((__IO uint16_t *)(0x1FFFF7E0)) ,4 );\/\/\u4f7f\u7528\u6307\u9488\u8bfb\u53d6\u6307\u5b9a\u5730\u5740\u4e0b\u7684\u95ea\u5b58\u5bb9\u91cf\u5bc4\u5b58\u5668<br \/>\nOLED_ShowString(2,1,&#034;U_ID:&#034;);\/\/\u663e\u793a\u9759\u6001\u5b57\u7b26\u4e32<br \/>\nOLED_ShowHexNum(2,6, *((__IO uint16_t *)(0x1FFFF7E8)) ,4 );<br \/>\nOLED_ShowHexNum(2,11, *((__IO uint16_t *)(0x1FFFF7E8 &#043; 0x02)) ,4 );<br \/>\nOLED_ShowHexNum(3,1, *((__IO uint32_t *)(0x1FFFF7E8 &#043; 0x04)) ,8 );<br \/>\nOLED_ShowHexNum(4,1, *((__IO uint32_t *)(0x1FFFF7E8 &#043; 0x08)) ,8 );<br \/>\nwhile(1)<br \/>\n{<br \/>\n}<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102529-6aeefc9916e4e.png\" \/><\/p>\n<p style=\"text-align:center\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<\/p>\n<h3>\u4e8c\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p>\u672c\u6587\u56f4\u7ed5 STM32F1 \u7cfb\u5217\u5185\u90e8 FLASH \u5c55\u5f00&#xff0c;\u4ece\u786c\u4ef6\u7ed3\u6784\u5230\u4ee3\u7801\u5b9e\u73b0\u5b8c\u6574\u68b3\u7406\u4e86\u4e00\u904d&#xff0c;\u6838\u5fc3\u5185\u5bb9\u53ef\u4ee5\u5f52\u7eb3\u4e3a\u4ee5\u4e0b\u51e0\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u7ed3\u6784\u8ba4\u77e5&#xff1a;STM32F1 \u7684 FLASH \u7531\u7a0b\u5e8f\u5b58\u50a8\u5668\u3001\u7cfb\u7edf\u5b58\u50a8\u5668\u548c\u9009\u9879\u5b57\u8282\u4e09\u90e8\u5206\u7ec4\u6210&#xff0c;\u901a\u8fc7\u95ea\u5b58\u5b58\u50a8\u5668\u63a5\u53e3&#xff08;FPEC&#xff09;\u5bf9\u7a0b\u5e8f\u5b58\u50a8\u5668\u548c\u9009\u9879\u5b57\u8282\u8fdb\u884c\u64e6\u9664\u4e0e\u7f16\u7a0b&#xff1b;\u7cfb\u7edf\u5b58\u50a8\u533a\u5219\u5b58\u653e\u51fa\u5382\u56fa\u5316\u7684 Bootloader \u548c\u5668\u4ef6\u7535\u5b50\u7b7e\u540d&#xff0c;\u4e0d\u53ef\u66f4\u6539\u3002<\/li>\n<li>\u89e3\u9501\u4e0e\u52a0\u9501&#xff1a;\u590d\u4f4d\u540e FPEC \u5904\u4e8e\u4fdd\u62a4\u72b6\u6001&#xff0c;\u5fc5\u987b\u5148\u5411 FLASH_KEYR \u4f9d\u6b21\u5199\u5165 KEY1&#xff08;0x45670123&#xff09;\u548c KEY2&#xff08;0xCDEF89AB&#xff09;\u624d\u80fd\u89e3\u9501&#xff1b;\u64cd\u4f5c\u5b8c\u6210\u540e\u5e94\u8bbe\u7f6e FLASH_CR \u7684 LOCK \u4f4d\u91cd\u65b0\u52a0\u9501\u3002\u9519\u8bef\u7684\u952e\u503c\u5e8f\u5217\u4f1a\u5728\u4e0b\u6b21\u590d\u4f4d\u524d\u9501\u6b7b FPEC&#xff0c;\u8fd9\u4e00\u70b9\u5728\u8c03\u8bd5\u65f6\u8981\u7279\u522b\u6ce8\u610f\u3002<\/li>\n<li>\u8bfb\u3001\u64e6\u3001\u5199\u4e09\u6b65\u8d70&#xff1a;\u8bfb\u53d6\u6700\u7b80\u5355&#xff0c;\u76f4\u63a5\u7528\u6307\u9488\u8bbf\u95ee\u6307\u5b9a\u5730\u5740\u5373\u53ef&#xff0c;\u914d\u5408 __IO&#xff08;volatile&#xff09;\u4fdd\u8bc1\u7f16\u8bd1\u5668\u4e0d\u4f18\u5316\u6389\u8bbf\u95ee&#xff1b;\u64e6\u9664\u5206\u4e3a\u9875\u64e6\u9664\u548c\u5168\u64e6\u9664&#xff0c;\u5168\u64e6\u9664\u4f1a\u8fde\u540c\u7a0b\u5e8f\u672c\u8eab\u4e00\u8d77\u64e6\u6389&#xff0c;\u5b9e\u9645\u4f7f\u7528\u4e2d\u5e94\u4f18\u5148\u9009\u62e9\u9875\u64e6\u9664&#xff1b;\u7f16\u7a0b\u4ee5\u534a\u5b57&#xff08;16 \u4f4d&#xff09;\u4e3a\u57fa\u672c\u5355\u4f4d&#xff0c;\u5199\u5165\u524d\u5fc5\u987b\u786e\u4fdd\u76ee\u6807\u533a\u57df\u5df2\u88ab\u64e6\u9664\u3002<\/li>\n<li>\u9009\u9879\u5b57\u8282&#xff1a;\u5305\u62ec\u8bfb\u4fdd\u62a4&#xff08;RDP&#xff09;\u3001\u7528\u6237\u9009\u9879&#xff08;USER&#xff09;\u3001\u81ea\u5b9a\u4e49\u6570\u636e&#xff08;Data0\/1&#xff09;\u548c\u5199\u4fdd\u62a4&#xff08;WRP&#xff09;&#xff0c;\u5176\u7f16\u7a0b\u4e0e\u64e6\u9664\u6d41\u7a0b\u548c\u666e\u901a\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e0d\u540c&#xff0c;\u9700\u8981\u989d\u5916\u89e3\u9501 FLASH_CR \u7684 OPTWRE \u4f4d&#xff0c;\u5e76\u901a\u8fc7 OPTPG\u3001OPTER\u3001STRT \u7b49\u63a7\u5236\u4f4d\u5b8c\u6210\u64cd\u4f5c\u3002<\/li>\n<li>\u5de5\u7a0b\u5b9e\u8df5&#xff1a;\u5b9e\u4f8b\u4e2d\u91c7\u7528\u5206\u5c42\u8bbe\u8ba1&#xff0c;\u5e95\u5c42 MyFLASH \u6a21\u5757\u5c01\u88c5\u8bfb\u53d6\u3001\u64e6\u9664\u3001\u7f16\u7a0b\u4e09\u4e2a\u57fa\u672c\u529f\u80fd&#xff0c;\u4e2d\u95f4 Store \u6a21\u5757\u8d1f\u8d23\u53c2\u6570\u6570\u636e\u7684\u8bfb\u5199\u4e0e\u5b58\u50a8\u7ba1\u7406&#xff0c;\u5e94\u7528\u5c42\u53ea\u9700\u64cd\u4f5c SRAM \u6570\u7ec4\u5e76\u8c03\u7528\u4fdd\u5b58\u51fd\u6570\u5373\u53ef\u628a\u6570\u636e\u5907\u4efd\u5230\u95ea\u5b58&#xff0c;\u4ece\u800c\u5b9e\u73b0\u53c2\u6570\u7684\u6389\u7535\u4e0d\u4e22\u5931\u3002\u8bfb\u53d6\u82af\u7247 ID \u7684\u5b9e\u4f8b\u5219\u6f14\u793a\u4e86\u5982\u4f55\u901a\u8fc7\u6307\u9488\u8bbf\u95ee\u7cfb\u7edf\u5b58\u50a8\u533a\u7684\u95ea\u5b58\u5bb9\u91cf\u5bc4\u5b58\u5668\u548c 96 \u4f4d\u552f\u4e00\u8eab\u4efd\u6807\u8bc6\u5bc4\u5b58\u5668\u3002<\/li>\n<\/ul>\n<p>\u9700\u8981\u5f3a\u8c03\u7684\u662f&#xff0c;\u5185\u90e8 FLASH \u7684\u64e6\u5199\u6b21\u6570\u6709\u9650&#xff08;\u5178\u578b\u7ea6 1 \u4e07\u6b21&#xff09;&#xff0c;\u4e14\u64e6\u9664\u64cd\u4f5c\u4f1a\u963b\u585e CPU \u6267\u884c&#xff0c;\u56e0\u6b64\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u5e94\u907f\u514d\u9891\u7e41\u5199\u5165&#xff0c;\u53ef\u7ed3\u5408\u6570\u636e\u53d8\u5316\u5224\u65ad\u3001\u5199\u5165\u95f4\u9694\u63a7\u5236\u7b49\u7b56\u7565\u5ef6\u957f\u5bff\u547d&#xff1b;\u540c\u65f6\u52a1\u5fc5\u628a\u5b58\u50a8\u533a\u89c4\u5212\u5728\u7a0b\u5e8f\u5360\u7528\u7a7a\u95f4\u4e4b\u5916&#xff0c;\u9632\u6b62\u64e6\u5199\u65f6\u7834\u574f\u7a0b\u5e8f\u4ee3\u7801\u3002<\/p>\n<p>\u638c\u63e1\u5185\u90e8 FLASH \u7684\u8bfb\u5199&#xff0c;\u4e0d\u4ec5\u80fd\u89e3\u51b3\u53c2\u6570\u4fdd\u5b58\u8fd9\u7c7b\u5e38\u89c1\u9700\u6c42&#xff0c;\u4e5f\u662f\u7406\u89e3 IAP \u5728\u7ebf\u5347\u7ea7\u3001Bootloader \u8bbe\u8ba1\u7b49\u8fdb\u9636\u5185\u5bb9\u7684\u57fa\u7840\u3002\u5efa\u8bae\u8bfb\u8005\u5148\u8dd1\u901a\u6587\u4e2d\u7684\u4e24\u4e2a\u5b9e\u4f8b&#xff0c;\u518d\u5c1d\u8bd5\u628a Store \u6a21\u5757\u6539\u9020\u6210\u652f\u6301\u591a\u7c7b\u578b\u6570\u636e&#xff08;\u5982\u7ed3\u6784\u4f53\u3001\u6d6e\u70b9\u6570&#xff09;\u7684\u901a\u7528\u53c2\u6570\u7ba1\u7406\u7ec4\u4ef6&#xff0c;\u8fdb\u4e00\u6b65\u52a0\u6df1\u7406\u89e3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e0a\u4e00\u7ae0\u300aSTM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\u300b\u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 WDG \u770b\u95e8\u72d7&#xff0c;\u638c\u63e1\u4e86\u5982\u4f55\u901a\u8fc7\u72ec\u7acb\u770b\u95e8\u72d7\u548c\u7a97\u53e3\u770b\u95e8\u72d7\u6765\u76d1\u63a7\u7a0b\u5e8f\u8fd0\u884c\u3001\u5728\u7cfb\u7edf\u8dd1\u98de\u65f6\u53ca\u65f6\u590d\u4f4d&#xff0c;\u4ece\u800c\u63d0\u5347\u7a0b\u5e8f\u7684\u53ef\u9760\u6027\u3002\u672c\u7ae0\u6211\u4eec\u628a\u76ee\u5149\u8f6c\u5411\u53e6\u4e00\u5757\u540c\u6837\u91cd\u8981\u7684\u7247\u4e0a\u8d44\u6e90\u2014\u2014STM32 \u7684\u5185\u90e8 FLASH\u3002FLASH \u662f STM32 \u5b58\u653e\u7a0b\u5e8f\u4ee3\u7801\u7684\u5730\u65b9&#xff0c;\u4f46\u5b83\u5e76\u4e0d\u53ea\u662f\u201c\u53ea\u8bfb\u201d\u7684\u4ee3\u7801\u4ed3\u5e93&#xff1a;\u5229\u7528\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\u5269\u4f59\u7684\u7a7a\u95f4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4fdd\u5b58\u6389\u7535\u4e0d\u4e22\u5931\u7684\u7528\u6237\u6570\u636e&amp;#xff0c<\/p>\n","protected":false},"author":2,"featured_media":123567,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[217,270,371,269,305],"topic":[],"class_list":["post-123582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-stm32","tag-270","tag-371","tag-269","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/123582.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u4e0a\u4e00\u7ae0\u300aSTM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\u300b\u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 WDG \u770b\u95e8\u72d7&#xff0c;\u638c\u63e1\u4e86\u5982\u4f55\u901a\u8fc7\u72ec\u7acb\u770b\u95e8\u72d7\u548c\u7a97\u53e3\u770b\u95e8\u72d7\u6765\u76d1\u63a7\u7a0b\u5e8f\u8fd0\u884c\u3001\u5728\u7cfb\u7edf\u8dd1\u98de\u65f6\u53ca\u65f6\u590d\u4f4d&#xff0c;\u4ece\u800c\u63d0\u5347\u7a0b\u5e8f\u7684\u53ef\u9760\u6027\u3002\u672c\u7ae0\u6211\u4eec\u628a\u76ee\u5149\u8f6c\u5411\u53e6\u4e00\u5757\u540c\u6837\u91cd\u8981\u7684\u7247\u4e0a\u8d44\u6e90\u2014\u2014STM32 \u7684\u5185\u90e8 FLASH\u3002FLASH \u662f STM32 \u5b58\u653e\u7a0b\u5e8f\u4ee3\u7801\u7684\u5730\u65b9&#xff0c;\u4f46\u5b83\u5e76\u4e0d\u53ea\u662f\u201c\u53ea\u8bfb\u201d\u7684\u4ee3\u7801\u4ed3\u5e93&#xff1a;\u5229\u7528\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\u5269\u4f59\u7684\u7a7a\u95f4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4fdd\u5b58\u6389\u7535\u4e0d\u4e22\u5931\u7684\u7528\u6237\u6570\u636e&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/123582.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-07T10:25:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102525-6aeefc958b99d.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/123582.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/123582.html\",\"name\":\"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-07T10:25:31+00:00\",\"dateModified\":\"2026-11-07T10:25:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/123582.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/123582.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/123582.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/123582.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u4e0a\u4e00\u7ae0\u300aSTM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\u300b\u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 WDG \u770b\u95e8\u72d7&#xff0c;\u638c\u63e1\u4e86\u5982\u4f55\u901a\u8fc7\u72ec\u7acb\u770b\u95e8\u72d7\u548c\u7a97\u53e3\u770b\u95e8\u72d7\u6765\u76d1\u63a7\u7a0b\u5e8f\u8fd0\u884c\u3001\u5728\u7cfb\u7edf\u8dd1\u98de\u65f6\u53ca\u65f6\u590d\u4f4d&#xff0c;\u4ece\u800c\u63d0\u5347\u7a0b\u5e8f\u7684\u53ef\u9760\u6027\u3002\u672c\u7ae0\u6211\u4eec\u628a\u76ee\u5149\u8f6c\u5411\u53e6\u4e00\u5757\u540c\u6837\u91cd\u8981\u7684\u7247\u4e0a\u8d44\u6e90\u2014\u2014STM32 \u7684\u5185\u90e8 FLASH\u3002FLASH \u662f STM32 \u5b58\u653e\u7a0b\u5e8f\u4ee3\u7801\u7684\u5730\u65b9&#xff0c;\u4f46\u5b83\u5e76\u4e0d\u53ea\u662f\u201c\u53ea\u8bfb\u201d\u7684\u4ee3\u7801\u4ed3\u5e93&#xff1a;\u5229\u7528\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\u5269\u4f59\u7684\u7a7a\u95f4&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4fdd\u5b58\u6389\u7535\u4e0d\u4e22\u5931\u7684\u7528\u6237\u6570\u636e&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/123582.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-07T10:25:31+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107102525-6aeefc958b99d.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/123582.html","url":"https:\/\/www.wsisp.com\/helps\/123582.html","name":"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-07T10:25:31+00:00","dateModified":"2026-11-07T10:25:31+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/123582.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/123582.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/123582.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32\u5185\u90e8FLASH\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/123582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=123582"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/123582\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/123567"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=123582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=123582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=123582"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=123582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}