SiFli-Wiki SiFli-Wiki SiFli-Wiki
  • User Guide
  • Examples
  • API Documentation
  • About Us
/
  • English
  • 中文

Quick start

  • Getting Started Guide
  • Chip Manual Summary

Software Development

  • SDK Documentation
  • FAQ
    • Development tool related issues
      • 1 Compilation Related
      • 2 Jlink
      • 3 KEIL
      • 4 Ozone
      • 5 SiFli
      • 6 Trace32
      • 7 SystemView
      • 8 Serial port
      • 9 Source Insight相关
    • Chip related issues;
      • 1 GPIO相关
      • 2 定时器相关
      • 3 Middle;断相关
      • 4 Watchdog;相关
      • 5 RTC相关
      • 6 ADC相关
      • 7 I2C相关
      • 8 低功耗相关
      • 9 PWM
      • 10 系统
      • 11 Bluetooth;
      • 12 USB相关
      • 13 UART相关
      • 14 双核相关
      • 15 I2S;related;
      • 13; SPI related issues;
    • Peripheral driver debugging issues;
      • 1 LCD调试常见问题
      • 2 Sensor调试常见问题
      • 3 flash调试常见问题
      • 4 马达motor调试常见问题
    • Software debugging related issues;
      • 1 Log调试
      • 2 在线调试方法
      • 3 Restore crash scene by dumping memory;
      • 4 Method for saving crash scene;
  • Application Notes
    • SF32LB52X启动与低功耗流程
    • 低功耗开发指南

Hardware Development

  • SiFliModel Selection Manual
    • SiFli Chip Model Guide
    • Module Model Guide
  • Chip Hardware Design Guide
    • SF32LB52x-Hardware Design Guide
    • SF32LB52X-Hardware Design Guide
    • SF32LB56xU-Hardware Design Guide
    • SF32LB56xV-Hardware Design Guide
    • SF32LB58x-Hardware Design Guide
  • Development Board
    • SF32LB52-DevKit-LCD开发板使用指南
    • SF32LB52-DevKit-LCDAdapter board制作指南
    • 立创·黄山派开发板使用指南
    • SF32LB52-DevKit-Nano Development Board User Guide

Software Tools

  • Software and Hardware Tools Collection
    • firmwareburningTool Impeller
    • Graphics ConversionTool
    • Storage Debugging Tools
      • Flash Chipid 和TypeConfiguration Guide
    • Screen module调试
      • screen模组介绍
      • 思澈SDKOf显示框架介绍
      • AdjoinCurrentProjectionBlock
        • 添加新的屏幕驱动
        • AddNew屏幕BacklightDriver
        • Add a new TP driver
        • 为新的屏幕模组添加menuconfig选项
      • Use the new screen module
      • 525添加QSPI-LCD实例
      • 566添加DPI-LCD实例
      • FAQ
      • Appendix
        • 屏驱回调函数
        • Application Layer vs Module Driver Layer Function Correspondence Table
        • List of adapted screen modules
    • sftool

Product Introduction

  • About SiFi

On this page

  • 2.1 How to print log information using JLINK RTT??
  • 2.2 Hcpu’s log cannot be printed through Jlink segger
  • 2.3 Reading and writing flash content using J-Link,
  • 2.4 JlinkOther common commands
  • 2.5 没有SWD口用SiFliUsartServer连接JlinkMethod
  1. SiFli-Wiki /
  2. FAQ /
  3. Development tool related issues /
  4. 2 Jlink

2 Jlink¶

2.1 How to print log information using JLINK RTT??¶

The current default software Hcpu log is output from uart1 PA17/PA19 (SF32LB555), PA49/51 (SF32LB551)
The Lcpu log is output from uart3,
The customer only leads out uart3 PB45/PB46, or Uart1 is occupied
Solution:
考虑到uart3是连接到lcpu,后面lcpu也需要输出log, 可以采用menuconfig改成swd输出log
Modification method for Jlink swd printing hcpu log:

  1. Enter the SDK\example\rt_driver\project\ec-lb555 directory

  2. menuconfig->Third party packages->Select Segger RTT package
    alt text

  3. menuconfig->RTOS -> RT-Thread Kernel->Kernel Device Object->Change the devices name for console to segger
    alt text

  4. Connect jlink。 Method1:OpenC:\Program Files (x86)\SEGGER\JLink\jlink.exe -> connect ->? ->s->默认4000khz->连接成功,As shown in the figure below:
    alt text
    Method2:OpenC:\Program Files (x86)\SEGGER\JLink\JLinkRTTViewer.exe配置和菜单File -> Connect, 连接成功能看到如下的 LOG: RTT Viewer connected.提示连接成功。
    alt text
    alt text

  5. Run Xshell, secureCRT and other software, connect to jlink RTT viewer via telnet (hostname: 127.0.0.1 port: 19021), view logs support output input,As shown in the figure below:
    alt text
    注意 If Hcpu wakes up from standby or restarts, it is necessary to reconnect jlink RTT viewer.
    F,如果按照如上配置,Segger还是没有打印,可以参考#2.2排查

