HSE firmware installation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HSE firmware installation

1,724 Views
vikmonti7804
Contributor III

Hi,

     I want to install the HSE firmware, but i am facing one error with the package given C:\NXP\S32K3_HSE_DemoExamples_1_0_0\S32K3_HSE_DemoExamples\Device_Configuration\S32K344_HSE_FW_INSTALL.

error

make: *** [makefile:38: S32K312_HSE_FW_INSTALL.elf] Error 1

Kindly let me know the solution.

is there any firmware available for s32k312 for HSE fw installation?

0 Kudos
34 Replies

948 Views
vikmonti7804
Contributor III

Hi Lucas,

           Can you please share your main program.

i have only one board with me and its new one.

0 Kudos

938 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Attached is whole project.

0 Kudos

1,377 Views
vikmonti7804
Contributor III

HI,

  the Firmware for the s32k312 is only the file like interface and host, it is not complete project which can flash the HSE firmware binary to controller like s32k344 hse demo example.

I am facing a issue to flash the HSE firmware binry to cntroller as NXP provided only .bin file, i have used the PE micro and eval board built in debugger which is unable to do so, it can support only .elf and .hex file. kindly help me to flash the .bin to controller.

0 Kudos

1,366 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

The firmware is provided in encrypted form as a binary file. Yes, HSE FW installation package contains only the binary (pink) file and corresponding API headers.

For Lauterbach users, there's also HSE DEMOAPP which helps to install the firmware and examine HSE features:

lukaszadrapa_0-1708065109693.png

But notice that the demo works with Lauterbach debugger only. It won't work with Pemicro.

As you can read in the mentioned application note or in HSE FW RM, the firmware can be installed with or without IVT.

Installation without IVT is easier but you need a tool which is able to load raw binary file to the flash which is not the case of Pemicro debugger. In this case, "with IVT" method is more convenient.

We do not provide S32K344_HSE_FW_INSTALL for each derivative. This is just an example showing how it can be done and it's up to users to create own solution (each customer has different requirements and production tools/capabilities).

What to do:
You can create new application project directly for S32K312 in S32 Design Studio. Then copy the source files from S32K344_HSE_FW_INSTALL, update HseFwHeader_StartAddress in boot_header.c. Then modify the linker file - use linker file from S32K344_HSE_FW_INSTALL as a template. If you read the readme.md file as I suggested earlier, there must be a link to the bin/pink file, so it is linked to the project.

Then, the code will only enable HSE feature flag by programming any value different from 0xFFFFFFFFFFFFFFFF at address 0x1B000000. Then all the conditions for installation are satisfied - HSE feature flag is enabled, IVT points to valid pink image in flash, so SBAF will install the firmware after next reset.

Regards,
Lukas

0 Kudos

1,272 Views
vikmonti7804
Contributor III

Hi ,

  If I am able to install the HSE firmware successfully, how to verify this firmware is installed in the secure memory correctly or successfully in the memory.

please let me know any method or check the memory?

Thank You

0 Kudos

1,268 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

You can check bit 0 in HSE GPR status register at 0x4039C028. If it is '1', it means that "HSE FW is present and SBAF Booted HSE Firmware".

You can find this in HSE_B Firmware Reference Manual rev 2.2.

Regards,

Lukas

0 Kudos

1,235 Views
vikmonti7804
Contributor III

Hi Lucas , 

         I am not able to see this register in any peripheral window in S32DS, Can you please tell me exactly where i can see.

i can see the value 0xC1010000 at 0x4039C028 address.

 

0 Kudos

1,223 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I don't think the HSE GPR is defined in peripheral structure, so it's necessary to check the memory directly. If you can see 0xC1010000 at 0x4039C028, the HSE FW is obviously not installed.

Is the HSE feature flash at 0x1B000000 programmed?

And one more thing - I can remember that that if you use "without IVT" method to install the firmware, there can't be valid IVT in the flash. Otherwise it does not work. If you loaded the pink/bin file together with some project, it's necessary to remove the IVT. Or "with IVT" method must be used.

Regards,

Lukas

0 Kudos

1,216 Views
vikmonti7804
Contributor III

