硬汉嵌入式论坛

 找回密码
 立即注册
查看: 815|回复: 3
收起左侧

[脱机烧录] 咨询PSOC6 hex文件0x90300000,0x90500000地址空间的含义

[复制链接]

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
发表于 2022-1-22 10:37:12 | 显示全部楼层 |阅读模式
Cypress PSOC6 芯片,CY8C6245
客户提供的几个hex文件末尾都有两段数据,
0x90300000处2个字节, 0x90500000出12个字节。不同的hex文件数值不同。

文件末尾内容:  (前面正常)
文件1
:0200000490303A     --地址空间0x90300000
:020000001827BF     --数据 1827
:0200000490501A     --地址空间0x90300000
:0C00000000000000000000000221182792  --数据 000000000000000002211827
:00000001FF


文件2
:0200000490303A
:02000000419F1E
:0200000490501A
:0C0000000005E20721002101E4BE629F20
:00000001FF

芯片手册提供的地址空间
  "Algo_sect256KB",   0x10000000, 0x00080000,  
  "Algo_WFLASH",    0x14000000, 0x00008000,
  "Algo_SFLASH_USER", 0x16000800, 0x00000800,
  "Algo_SFLASH_NAR",  0x16001A00, 0x00000200,
  "Algo_SFLASH_PKEY", 0x16005A00, 0x00000C00,
  "Algo_SFLASH_TOC2", 0x16007C00, 0x00000400,
  "Algo_SMIF",     0x18000000, 0x08000000,
  "Algo_EFUSE",     0x90700000, 0x00000400,      --熔丝

客户研发人员也不清楚数据含义。有了解psoc6朋友吗,这2个地址空间查无资料,无编程算法。


回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107028
QQ
发表于 2022-1-22 11:18:49 | 显示全部楼层
# The size of the program data in Cypress HEX files is limited to 0x80000000
# Higher addresses contain additional metadata (chip protection, eFuse data, etc..)
CY_PROGRAM_SIZE = 0x80000000

# The starting address of the program data checksum section
CY_CHECKSUM_ADDR = 0x90300000

# The starting address of the .cymeta section (12 bytes)
# Additional metadata include silicon revision, Silicon/JTAG ID, etc.
CY_META_ADDR = 0x90500000
回复

使用道具 举报

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
 楼主| 发表于 2022-11-15 23:04:55 | 显示全部楼层
终于找到资料了,HEX文件结构:
https://www.cypress.com/documentation/programming-specifications/cy8c4xxx-cyblxxxx-programming-specifications

Infineon-CY8C4xxx_CYBLxxxx_Programming_Specifications-Programming Specifications.pdf (475.94 KB, 下载次数: 4)




回复

使用道具 举报

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
 楼主| 发表于 2022-11-15 23:12:43 | 显示全部楼层
HEX文件地址空间分配:

image.png

0x0000 0000 – User’s Flash (size varies): This is the user’s program (code) that must be programmed. The size of
this section matches the flash size of the target part. The programmer can either read all of this section at once
or gradually by blocks where each block is equal to the row size for the device. The programming of the flash is
carried out on the basis of one row for each request. See Table 1-1 in “Target overview” on Page 4 for the row
size for each device series.这是必须进行编程的用户程序(代码)。此部分的大小与目标部件的闪存大小相匹配。程序员可以一次读取所有这部分,也可以通过块逐步读取,其中每个块都等于设备的行大小。闪存的编程是基于
每个请求的一行来执行的。每个设备系列的行大小见第4页“目标概述”中的表1-1。

