S32K3 HSE linkerfile and startup

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K3 HSE linkerfile and startup

跳至解决方案
11,931 次查看
ALXY_WANG1
Contributor II

I noticed that the link file and startup code of the sample file in S32K3_HSE_DemoExamples are different from those in the normal sample file. If I want to implement HSE-related services in the normal software, do I need to synchronize this part of the code? There are no relevant guiding documents to refer to either

0 项奖励
回复
1 解答
10,313 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

The table describes which "user memories" are allocated for HSE. But HSE has own secure RAM, so no user RAM is allocated, so there's zero in the table.

You are not allowed to read the keys directly from memory anyway. A key can be only exported via HSE service (if such operation is allowed). Please read section "6.2.4 Key export" in HSE firmware reference manual.

在原帖中查看解决方案

10 回复数
10,537 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ALXY_WANG1 

There are only two points to consider:

1. When HSE firmware is installed, part of flash is allocated for HSE firmware. So, it's necessary to update linker file accordingly. Take a look at tables 197, 199 and 200:

https://www.nxp.com/webapp/Download?colCode=S32K3XXRM

These tables show which memory is available when no HSE firmware is installed, when FULL_MEM version is installed and when AB_SWAP version is installed.

2. And then be aware that data cache is disabled in HSE Demo Examples for easier developing. If data cache is enabled in your project, it's necessary to force all data objects used for communication with HSE to non-cacheable memory because HSE can't see the cache content and there's no cache coherency unit.

There are no other requirements when using HSE, it's not necessary to port other things from startup files or linker files.

Regards,

Lukas

10,026 次查看
salmawis
Contributor I

Hi @ALXY_WANG1 

There are only two points to consider:

1. When HSE firmware is installed, part of flash is allocated for HSE firmware. So, it's necessary to update linker file accordingly. Take a look at tables 197, 199 and 200:

https://www.nxp.com/webapp/Download?colCode=S32K3XXRMDrift Boss

These tables show which memory is available when no HSE firmware is installed, when FULL_MEM version is installed and when AB_SWAP version is installed.

2. And then be aware that data cache is disabled in HSE Demo Examples for easier developing. If data cache is enabled in your project, it's necessary to force all data objects used for communication with HSE to non-cacheable memory because HSE can't see the cache content and there's no cache coherency unit.

There are no other requirements when using HSE, it's not necessary to port other things from startup files or linker files.

Regards,

Lukas

HSE Demo disables data caching for simplicity. If you enable it, all HSE-comm data is placed in non-cacheable memory — no cache consistency is supported.

No need to touch boot or link files anymore.

Cheers,

0 项奖励
回复
10,516 次查看
ALXY_WANG1
Contributor II

Now that I have normally integrated the relevant interface software of HSE here, when I try to obtain the version number service of the HSE module, it has been stuck at the response timeout section. I can obtain the version number by using the HSE sample file. Could you please tell me what the possible reasons are?

0 项奖励
回复
10,490 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Once you get the timeout error, what is the content of FSR and GSR registers in MU0? And what can you see in HSE GPR register at 0x4039_C028?

Is the data cache disabled?

Regards,

Lukas

0 项奖励
回复
10,448 次查看
ALXY_WANG1
Contributor II

As shown in the figure, the attached value is 0x4039C028 read by the runtime memory. Meanwhile, the D-cache function is disabled through the RTD Startup Procedure.

0 项奖励
回复
10,425 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

According to HSE GPR register at 0x4039_C028, the firmware is NOT installed.

The HSE Firmware package can be downloaded from S32K3 Standard Software:

https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-STDSW-D

Just click on the link and then select „Automotive SW - S32K3 - HSE Firmware“. Here search for latest version for your derivative.

 

We provide application note which explains how to install the firmware. It’s available in Documentation -> Secure files:

https://www.nxp.com/products/S32K3

Search for document “HSE FW install for S32K3xx”.

It’s also described in HSE-B Firmware Reference Manual rev. 2.4 in section “3 HSE Firmware Installation”.

 

There are three methods how to install HSE firmware. Please take a look at section “3   HSE Firmware Installation” in HSE-B Firmware Reference Manual v2.4.
The most convenient method for you is probably installation via IVT. Following steps are requires:
- Program HSE feature flag at 0x1B000000. You can do this anywhere and anytime, by your code or by your debugger. It doesn’t matter.

- Load pink file anywhere to flash (together with your application). Do not use areas reserved for HSE.

- Then put an address of the pink file to IVT. See “14.2.2  IVT Structure” in HSE FW RM v2.4.

 

You can find an example in HSE DemoExamples for this:

https://www.nxp.com/webapp/Download?colCode=S32K3_HSE_DemoExamples

Then search for:

c:\NXP\S32K3_HSE_DemoExamples_1_0_0\S32K3_HSE_DemoExamples\Device_Configuration\S32K344_HSE_FW_INSTALL\

 

This demo shows all the steps.

0 项奖励
回复
10,367 次查看
ALXY_WANG1
Contributor II

The function has been normal after replacing a piece of hardware. When I checked the size of the HSE safety RAM area, I found that the median value of register 0x4039C038 was 0x0000. I would like to ask if this value indicates that I used 0 or if the size of this area is 0

0 项奖励
回复
10,346 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

It's zero and user can't change that:

lukaszadrapa_0-1747374453005.pnglukaszadrapa_0-1747374453005.png

 

0 项奖励
回复
10,326 次查看
ALXY_WANG1
Contributor II
Then where is the RAM key I imported stored and is there any way to obtain it?
0 项奖励
回复
10,314 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

The table describes which "user memories" are allocated for HSE. But HSE has own secure RAM, so no user RAM is allocated, so there's zero in the table.

You are not allowed to read the keys directly from memory anyway. A key can be only exported via HSE service (if such operation is allowed). Please read section "6.2.4 Key export" in HSE firmware reference manual.