This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] [参考译文] 【常见问题解答】AM625:UART Uniflash 刷写速度优化

Guru**** 2905440 points

Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1646858/faq-am625-uart-uniflash-flashing-speed-optimization

器件型号: AM62xx
Thread 中讨论的其他器件: UNIFLASHSYSCONFIG

如何使用更高的波特率在 UART Uniflash 中提高刷写速度?  

概述
在 AM62XX 平台上使用 UART Uniflash 的刷写速度可以部分提高。 由于 ROM 引导加载程序 (RBL) 处理的引导过程中存在固有的限制、因此无法完全增加。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    技术背景
    ROM 引导加载程序始终以 115200 的固定波特率加载第一阶段映像 (sbl_uart_uniflash_stage1)。 此波特率在 ROM 中进行了硬编码、无法修改。

    但是、在第一级引导加载程序成功加载后、可以为所有后续刷写阶段切换到更高的波特率、从而显著缩短整体刷写时间。

    建议的方法


    1.更新固件中的波特率
    -在 sysconfig (.syscfg) 文件中为以下两者修改 UART 波特率:
    * sbl_uart_uniflash_stage1
    * sbl_uart_uniflash_stage2

    步骤:

    • 打开相应的 .syscfg 文件。

    • 导航至 UART 配置部分 (如图所示)。

    • 将波特率更新为更高的值(例如 460800 或更高)。

    参考资料:

    • 下图突出显示了可在 SysConfig 中配置 UART 波特率的位置。

    • 有关基于时钟设置的有效值、请参阅图像中显示的 UART 波特率表。

    根据系统稳定性、将波特率增加到更高的值、例如 460800bps 或更高。

     2.修改刷写工具 (uart_uniflash.py)
    -将初始波特率保持在 115200 以符合 ROM 引导加载程序要求。
    -加载第 1 阶段后,更新脚本以切换至更高的波特率,用于所有后续的刷写操作。

    生成的闪存流程
    -第 1 步: ROM 引导加载程序以 115200 波特加载第 1 阶段(固定)
    -第 2 步:刷新工具切换至更高的波特率
    -第 3 步:第 2 阶段和其余图像以加速的波特率刷新

    其他资源
    - 补丁文件

    diff --git a/uart_uniflash.py b/uart_uniflash_modified.py
    index f4ecaf00..5995c49e 100644
    --- a/uart_uniflash.py
    +++ b/uart_uniflash_modified.py
    @@ -213,7 +213,7 @@ def parse_response_evm(filename):
         return status
     
     # Sends the file to EVM via xmodem, receives response from EVM and returns the response status
    -def xmodem_send_receive_file(filename, serialport, baudrate=115200, get_response=True):
    +def xmodem_send_receive_file(filename, serialport, baudrate=230400, get_response=True):
         status = False
         timetaken = 0
         if not os.path.exists(filename):
    @@ -398,7 +398,7 @@ def main(argv):
                     cfg_flash_writer_file = filecfg.cfgs[filecfg.flash_writer_index].flashwriter
                     print("Executing command {} of {} ...".format(1, len(filecfg.cfgs)))
                     print("Found flash writer ... sending {}".format(cfg_flash_writer_file))
    -                status, timetaken = xmodem_send_receive_file(cfg_flash_writer_file, serialport, get_response=False)
    +                status, timetaken = xmodem_send_receive_file(cfg_flash_writer_file, serialport, 115200,get_response=False)
                     print("Sent flashwriter {} of size {} bytes in {}s.".format(cfg_flash_writer_file, os.path.getsize(cfg_flash_writer_file), timetaken))
                     print("")

    这些修改可实现更快的刷写、同时保持与 AM62X 器件的 ROM 引导限制一致。

    注意: 

    1.更高波特率的配置已经过测试和验证、波特 率高达 921600 波特率。 较高波特率下的稳定性可能会因主机系统、UART 硬件和电缆质量而异。

    此解决方案已在 SK-AM62A 平台上验证;但相同的方法也可应用于 AM62x 系列中的其他器件