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.

[参考译文] TMS320F28378D:矢量可将 Intel Hex 文件转换为 C2000 Hex 文件转换器

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1226621/tms320f28378d-vector-canape-intel-hex-file-to-c2000-hex-file-converter

器件型号:TMS320F28378D
主题中讨论的其他器件:UNIFLASH

以下假设从 ECU 不支持通过 XCP 刷写。

对于 C2000器件、UniFlash 期望十六进制文件的 romwidth=16。 简而言之、如果您尝试使用 UniFlash 将常规 Intel Hex 文件下载到 C2000器件、则无法按预期进行编程。 更多信息:

 https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1224488/uniflash-c2000-hex-file-format-compatibility


我将使用矢量 canape 进行数据采集和校准。 校准会话之后、可以保存包含校准常量(ASAP2中的特征表示)的存储器的图像文件(Intel hex)、想法是将文件刷写到器件中、以冻结该特定器件中的校准更改、而无需重新编译软件。

接下来的挑战是如何将 canape true Intel hex 文件转换为 UniFlash C2000 hex 文件(romwidth=16)、以便 canape (或任何其他 MCD 工具)可用于汽车工作流程。 我的解决方案是使用 Python 脚本解析 canape hex 文件、从而将八位位组放置在正确的地址的正确位置、从而允许 UniFlash 对 C2000器件进行编程。 请在下方找到 Python 脚本。

 它需要在该线程 https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1225978/tms320f28379d-implementation-of-xcp-on-can-for-c2000中概述的定制寻址方案 、其中 ASAP2地址空间是设备地址空间的2 x。 授权这是一个非常具体的用例、但可以修改脚本、以便可以生成真正的 Intel hex 文件的其他第三方工具配合 C2000/UniFlash 使用。

注1:输入一半由 Python IntelHex (https://pypi.org/project/intelhex/)完成。 一种快速的解决方案是使用其'HEX2BIN'脚本、只要您愿意手动输入起始地址、bin 文件就可以直接与 UniFlash 一起使用。 不过、我需要一个自包含可编程文件、而且格式与 hex2000实用程序从 CCS 输出的格式完全相同。 后者意味着我可以通过文件将编译器输出"校准"与 CA 输出校准进行比较。

注2:Python IntelHex 具有 IntelHex16位类、但我无法将其输出为 C2000 hex 文件。

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Python program to create a word addressable HEX file suitable for TI UniFlash
# to program a C2000 device from a byte addressable Intel HEX file generated by CANape.
#
# It expects that the CANape (XCP / ASAP2) addresses are 2 x C2000 device addresses.
#
# Usage : python.exe CANapeHex2UniFlashHex.py canape_input.hex uniflash_output.hex
#
# Tested with Python 3.10.
import sys
# Class for the input Intel hex file. Credit: pypi.org/.../
from intelhex import IntelHex
class UniFlashDict:
'''Creates a dictionary of values with additional metadata suitable for UniFlash hex file construction from an IntelHex object'''
def __init__(this, intelhex_obj):
# New empty dictionary.
this.dict = dict()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    尊敬的 Kier:

    我将这个问题分配给了我们的编译器/hextool 团队、他们会审查后回复给您。   

    谢谢。此致、

    Vamsi

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

    我不知道你的帖子的目的。

    如果你分享你已经做的工作,以便他人可以受益,那么非常感谢你。

    如果您想获得 TI 的批准、那么我很抱歉地说我无法做到这一点。  我们不熟悉 Canape。  我们缺乏 Python 专业知识。  总的来说,我们 不能 提出任何意见。

    谢谢。此致、

    -George.

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

    是的、我只是分享。 很抱歉、我没有说明。 无需响应。