痞子衡嵌入式:不同J-Link版本对于i.MXRT1170连接复位后处理行为有所不同


  大家好,我是痞子衡,是正经搞技术的痞子。今天痞子衡给大家介绍的是不同J-Link版本对于i.MXRT1170连接复位后处理行为

  痞子衡之前写过一篇旧文 《i.MXRT1170上用J-Link连接复位后PC总是停在0x223104的原因》,这篇文章详细解释了 RT1170 BootROM 代码里软件实现的 Debug Mailbox 机制对 J-Link 调试体验的影响,文末还给了结论 J-Link 里只要执行 reset 后 PC 就必定会停在 0x223014,这句话其实不完全准确,因为底层 J-Link 脚本内容可以改变这个行为,这在不同 J-Link 版本的 DLL 处理里就有体现。今天痞子衡要聊得就是这个话题:

一、不同J-Link版本关于RT1170更新

  为了了解不同 J-Link 版本对于 RT1170 处理差异,痞子衡从 J-Link 历史版本记录 https://www.segger.com/downloads/jlink/ReleaseNotes_JLink.html 里抽取了从 V6.64 - V7.96i 所有关于 RT1170 更新如下,其中 V6.86、V6.94、V6.98c、V7.86 四个版本涉及 Debug 连接处理,但是没有说明进一步实现细节。

J-Link版本关于RT1170更新
V6.64DLL 7.Added (QSPI) flash programming support for NXP iMXRT117x series devices.
V6.72DLL 2.Added (QSPI) flash programming support for the Cortex-M4 core of NXP iMXRT117x series devices.
V6.80bDLL 1.NXP RT117x QSPI flash programming: Some necessary pins were not correctly configured to connect to the FLEXSPI controller. Fixed.
V6.86DLL 14.NXP RT117x: Reset did not work for rev B0 silicon. Fixed.
V6.88DLL 57.Added 4byte address mode QSPI flash programming support NXP iMXRT117x series devices.
V6.94DLL 3.JTAG chain detection for NXP iMXRT117x series devices, fixed.
V6.98DLL 7.Added debug and (QSPI) flash programming support for NXP MIMXRT1177xxxA_M4 and MIMXRT1177xxxA_M7.
V6.98cDLL 1.NXP iMXRT117x: Reading PC & SP after reset could return incorrect values. Fixed.
V7.00DLL 4.Added quad memory mapped read for NXP iMXRT117x series devices with SPIFI-Lib support.
V7.22bDLL 10.NXP i.MXRT117x Cortex-M4 debug: Software breakpoints did not work correctly in case the LMem caches were enabled. Fixed.
V7.50DLL 28.NXP i.MXRT117x series: Connect sequence to the Cortex-M4 failed under certain circumstances. Fixed.
DLL 42.NXP i.MXRT117x series: Some devices passed by ARM KEIL MDK were not detected correctly. Fixed.
V7.54DLL 12.NXP iMXRT117x devices: Flashloader did not save and restore all used registers. Fixed.
V7.82dDLL 11.NXP i.MXRT117x: Added flash programming support for FlexSPI 2 flash bank.
V7.84cDLL 11.NXP iMXRT117x: Detecting FlexSPI2 boot config and booting from FlexSPI2 did not work. Fixed.
V7.86DLL 4.NXP iMXRT117x: Debug connection would fail when debugging both Cortex-M4 and Cortex-M7 cores and performing a reset via Cortex-M7. Fixed.
V7.86eDLL 9.NXP iMXRT117x: FlexSPI Flash programming did not work. Introduced with V7.86. Fixed.
V7.88kDS 5.NXP iMXRT117x FlexSPI support: Under certain circumstances writing less than four bytes could fail. Fixed.
V7.88iDS 6.NXP iMXRT117x FlexSPI1 support: Added support for pin configuration "nCS@AD18_CLK@AD19_D0@AD20_D1@AD21_D2@AD22_D3@AD23"
V7.94dDS 3.NXP iMXRT1170: Flash programming did not work. Introduced with V7.88l. Fixed.

  从 J-Link 版本来看,V6.86 开始正式支持 RT1170 B0 Silicon(恩智浦最终发布的芯片版本),我们就从 V6.86 版本开始做测试。在测试之前,痞子衡在板载串行 NOR Flash 里烧录了一个链接在 0x30002000 的 XIP App 程序。然后使用 J-Link commander 操作如下:

  上述测试结果表明:当芯片上电/复位能正常启动链接在 0x30002000 的 App 时,J-Link 下用默认 MIMXRT1176XXXA_M7 设备去连芯片复位后,PC 能停在 App 里,因为自带 DLL 里集成了 jlinkscript 处理,这在 dll 里搜索 "Valid application detected. Setting PC / SP manually." 信息可知。但是如果我们自己添加的 jlinkscript 不包含这样的处理(比如用超级下载算法 UFL),那么 PC 还是停在 0x223104。

  如果我们在板载串行 NOR Flash 里烧录了一个不是链接在 0x30002000 的 App,痞子衡烧录得是链接在 0x3000a000 处的 XIP App(总之保证 Flash 偏移 0x2000 处没有有效 App 中断向量表),再来做同样的测试(在芯片能正常启动 App 情况下),此时 PC 永远停在 0x223104,这说明 J-Link DLL 默认集成的 jlinkscript 永远是从 Flash 0x2000 偏移处取 App 信息去设置 PC、SP

  我们紧接着上面的测试,使用 mem32 命令读取 0x3000a000 处内容,发现是有效 App 数据,这说明 FlexSPI 外设被正常初始化了,此时手动设置 PC、SP 后可以跳转到 App 里,这意味着如果我们自定义 jlinkscript 里能够解析 IVT 去获取 App 信息,那么可以做到通用。

三、不同J-Link版本对于RT1170连接复位处理

  由于 V6.86 版本对于连接复位处理已经一定程度上满足实际需求,因此对比后续更高 J-Link 版本意义不太重要了,不过这里有一个差异不得不提。正常来说,在芯片上电/复位能正常启动链接在 0x30002000 的 App 情况下,reset 命令执行完后,PC 应该 halt 在 BootROM 里,需要继续使用 go 命令才能跳转进入 App,这在 V6.86 上确实如此。然后在 V7.94f 版本上测试来看,reset 之后,PC 已经 halt 在 App 里了。

  至此,不同J-Link版本对于i.MXRT1170连接复位后处理行为痞子衡便介绍完毕了,掌声在哪里~~~

欢迎订阅

文章会同时发布到我的 博客园主页CSDN主页知乎主页微信公众号 平台上。

微信搜索"痞子衡嵌入式"或者扫描下面二维码,就可以在手机上第一时间看了哦。

  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

痞子衡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值