Help! I wrote an HSE firmware installer based on the official demo project, but after performing two resets, there is no data at HSE installation address 0x007E0000. Does this mean the HSE installation failed? The S32 version is 3.6.8, and the chip is...S32K314, RTD version 7.0.1
1131_0-1788767775138.png1131_0-1788767775138.png1131_0-1788767775138.png
This is an ld file.
1131_1-1788767805874.png1131_1-1788767805874.png1131_1-1788767805874.png
This is the rewritten IVT vector.
1131_2-1788767830677.png1131_2-1788767830677.png1131_2-1788767830677.png
1131_3-1788767849116.png1131_3-1788767849116.png1131_3-1788767849116.png
1131_4-1788767872384.png1131_4-1788767872384.png1131_4-1788767872384.png
Finally, I've attached my HSE installation demo project.
@VaneB Hello
I modified the linker file according to your suggestion and commented out all the entries in the ivt.c file. After restarting the program twice, I observed the status of status = Hse_Ip_GetHseStatus(0u) in debug mode. The status value was 1001 0110 0000, but the 9th bit was 0, indicating that HSE was not installed successfully? Moreover, no version information was obtained. The return value of srvResponse = Hse_Ip_ServiceRequest(0u, u8MuChannel, &request, &pHseSrvDesc) is 0xaa55a11e.
as follows
1131_1-1788838145743.png1131_1-1788838145743.png1131_1-1788838145743.png
1131_2-1788838165453.png1131_2-1788838165453.png1131_2-1788838165453.png
1131_3-1788838180700.png1131_3-1788838180700.png1131_3-1788838180700.png
1131_4-1788838213520.png1131_4-1788838213520.png1131_4-1788838213520.png
Hi @杨工1131
I have a few observations:
HSE_BINARY (R) : ORIGIN = 0x00400000
int_pflash : ORIGIN = 0x00500000, LENGTH = 0x00300000 - __HSE_CODE_SIZE /* 4096KB - __HSE_CODE_SIZE (sBAF + HSE) */
#define HSE_FW_ADDR (__HSE_BIN_START)
.long 0xffffffff /* Offset 0x20: Reserved */
.long LC_CONFIG_ADDR /* Offset 0x24: Lifecycle configuration pointer */
.long CM7_3_VTOR_ADDR /* Offset 0x28: CM7_3 Start address */
.long HSE_FW_ADDR /* Offset 0x2C: Reserved */
Regarding the code, I can see that you are using the same structure as the example, so I would not expect any issues from that part.
BR, VaneB
Hi @杨工1131
Did you also add the start address of the HSE Firmware Pink Header image to the IVT in startup_cm7.s, after the CM7_3 start address?
Since D-Cache is enabled, to avoid cache-related issues, force all HSE-related data, such as service descriptors, key handles, and input/output buffers, into a non-cacheable memory region by placing them in the appropriate memory section. For example:
hseAttrFwVersion_t __attribute__((section(".mcal_data_no_cacheable"))) gHseFwVersion = {0U};
Also, do not call Hse_Ip_Init(). The application should first wait until the HSE firmware has completed its initialization by checking the status bits in the FSR and confirming that HSE_STATUS_INIT_OK is set. No requests should be sent to the HSE before this condition is met.
Finally, did you perform an MCU reset after enabling HSE firmware usage?