{"id":927,"date":"2022-06-14T11:04:58","date_gmt":"2022-06-14T03:04:58","guid":{"rendered":"https:\/\/www.iotot.com\/?p=927"},"modified":"2022-06-14T11:04:58","modified_gmt":"2022-06-14T03:04:58","slug":"hal%e5%ba%93%e5%86%99flash%e6%93%8d%e4%bd%9c%e5%bc%95%e8%b5%b7%e7%9a%84%e4%b8%b2%e5%8f%a3ore%e9%94%99%e8%af%af%e4%b8%8d%e5%86%8d%e6%8e%a5%e6%94%b6%e7%9a%84%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/blog.iotot.com\/?p=927","title":{"rendered":"HAL\u5e93\u5199Flash\u64cd\u4f5c\u5f15\u8d77\u7684\u4e32\u53e3ORE\u9519\u8bef\u4e0d\u518d\u63a5\u6536\u7684\u89e3\u51b3"},"content":{"rendered":"<p>\u4e00\u3001\u95ee\u9898<\/p>\n<p>\u4f7f\u7528\u5185\u90e8EEPROM\uff08Flash\u7684\u4e00\u90e8\u5206\uff09\u50a8\u5b58\u6570\u636e\uff0c\u5728\u5199\u5165\u6570\u636e\u5230STM32L0\u5355\u7247\u673a\u65f6\uff0c\u51fa\u73b0\u4e32\u53e3\u63a5\u6536\u6570\u636e\u4e22\u5931\u751a\u81f3\u4e32\u53e3\u4e0d\u518d\u63a5\u6536\u7684\u73b0\u8c61\u3002\u5728\u6b63\u5e38\u60c5\u51b5\u4e0b\u5728\u6ca1\u6709\u5199\u6570\u636e\u5230Flash\u4e2d\u53bb\u7684\u65f6\u5019\u6240\u6709\u4e32\u53e3\u6570\u636e\u90fd\u80fd\u6b63\u5e38\u63a5\u6536\uff0c\u6ca1\u6709\u6570\u636e\u4e22\u5305\u73b0\u8c61\uff0c\u4f46\u662f\u5f53\u6267\u884c\u4e00\u6b21\u5199\u5165\u64cd\u4f5c\u5c31\u4f1a\u5bfc\u81f4\u4e32\u53e3\u6570\u636e\u4e22\u5931\uff0c\u5bfc\u81f4\u63a5\u6536ORE\u9519\u8bef\u6216\u5e27\u9519\u8bef\u7b49\u3002<\/p>\n<p>\u4e8c\u3001\u539f\u56e0<\/p>\n<p>\u7ecf\u67e5\u9605\u624b\u518c\u5f97\u77e5\u5728Flash\u5199\u5165\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\uff0c\u7cfb\u7edf\u65f6\u949f\u505c\u6b62\uff0c\u8fd9\u610f\u5473\u7740\u5199\u5165Flash\u671f\u95f4\u65e0\u6cd5\u8bbf\u95eeFlash\u4e2d\u7684\u4ee3\u7801\u548c\u6570\u636e\u3002\u9020\u6210\u4e86\u4e32\u53e3\u90a3\u8fb9RDR\u5bc4\u5b58\u5668\u6709\u503c\u4e86\uff0c\u6765\u4e0d\u53ca\u53d6\u51fa\u4e0b\u4e00\u4e2a\u503c\u88c5\u8fdb\u79fb\u4f4d\u5bc4\u5b58\u5668\u51fa\u73b0\u4e86ORE\u9519\u8bef\u3002 \u5728HAL\u5e93\u7684\u4e32\u53e3\u4e2d\u65ad\u91cc\uff0c\u5982\u679c\u51fa\u73b0ORE\u9519\u8bef\u5219\u4f1a\u5148\u53bb\u8bfb\u53d6RDR\u5bc4\u5b58\u5668\u7684\u503c\u8fdb\u5165\u4e2d\u65ad\u56de\u8c03\u51fd\u6570\u3002\u4f46\u6267\u884c\u5b8c\u4e4b\u540e\u4f1a\u5173\u95ed\u4e32\u53e3\u63a5\u6536\u4e2d\u65ad\u8fdb\u5165\u9519\u8bef\u4e2d\u65ad\u56de\u8c03\u51fd\u6570\u3002\u4e5f\u5c31\u662f\u8bf4\u7531\u4e8eORE\u9519\u8bef\u7684\u51fa\u73b0\u9020\u6210\u4e86\u63a5\u6536\u4e2d\u65ad\u5173\u95ed\u4e0d\u518d\u63a5\u6536\u7684\u73b0\u8c61\u3002\u5177\u4f53\u4e32\u53e3\u4e2d\u65ad\u5904\u7406\u53c2\u8003HAL\u5e93\u7684\u5e95\u5c42\u51fd\u6570<\/p>\n<p>void HAL_UART_IRQHandler(UART_HandleTypeDef *huart);<\/p>\n<p>\u4e09\u3001\u89e3\u51b3\u65b9\u6cd5<\/p>\n<p>\u7f16\u5199\u9519\u8bef\u4e2d\u65ad\u56de\u8c03\u51fd\u6570\u5f00\u542f\u63a5\u6536\u4e2d\u65ad\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/*******************************************************************************\r\n*\u51fd \u6570 \u540d\uff1aHAL_UART_ErrorCallback\r\n*\u529f\u80fd\u8bf4\u660e\uff1a\u4e32\u53e3\u9519\u8bef\u56de\u8c03\u51fd\u6570\r\n*\u5f62   \u53c2\uff1ahuart:\u89e6\u53d1\u4e2d\u65ad\u7684\u4e32\u53e3\r\n*\u8fd4 \u56de \u503c\uff1a\u65e0\r\n*******************************************************************************\/\r\nvoid HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)\r\n{\t\t\r\n    if (huart-&gt;Instance == USART1)\r\n    {\r\n        HAL_UART_Receive_IT(huart, &amp;gUart1.Temp, RECLEN);\r\n    }\r\n    else if (huart-&gt;Instance == USART2)\r\n    {\r\n        HAL_UART_Receive_IT(huart, &amp;gUart2.Temp, RECLEN);\r\n    }\r\n    else if (huart-&gt;Instance == USART4)\r\n    {\r\n        HAL_UART_Receive_IT(huart, &amp;gUart4.Temp, RECLEN);\r\n    }\r\n    else if(huart-&gt;Instance == USART5)\r\n    {\r\n        HAL_UART_Receive_IT(huart, &amp;gUart5.Temp, RECLEN);\r\n    }\r\n    \r\n}<\/pre>\n<p>\u4ec5\u4f9b\u53c2\u8003\uff0c\u5177\u4f53\u6839\u636e\u4e32\u53e3\u4f7f\u7528\u7684\u60c5\u51b5\u6765\u7f16\u5199\uff0c\u8fd9\u8fb9\u535a\u4e3b\u7528\u5230\u4e86\u4ee5\u4e0a\u56db\u4e2a\u4e32\u53e3\u3002\uff08\u8fd9\u8fb9\u8fd8\u6709\u4e00\u70b9\u9700\u8981\u6ce8\u610f\uff0c\u5c31\u662f\u51faORE\u9519\u8bef\u65f6\uff0c\u6ce8\u610f\u63a5\u6536\u4e2d\u65ad\u91cc\u7528\u4e8e\u5b58\u653e\u4e32\u53e3\u6570\u636e\u7684\u7f13\u51b2\uff0c\u5982\u679c\u7528\u6237\u4e00\u76f4\u5199Flash\u5219\u53ef\u80fd\u9020\u6210\u7f13\u51b2\u533a\u6ea2\u51fa\u2014\u2014\u535a\u4e3b\u7684\u5e94\u7528\u573a\u666f\u9047\u5230\uff0c\u5177\u4f53\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u5224\u65ad\uff09\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u95ee\u9898 \u4f7f\u7528\u5185\u90e8EEPROM\uff08Flash\u7684\u4e00\u90e8\u5206\uff09\u50a8\u5b58\u6570\u636e\uff0c\u5728\u5199\u5165\u6570\u636e\u5230STM32L0\u5355\u7247\u673a\u65f6\uff0c\u51fa\u73b0\u4e32\u53e3\u63a5\u6536 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts\/927"}],"collection":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=927"}],"version-history":[{"count":1,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts\/927\/revisions"}],"predecessor-version":[{"id":928,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts\/927\/revisions\/928"}],"wp:attachment":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}