2.2 Hcpu’s log cannot be printed through Jlink segger¶

根本原因:
The new version of sdk optimizes memory, Jlink’s Control block address: _SEGGER_RTT variable is changed from HPSYS SRAM0x20000000 to memory area HPSYS ITCM RAM0x00010000 0x0001FFFF 64*1024 As shown in the figure below:
alt text

And Jlink’s default memory search starts from 0x20000000, so it cannot be found and the connection fails,
The address compiled by the old version 0.9.7 is after 0x20000000, and jlink can automatically connect and search。
Solution1:
Specify the address in J-Link RTT Viewer.exe, which can be searched from the map file,As shown in the figure below:
alt text
Solution2:
改用Ozone.exe,Ozone.exe能通过axf文件中找到该地址,As shown in the figure below,存在SetRTTAddr地址命令:
alt text

Solution3:
Make a JLinkScript command, which will automatically call to set or search the Control block address range when jlink starts,As shown in the figure below命令:
可以自己进行修改选择:
alt text

Corresponding: xml file modification:
alt text

JLink.exe,J-Link RTT Viewer.exe ,还是像之前一样自动能连接上,方便很多.
It is recommended to use rttview.exe and telnet 127.0.0.1 to view log usage! 文件patch如附件,复制到Jlink对应安装目录:
Program Files (x86).7z

2.3 Reading and writing flash content using J-Link,¶

  1. After jlink is successfully connected, use mem32 to read, w4 to write, and erase to erase

mem32 0x40014000 1 #读1个32bit的寄存器值
mem32 0x64000000 10 #读10个byte从flash2地址0x64000000开始,
w4 0x64000000 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f #写内存或者寄存器值 从flash2地址0x64000000开始, 写入后续的数据
  1. 用jflash读写
    In the same directory as jlink.exe, there is a jflash tool,As shown in the figure below菜单读取flash内容, alt text

  2. Read with savebin command

savebin d:\1.bin 0x101b4000 0x100000 

As above, 0x101b4000 is the memory address, 0x100000 is the read-write memory size in bytes d,The method to burn the saved bin back

loadbin  d:\1.bin 0x101b4000

2.4 JlinkOther common commands¶

  1. halt, go commands
    Enter command h, you can stop the CPU and check the location of the PC pointer
    Enter command g, you can let the CPU continue running, alt text

  2. 设置PC指针
    常用于配合 __asm(“B .”); 指令来用,当代码中执行到该指令后,会停住,
    如上图,如果此时PC指针在0x10140D28,此时PC指针加2,输入setpc 0x10140D2A, 可以跳过 __asm(“B .”);指令,继续往下运行。

  3. 其他指令
    Erase 0x00000000.0x0000FFFF
    loadbin

    – Download filename file to address
    usb——–Connect target board
    r———Restart the target board
    halt——-Stop the program running on the cpu
    loadbin—-Load executable binary file
    g——-Jump to the code segment address to execute
    s——-Single step execution (for debugging)
    setpc
    setbp—–设置断点,断点停后可以指令g继续运行
    Regs——-读寄存器组织
    wreg——-写寄存器
    mem——–读内存
    w4——–写内存

2.5 没有SWD口用SiFliUsartServer连接JlinkMethod¶

52系列之后MCU没有了SWD接口,如果要用Jlink或者Ozone来debug,可以采用SiFliUsartServer.exe工具,Jlink使用MethodAs shown in the figure below设置: alt text

Previous
1 Compilation Related
Next
3 KEIL

2025, SiFli

Made with Sphinx and Shibuya theme.