Hi,

     I am just following the example code given for the s32k344, so i created same project for the s32k312 and imported the binary from the linker file, i see the 0xAABBCCDD  at 0x1B000000 location in memory window, what can be the problem. Every thing is same as per the example code as s32k344, only i changed the memory location in linker file. Can you please help on urgent basis, or can we connect online for debugging purpose on small call.

please find the snippet of the linker file and program.

vikmonti7804_0-1708531086237.pngvikmonti7804_1-1708531115954.pngvikmonti7804_2-1708531147534.png

 

0 Kudos

1,170 Views
vikmonti7804
Contributor III

Hi,

          kindly check the image attached, the header of the AB_Swap is also there in the memory so it means the firmware is flashed in the memory, the utest area has value AABBCCDDDDCCBBAA it means utest is enabled, the HSE GPR register bit 0 is not getting set, i dont know why? it means after reset the SBAF is not installing the hse firmware in secure memory region.

kindly help on urgent basis.

vikmonti7804_0-1708596640252.png

 

 

Tags (1)
0 Kudos

1,166 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @vikmonti7804 

could you please share that project? I will test it on my side.

Thanks,

Lukas

0 Kudos

1,160 Views
vikmonti7804
Contributor III

Please find the project.

0 Kudos

1,068 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Small problem on my side - I found that I already have firmware 2.6.0 on both my boards and it can't be erased (this feature was added in version 2.40.0). I will get brand new board on Monday and I will test it.

I checked the project anyway and I can see nothing wrong. I would just not program the HSE feature flag unconditionally after each reset.

I will let you know the results of my test on Monday.

Regards,

Lukas

0 Kudos

977 Views
vikmonti7804
Contributor III

Hi Lucas

   Any update on this?

Tags (1)
0 Kudos

969 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I got new board right now. Here's the result of my test:

lukaszadrapa_0-1708948550506.png

I was able to successfully install the firmware using your project. I just uncommented checking of the HSE feature flag. That was the only change I did. 

After that, I could successfully erase the firmware using service HSE_SRV_ID_ERASE_FW.

I'm still not sure why it does not work on your side. Do you have more boards? Are all of them showing the same behavior?

Regards,

Lukas

0 Kudos

885 Views
vikmonti7804
Contributor III

Hi Lucas,

       Which api you had used to erase the controller with HSE_SRV_ID_ERASE_FW?

Please provide the API .

0 Kudos

876 Views
vikmonti7804
Contributor III

I am trying to use FLASH_EraseBlock((uint32_t*)HSE_SRV_ID_ERASE_FW); but it goes into the hard fault.

Can you please explain the steps to erase the memory. 

Should i comment the import of the hse fw file in linker file befor applying this erase?

how it will be done, please explain.

Tags (1)
0 Kudos

866 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

This is new feature and I didn't find API for that in RTD or in HSE DEMO examples. So, I used minimalist option and I simply triggered the service via MU in debugger. Here is the description of the service from API manual:

c:\NXP\HSE_FW_S32K312_0_2_40_0\docs\S32K312_HSE_Service_API_Reference_Manual.pdf

lukaszadrapa_0-1709023598929.pnglukaszadrapa_1-1709023606522.png

So, the service ID is 0x57 and no parameters are needed.

Just write 0x57 somewhere to RAM and then write address of this RAM word to Message Unit MU_0, register TR[1]. That's all. Then you will see the response in RR[1]. If the HSE FW was installed, you should get HSE_SRV_RSP_OK which is value 0x55A5AA33.

Here's how it looks in my debugger:

lukaszadrapa_2-1709023848154.png

 

0 Kudos

858 Views
vikmonti7804
Contributor III

Hi Lucas,

         I dont have debugger PE micro. Does this trace32 power view works with PE micro?

How to trigger the service via MU in debugger with PE micro and s32DS? is there any example code?

How can i erase the controller with S32DS? Is there any example code or should i use the API FLASH_EraseBlock(dst); ?

 

 

0 Kudos

829 Views
vikmonti7804
Contributor III

HI Lucas,

          I tried with different board with same firmware project what you shared but the result is same as earlier. Last bit of the HSE GPR register is not getting set.

Can you please try with PE Micro debugger and try to find the root cause of the problem.

We dont have lauterbach debugger here.

i am sharing the picture of the memory with different board.

vikmonti7804_0-1709101778843.pngvikmonti7804_1-1709101788067.pngvikmonti7804_2-1709101802879.png

 

0 Kudos