<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[YTM32B1MD2x  SDK A&#x2F;B Swap demo及操作流程演示]]></title><description><![CDATA[<p dir="auto">1、例程将PFlash0作为A面，PFlash1作为B面，实现A/B Swap功能<br />
SDK Demo例程：<a href="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/e652372f-8282-4502-ae9b-f25453688182.zip" rel="nofollow ugc">MD2x_Swap.zip</a></p>
<p dir="auto">2、Demo功能介绍<br />
FLASH_DRV_BootSwap(0)：通过内部闪存命令（0x30）执行Swap操作。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/1f9fa566-58a9-4d03-a3ce-7df034e310d4.png" alt="677e37d0-fd03-4438-831a-8adea93e76a0-image.png" class=" img-fluid img-markdown" /><br />
Get_SwapInfo(&amp;swapInfo)：读取EFM-&gt;STS寄存器，获取BOOT_INFO标志<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/490e9a0a-5648-43aa-ae57-70f1eaf332bf.png" alt="e8f845e3-7c13-4b77-8106-b426b3047caf-image.png" class=" img-fluid img-markdown" /><br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/88c5b02b-691f-4475-a398-2f398bff6ddf.png" alt="89db2b5f-6f31-4605-83a5-0c151388941a-image.png" class=" img-fluid img-markdown" /><br />
测试主逻辑：上电后读取BOOT_INFO标志，通过BOOT_INFO标志判断当前代码运行在哪个PFflash中，程序运行在PFlash0时点亮LED_A，运行在PFlash1时点亮LED_B。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/e50955b1-997d-4435-8728-270d4d3fc495.png" alt="9f5f5e3f-c9b8-4d5d-b25e-10531dd5805f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">3、测试验证<br />
使用J-Flash擦除芯片。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/1c0fda0f-753d-4a95-95c0-6bcc924d7af3.png" alt="1b5d7f68-641e-4877-a9b8-35451b7aad88-image.png" class=" img-fluid img-markdown" /><br />
将工程程序编译的文件加载到J-Flash中。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/2e23b480-e97c-4310-8352-2b29888acc6b.png" alt="dfc46ef6-e9c6-4ef6-8127-eee0beb4d38e-image.png" class=" img-fluid img-markdown" /><br />
对PFlash0进行烧录。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/e3b33a56-fcbf-4b66-93cb-c806d51a64b1.png" alt="4cf326b5-5412-4681-8b03-e433d15be88c-image.png" class=" img-fluid img-markdown" /><br />
在Edit-&gt;Relocate界面将烧录地址偏移到PFlash1中进行烧录。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/aee1070e-a6af-4c04-9bca-604c9e7d5d4f.png" alt="8dc92d23-5327-4cd7-98b9-f5f541d8160f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">4、重新上电运行程序<br />
程序会在蓝灯和绿灯之间来回切换，绿灯代表程序在PFlash0中运行，蓝灯代表程序在PFlash1中运行。<br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/7517f930-c135-4a4c-893a-cf7eae3d9860.png" alt="affa5ffe-4192-4249-8473-ddf69c81cfd2-image.png" class=" img-fluid img-markdown" /><br />
<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1026/fc08bf3c-f563-4e46-9b0d-0f4e44700ce4.png" alt="fa4e2037-9cbb-4806-bbdd-6d44814b68c7-image.png" class=" img-fluid img-markdown" /> 、</p>
]]></description><link>https://forum.ytmicro.com/topic/2309/ytm32b1md2x-sdk-a-b-swap-demo及操作流程演示</link><generator>RSS for Node</generator><lastBuildDate>Wed, 21 Oct 2026 23:07:56 GMT</lastBuildDate><atom:link href="https://forum.ytmicro.com/topic/2309.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Oct 2026 07:45:22 GMT</pubDate><ttl>60</ttl></channel></rss>