HSE firmware installation 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? Re: HSE firmware installation Hello guys are you able to solve the error.If yes please help us with this Re: HSE firmware installation Does someone solve the problem? I am issuing same steps with you. I tried both full_mem and ab_swap. both failed.. Re: HSE firmware installation Hi, I think I found a solution. In the memory view, the byte order will be reversed if you select "Hex" or "Hex Integer". The register was set for me, but these views confused me. Re: HSE firmware installation Hi, The "3.3.1 MU Installation steps by host in AB_SWAP configuration" chapter of HSE_B Firmware Reference Manual starts by the following lines: "Write 0xA5 on register DCMRWP1 (0x402AC400, [24:31 bits]) followed by functional reset. This will set Bit 1 in HSE GPR (0x4039C028) indicating SBAF has activated MU0 for installation." but it wasn't mentioned in this thread. Is it necessary to set DCMRWP1 register or is it implemented somehow in the example? Regards, Sandor Re: HSE firmware installation Hello, Any update here? Re: HSE firmware installation Hi, Has the problem been solved? What causes this? My side is also the status register can not be set "1", can you share how to solve? Re: HSE firmware installation Hi @lukaszadrapa , I performed HSE FW erase as you mentioned, and it worked. However, I can not install it back. How to install HSE FW again? Best regards, Yetkin Re: HSE firmware installation Hi @lukaszadrapa ! Regarding the discussion, I'm trying to swap the S32K344 board as well. I followed the following steps: 1) Download the S32K3_HSE_DemoExamples_1_0_0, went for the a/b swap, changed the linker file by adding the .pink file. 2) I compiled the project and ran it, in run time, the code keeps on the following step: /* Wait for HSE to initialize(read status bits) after installation */ while((HSE_STATUS_INIT_OK & HSE_MU_GetHseStatus(0)) == 0) { gInstallHSEFwTest = FW_NOT_INSTALLED; /* Please generate a reset to allow installation */ } 3) I tried to both push the RST button on the board and also powering it off and on again, but apparently it isn`t changing anything. Did I forget a step? Thank you! Re: HSE firmware installation HI Lucas , when can we connect, please provide time and link to connect. Re: HSE firmware installation I'm running out of time today but tomorrow morning should be ok. I will let you know early in the morning when I'm available. Re: HSE firmware installation Or you can create video for the debug settings and debugging the firmware and then share with me. Re: HSE firmware installation Hi Lucas , i tried but its same. Can we connect for a call hardly 10 minutes if possible? please let me know so i will share the invite. Re: HSE firmware installation There's elf file in the project I already shared: https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/S32K/32120/1/HSE_Install_FW.zip
I compared the elf with my current project which I tested today and it's identical, no changes.
I had brand new chip, so I used default hse_disabled version. If HSE feature flash is already enabled but HSE FW is not installed yet, you should use hse_enabled. And once AB swap is installed, you should use ab_swap. But I don't think this could be wrong because Pemicro should show some error if it can't erase or program the flash. Even if you use hse_disabled when HSE feature flag is programmed, it will probably still work.
To install the firmware also to passive block, two resets are needed (or two power cycles, it doesn't matter):
Re: HSE firmware installation Hi Lucas, Thanks for your reply, Can you please share your .elf file. Why you power cycled the board 2 time, is it mandatory to reset is 2 time or power on 2 times? what was the setting during flash, is it ab_sawp.arp or hse_enabled.arp in the advance setting? ? Re: HSE firmware installation I used another brand new board for my test and I used exactly the same project I sent you earlier. I loaded the project by S32DS via in-built Pemicro OpenSDA interface, run the project, power cycled the board 2x and then I can see that the bit in HSE GPR is set and FW is installed.
Once the HSE FW is installed, it's necessary to change the flash algorithm in Pemicro settings:
That's because some parts of flash are allocated for HSE when the HSE feature flag is enabled or when AB swap FW is installed. Pemicro needs to be informed about this. Re: HSE firmware installation 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. Re: HSE firmware installation 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); ? Re: HSE firmware installation 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
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:
Re: HSE firmware installation 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. Re: HSE firmware installation Hi Lucas, Which api you had used to erase the controller with HSE_SRV_ID_ERASE_FW? Please provide the API . Re: HSE firmware installation Attached is whole project. Re: HSE firmware installation Dis you used the project which i shared with you? Kindly share your main program with me. Re: HSE firmware installation Hi Lucas, Can you please share your main program. i have only one board with me and its new one. Re: HSE firmware installation I got new board right now. Here's the result of my test:
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 Re: HSE firmware installation Hi Lucas Any update on this? Re: HSE firmware installation I tried the firmware with the condition on the feature flag but again the hse gpr resgiter is not getting updated. Re: HSE firmware installation 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 Re: HSE firmware installation Please debug it and check why hse gpr register bit is not getting set and installation is not completing by sbaf. Re: HSE firmware installation Please find the project. Re: HSE firmware installation Hi @vikmonti7804
could you please share that project? I will test it on my side.
Thanks,
Lukas Re: HSE firmware installation 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. Re: HSE firmware installation 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. Re: HSE firmware installation 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 Re: HSE firmware installation 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. Re: HSE firmware installation Hi, Actually i have created a project for s32k312 but when i am running it in debug mde i see it directly jumping to default hander not going into main, can you please help with this issue, why this is happening. i see the binary is place in flash but utest is not enabled due to not going into main. kindly help. Re: HSE firmware installation 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 Re: HSE firmware installation 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 Re: HSE firmware installation 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:
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 Re: HSE firmware installation 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. Re: HSE firmware installation Hi , The HSE firmware package foe the S32K312 is only having the bin files and some interface and host files for the creation of the project. It is not the complete project like HSE demo example for s32k344. I am also facing the issue to flash this binary of HSE firmware with the eval board debugger as well as PE micro debugger because it supports only .elf and hex file. kindly help me to flash the binary to the eval board. Re: HSE firmware installation Hi @vikmonti7804
The HSE FW can be found in S32K3 Standard Software package: https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K3-STDSW-D
Open the "Automotive SW - S32K3 - HSE Firmware" and you will see all available versions including version for S32K312.
Mentioned example S32K344_HSE_FW_INSTALL shows an option how to install the firmware. I recommend to read the description: c:\NXP\S32K3_HSE_DemoExamples_1_0_0\S32K3_HSE_DemoExamples\Device_Configuration\S32K344_HSE_FW_INSTALL\Readme.md
We also provide document AN744810 “HSE FW install for S32K3xx” which describes how to install the firmware. It can be found in Documentation in Secure Files section: https://www.nxp.com/products/processors-and-microcontrollers/s32-automotive-platform/s32k-auto-general-purpose-mcus/s32k3-microcontrollers-for-automotive-general-purpose:S32K3
Regards, Lukas Re: HSE firmware installation #hello@vikmonti7804 did u get the solution for the above problem that is programm getting stuck at below ..please hep us if yes please please help us we are trying alot still we are not getting what to do ? Thank u Re: HSE firmware installation #Hello@lukaszadrapa , Please help us we need your help. Our HSE firmware is flashed successfully, but the firmware is not starting after flashing. The system gets stuck at the same point every time and does not continue execution. I am not sure why this is happening. I have a few doubts: Before flashing the firmware, do we need to run any other project like the Key Catalog example or any prerequisite configuration? Earlier, we had flashed HSE Firmware version 2.1, but now we changed the firmware to version 2.55. Could this version change cause the issue? The SBUF version we are reading is 0x00500000. Is this expected for firmware version 2.55? Do we need to make any specific changes in the HSE_FW_INSTALL application code when updating to the new firmware version? we have API provided along with firmware where we need to use them ? Please please guide us on what might be causing the firmware not to start. Thank you Re: HSE firmware installation hello @lukaszadrapa please help us our firmware code itself stucking at i dont know why this is happening please help us firmware flshing i did and verified i dont know why my firmware is not initiating ..please help us Thank u Re: HSE firmware installation # Hello@sandor_b Did you receive any update regarding this issue? We are also facing the same problem — our program is getting stuck at that line. If you have found a solution, could you please share it? It would really
查看全文