0x9030 0000 – Checksum (2 bytes): This is the checksum of the entire user flash section—the arithmetical sum
of every byte in the user’s flash. Only two least significant bytes (LSB) of the result are saved in this section, in big
endian format (most significant byte (MSB) first). This must be used by the programmer to check the integrity of
the hex file and to verify the quality of the programming. In this context, “integrity” means that the checksum and
user’s flash sections must be correlated in this file. At the end of programming, the checksum of flash (two LSBs)
is compared to the checksum from the hex file.
这是整个用户flash部分的校验和-----------用户flash中每个字节的算术之和。本节中只保存两个最小重要字节(LSB),
以双格式(首先保存最重要字节(MSB))。程序员必须使用它来检查十六进制文件的完整性,并验证编程的质量。
在此上下文中,“完整性”意味着校验和和用户的flash部分必须在此文件中相互关联。在编程结束时,将flash的校验和(
两个lsb)与十六进制文件中的校验和进行比较。

0x9040 0000 – Flash Protection (number of bytes varies): This data is programmed into supervisory rows of the
flash macros (see Figure 2-1 on page 7). Every bit defines the write-protection setting for the corresponding user
row. The number of bytes to be read from this section depends on the flash size.
Protection Size = Flash Size / Row Size / 8
Therefore, for a 128 KB part, flash protection consists of 128 bytes.
这些数据被编程到flash宏的监控行中(参见第7页上的图2-1)。每位都定义相应用户行的写保护设置。要从本节中
读取的字节数取决于闪存的大小。保护大小=Flash Size / Row Size / 8  .因此,对于一个128 KB的部分,闪存保护由128字节组成。
  
0x9050 0000 – Metadata (12 bytes): This section contains data that is not programmed into the target device.
Instead, it is used to check data integrity of the hex file and the silicon ID of the target device. Table 2-2 lists the
fields in this section.
本节包含未被编程到目标设备中的数据。相反,它被用来检查十六进制文件的数据完整性和目标设备的硅ID。
表2-2列出了本节中的各个字段。


0x9060 0000 – Chip-level Protection (1 byte): This section represents chip-level protection of the programmed
part (see Figure 2-1 on page 7). For more information, see Appendix A: Chip-level protection on page 46.
芯片级保护(1字节):本节表示已编程部件的芯片级保护(请参见第7页上的图2-1)。有关更多信息,请参见附录A:芯片级保护。


----------------------------------------------------------
0x9050 0000 – Metadata (12 bytes) 的格式:
image.png
Hex file version: This 2-byte field in the hex file defines its version (or type). The version for the target family
is “2”. The programmer should use this field to make sure that the hex file corresponds to the target device,
or to select the appropriate parsing algorithm if the hex file supports several families.
十六进制文件中的这个2字节字段定义了它的版本(或类型)。目标家族的版本是“2”。程序员应该使用此字段来
确保十六进制文件与目标设备对应,或者如果十六进制文件支持多个族,则选择适当的解析算法。

Silicon ID: This 4-byte field (big endian) represents the ID of the target silicon: 此4字节字段(大环境值)表示目标硅的ID:
byte[0] - Silicon ID Hi
byte[1] - Silicon ID Lo
byte[2] - Revision ID
byte[3] - Family ID
During programming, the ID of the acquired device is compared to the content of this field. To start programming,
three of these fields must match. The Revision ID must be skipped, because it is not essential for programming—
there are many silicon revisions possible that do not change its functionality. Infineon does not guarantee
reliable programming (or data retention) if third-party programmers ignore this condition.
在编程过程中,将所获取的设备的ID与该字段的内容进行比较。要开始编程,其中三个字段必须匹配。必须跳过修订ID,
因为它对编程不是必需的——有许多硅的修订可能不会改变其功能。如果第三方程序员忽略了这个条件,
英飞凌并不能保证可靠的编程(或数据保留)。

Reserved: Not used by the target family.  未被目标族使用
Internal Use: This 4-byte field is used internally by the PSoC™ Programmer software. Because it is not related
to actual programming, this field should be ignored by third-party vendors.
这个4字节的字段由PSoC™程序员软件内部使用。因为它与实际的编程无关,所以第三方供应商应该忽略这个字段。







回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-14 14:31 , Processed in 0.213364 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表