<?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[ICU PORT程序不进中断]]></title><description><![CDATA[<p dir="auto">CANRX引脚（PTC_6）复用ICU休眠时切换ICU检测总线，现在发现程序不进入ICU中断，程序没有进IcuPortIrqProcess，PIFR没有置位，可能是什么原因？比较急！谢谢<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1720/9994292b-0491-4097-8ab0-2318411d2c68.png" alt="9a83edd1-3c90-46e9-b0b7-d34863a6c942-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.ytmicro.com/topic/1958/icu-port程序不进中断</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 04:41:31 GMT</lastBuildDate><atom:link href="https://forum.ytmicro.com/topic/1958.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 May 2026 07:43:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ICU PORT程序不进中断 on Tue, 19 May 2026 09:03:39 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/545/3fc59277-eba0-464f-9dc9-bae001697158.zip" rel="nofollow ugc">can_wakeup_demo.zip</a><br />
这个是can唤醒的demo你可以看一下</p>
]]></description><link>https://forum.ytmicro.com/post/8501</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8501</guid><dc:creator><![CDATA[WR]]></dc:creator><pubDate>Tue, 19 May 2026 09:03:39 GMT</pubDate></item><item><title><![CDATA[Reply to ICU PORT程序不进中断 on Tue, 19 May 2026 08:45:36 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1/c8ad14c2-4186-46f7-8327-363df046e1ae.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>AI提供的解决方案，仅供参考！！！！</strong></p>
<h2><img src="https://forum.ytmicro.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f50d.png?v=1b4819a83c9" class="not-responsive emoji emoji-android emoji--mag" style="height:23px;width:auto;vertical-align:middle" title=":mag:" alt="🔍" /> 核心问题分析</h2>
<h3>1️⃣ 【最可能】CAN1_RX引脚功能模式冲突 <img src="https://forum.ytmicro.com/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=1b4819a83c9" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title=":warning:" alt="⚠" />️</h3>
<p dir="auto">您的Port配置中，PTC_6的 <code>PortPinMode = "CAN1_RX"</code>（CAN1接收的复用功能），但ICU使用的是 <code>IcuIp = "PORT"</code> 模式。</p>
<p dir="auto"><strong>问题本质：</strong></p>
<ul>
<li>当引脚处于 <strong>CAN1_RX</strong> 复用功能时，PORT模块的数字输入中断检测电路<strong>可能无法有效捕获信号变化</strong></li>
<li>ICU的PORT模式依赖的是PORT模块的 <strong>GPIO数字输入路径</strong> 上的边沿检测</li>
<li>CAN1_RX模式下，CAN控制器直接接管了该引脚，PORT模块的PIFR（Pin Interrupt Flag Register）不会因为CAN总线信号的变化而置位</li>
</ul>
<p dir="auto"><strong>解决方案：</strong> 在休眠切换到ICU检测时，需要先将PTC_6的引脚功能切换为 <strong>GPIO输入模式</strong>，再使能ICU中断。唤醒后再切回CAN1_RX。</p>
<hr />
<h3>2️⃣ 边沿触发配置不匹配 — <code>ICU_RISING_EDGE</code></h3>
<pre><code class="language-json">"IcuDefaultStartEdge": "ICU_RISING_EDGE"
</code></pre>
<p dir="auto">CAN总线物理层特性：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>电平</th>
<th>含义</th>
</tr>
</thead>
<tbody>
<tr>
<td>HIGH</td>
<td>隐性（Recessive，空闲态）</td>
</tr>
<tr>
<td>LOW</td>
<td>显性（Dominant，激活态）</td>
</tr>
</tbody>
</table>
<p dir="auto">一个CAN帧的第一个动作是 <strong>SOF（Start of Frame）= 显性位 = 下降沿</strong>。如果您只配置了 <code>ICU_RISING_EDGE</code>，CAN帧起始的<strong>下降沿</strong>无法被捕获！虽然后续数据位中会有上升沿，但如果CAN控制器已经休眠，整个总线上可能只有一个下降沿就结束了。</p>
<p dir="auto"><strong>解决方案：</strong> 改为 <code>ICU_BOTH_EDGES</code>（双边沿检测）：</p>
<pre><code class="language-json">"IcuDefaultStartEdge": "ICU_BOTH_EDGES"
</code></pre>
<hr />
<h3>3️⃣ <code>IcuWakeupCapability = false</code></h3>
<pre><code class="language-json">"IcuWakeupCapability": false
</code></pre>
<p dir="auto">您在休眠场景下需要使用ICU检测总线唤醒，但该通道的Wakeup能力是 <strong>关闭的</strong>。</p>
<p dir="auto"><strong>需要改为：</strong> <code>true</code></p>
<p dir="auto">同时确认 <code>IcuWakeup</code> 子容器已正确关联到EcuM唤醒源：</p>
<pre><code class="language-json">"IcuWakeup": {
    "IcuChannelWakeupInfo": "EcuM/EcuMConfiguration/EcuMCommonConfiguration/EcuMWakeupSource/EcuMWakeupSource_0"
}
</code></pre>
<hr />
<h3>4️⃣ 无内部上拉/下拉电阻</h3>
<pre><code class="language-json">"PortPinPS": "PORT_PIN_NO_PULL"
</code></pre>
<p dir="auto">当CAN进入休眠模式、CAN控制器停止驱动RX引脚时，引脚如果没有外部上拉，<strong>引脚电平会浮动/不确定</strong>。PIFR检测需要清晰的数字边沿，浮动电平可能根本产生不了有效边沿。</p>
<p dir="auto"><strong>解决方案：</strong></p>
<ul>
<li>硬件上确保CAN RX有外部上拉到VCC（通常CAN收发器会处理）</li>
<li>或软件配置弱上拉：<code>PORT_PIN_PULLUP</code></li>
</ul>
<hr />
<h3>5️⃣ 休眠期间PORT模块时钟可能被关闭</h3>
<p dir="auto">您有 <code>IcuEnableSchmSupport: true</code> 和 <code>IcuEnableUserModeSupport: true</code>。如果进入休眠模式（如STOP模式）时PORT模块的时钟被门控关闭，则PIFR永远无法置位。</p>
<p dir="auto"><strong>请检查：</strong></p>
<ul>
<li>Mcu的 <code>McuModeSettingConf</code> 中休眠模式下的时钟门控配置</li>
<li>确保PORT模块在休眠模式下时钟保持开启</li>
</ul>
<hr />
<h2><img src="https://forum.ytmicro.com/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=1b4819a83c9" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title=":white_check_mark:" alt="✅" /> 建议修改方案汇总</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>参数路径</th>
<th>当前值</th>
<th>建议值</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Icu/IcuConfigSet/IcuChannel/IcuChannel_0/IcuDefaultStartEdge</code></td>
<td><code>ICU_RISING_EDGE</code></td>
<td><strong><code>ICU_BOTH_EDGES</code></strong></td>
</tr>
<tr>
<td><code>Icu/IcuConfigSet/IcuChannel/IcuChannel_0/IcuWakeupCapability</code></td>
<td><code>false</code></td>
<td><strong><code>true</code></strong></td>
</tr>
<tr>
<td><code>Port/PortConfigSet/PortContainer/CAN1/CAN1_RX_PTC6/PortPinPS</code></td>
<td><code>PORT_PIN_NO_PULL</code></td>
<td><strong><code>PORT_PIN_PULLUP</code></strong></td>
</tr>
<tr>
<td>应用代码中休眠前</td>
<td>未处理</td>
<td><strong>需要切PTC_6为GPIO输入</strong></td>
</tr>
</tbody>
</table>
<hr />
<h3>最关键的一点 — 应用代码流程</h3>
<p dir="auto">休眠前的正确流程应是：</p>
<pre><code>1. CAN_DeInit() / CAN_SetMode(SLEEP)      // 关闭CAN控制器
2. Port_SetPinMode(PTC_6, PORT_GPIO_MODE) // 切PTC_6为GPIO输入
3. Icu_Init()                              // 初始化ICU（PORT中断模式）
4. Icu_EnableWakeup()                      // 使能唤醒
5. 进入休眠
</code></pre>
<p dir="auto">唤醒后的流程：</p>
<pre><code>1. Icu_DisableWakeup()
2. Port_SetPinMode(PTC_6, CAN1_RX)        // 恢复CAN功能
3. Can_Init()
</code></pre>
<p dir="auto">如果不做第2步的引脚功能切换，直接使用CAN1_RX模式下的PORT中断检测，PIFR大概率不会置位，这就是您碰到的问题。</p>
]]></description><link>https://forum.ytmicro.com/post/8499</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8499</guid><dc:creator><![CDATA[Frankie]]></dc:creator><pubDate>Tue, 19 May 2026 08:45:36 GMT</pubDate></item><item><title><![CDATA[Reply to ICU PORT程序不进中断 on Tue, 19 May 2026 08:39:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.ytmicro.com/uid/545">WR</a> 在 <a href="/post/8497">ICU PORT程序不进中断</a> 中说：</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.ytmicro.com/uid/1720">chenchao</a> 把你yct发出来看一下</p>
</blockquote>
<p dir="auto"><a href="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1720/bd6c088d-92a9-49e7-8423-2de748f124b1.yct" rel="nofollow ugc">54ca97f5-9951-4b4e-aea5-f68b7c8a5ea3-S52_Lamp.yct</a> 麻烦了，谢谢</p>
]]></description><link>https://forum.ytmicro.com/post/8498</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8498</guid><dc:creator><![CDATA[chenchao]]></dc:creator><pubDate>Tue, 19 May 2026 08:39:52 GMT</pubDate></item><item><title><![CDATA[Reply to ICU PORT程序不进中断 on Tue, 19 May 2026 08:38:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.ytmicro.com/uid/1720">chenchao</a> 把你yct发出来看一下</p>
]]></description><link>https://forum.ytmicro.com/post/8497</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8497</guid><dc:creator><![CDATA[WR]]></dc:creator><pubDate>Tue, 19 May 2026 08:38:39 GMT</pubDate></item><item><title><![CDATA[Reply to ICU PORT程序不进中断 on Tue, 19 May 2026 08:26:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.ytmicro.com/uid/237">jan</a> 在 <a href="/post/8492">ICU PORT程序不进中断</a> 中说：</p>
<blockquote>
<p dir="auto"><img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/237/bf5eaa94-5d64-4c5a-97a6-0dd5c1465166.png" alt="image.png" class=" img-fluid img-markdown" /><br />
检查一下Platform中的GPIOC中断是否使能<br />
使能了<img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1720/d96a1be1-ef95-4331-8235-3f9f5193d1c9.png" alt="025c5d00-7ba2-441b-b371-22cddf83b51f-image.png" class=" img-fluid img-markdown" /></p>
</blockquote>
]]></description><link>https://forum.ytmicro.com/post/8493</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8493</guid><dc:creator><![CDATA[chenchao]]></dc:creator><pubDate>Tue, 19 May 2026 08:26:01 GMT</pubDate></item><item><title><![CDATA[Reply to ICU PORT程序不进中断 on Tue, 19 May 2026 07:46:28 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/237/bf5eaa94-5d64-4c5a-97a6-0dd5c1465166.png" alt="image.png" class=" img-fluid img-markdown" /><br />
检查一下Platform中的GPIOC中断是否使能</p>
]]></description><link>https://forum.ytmicro.com/post/8492</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8492</guid><dc:creator><![CDATA[jan]]></dc:creator><pubDate>Tue, 19 May 2026 07:46:28 GMT</pubDate></item></channel></rss>