Hi:
I use the S32K312 chipset for my project.
1. I have use the FreeRTOS and the version of RTOS is V10.4.6
2. The MCU have been install the HSE firmware s32k3x2_hse_fw_0.13.0_2.6.0_pb221129.bin.pink
3. I used the HSE firmware update service call HSE_SRV_ID_FIRMWARE_UPDATE to update new HSE version. The new version is s32k312_hse_fw_0.13.0_2.40.0_pb230730.bin.pink.
4. My MCU is used the FULL MEM type. Not use the AB_SWAP type.
5. My update HSE firmware source code shown as below.
6. After doing the HSE_FwUpdReq(), The HSE firmware could be update success. I can got the return code 0x55A5AA33UL. But I have got the hard fault during the HSE firmware update. My HardFault_Handler() shown in below. The hard fault doesn't reboot directly. So the HSE_FwUpdReq() can finish and got the success return code 0x55A5AA33UL.
7. I try to implement some code in HardFault_Handler for backtrace dump. So I got the backtrace information like below.
HSE_FwUpdReq accessMode=0x00, pInFwFile=0x00440000, streamLength=0x00000000
FW: S32K312_Application, HW: 0xc3, SW: 9.999_2023-11-25
Fault on interrupt or bare metal(no OS) environment
===== Thread stack information =====
addr: 20407fd8 data: ffffffff
addr: 20407fdc data: ffffffed
addr: 20407fe0 data: 00000000
addr: 20407fe4 data: 00f00000
addr: 20407fe8 data: 00000007
addr: 20407fec data: c0000000
addr: 20407ff0 data: 204033e8
addr: 20407ff4 data: 005046e7
addr: 20407ff8 data: 00504460
addr: 20407ffc data: 21000000
====================================
=================== Registers information ====================
R0 : 00000001 R1 : 00000000 R2 : 20403a4c R3 : 00000010
R12: ffffffff LR : 0050460f PC : 005033a4 PSR: 0100000f
==============================================================
System Handler Control and State Register: 0x00000800
MFSR: 0x00000000
MMAR: 0x005034f4
BFSR: 0x00000083
BFAR: 0x005034f4
UFSR: 0x00000000
HFSR: 0x40000000
DFSR: 0x00000000
AFSR: 0x00000000
Bus fault is caused by instruction access violation
Bus fault is caused by precise data access violation
The bus fault occurred address is 005034f4
Show more call stack info by run: addr2line -e S32K312_Application.elf -afpiC <address list>
005033a4 0050460e 005046e6
[HardFault_Hook]: Reboot mcu
8. Parser the backtrace address shown in below. The bus fault cause by the FreeRTOS API xTaskIncrementTick()
System-Product-Name:/media/S32K312_Application/Debug_FLASH$ addr2line -e S32K312_Application.elf -afpiC 005033a4 0050460e 005046e6
0x005033a4: xTaskIncrementTick at H:\S32K312_Application\Debug_FLASH/../FreeRTOS/Source/tasks.c:2750
0x0050460e: SysTick_Handler at H:\S32K312_Application\Debug_FLASH/../FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c:495
0x005046e6: xPortStartScheduler at H:\S32K312_Application\Debug_FLASH/../FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c:382 (discriminator 2)
System-Product-Name:/media/S32K312_Application/Debug_FLASH$ addr2line -e S32K312_Application.elf -afpiC 005034f4
0x005034f4: xTaskIncrementTick at H:\S32K312_Application\Debug_FLASH/../FreeRTOS/Source/tasks.c:2908
9. Does it because that call the HSE firmware update service then cause the FreeRTOS xTaskIncrementTick() can't increment the tick? Do you have any suggestion? Thanks you!