blog icon indicating copy to clipboard operation
blog copied to clipboard

[S32K344] HSE Installation

Open carloscn opened this issue 6 months ago • 0 comments

[S32K344] HSE Installation

1. HSE固件bin文件下载

由于下载HSE是exe打包好的,你也可以从 https://github.com/carloscn/libs/tree/master/nxp/s32k344 下载,这里面包含了解压之后的所有HSE及HSE demo的源代码。也可以从官方渠道获取,如下:

Please downloaded from S32K3 Standard Software

Automotive SW - S32K3 - HSE Firmware >  S32K344 HSE FW 0.2.40.0 SR Release. Note: This release supports the S32K344, S32K324, and S32K314.

2. HSE固件安装程序的编译

HSE固件通过建立S32DS工程,然后编译下载程序到板子之后再进行安装,通常需要两个power cycle来完成HSE的安装。

2.1 固件源程序下载

固件程序下载: https://github.com/carloscn/libs/tree/master/nxp/s32k344

2.2 固件源程序导入

使用File → Import 功能导入程序:

选择HSE installation源代码的路径:

在工程找到这个文件:

2.3 加载HSE的bin文件

替换两个地方的HSE的bin文件,这个文件在 1. HSE固件bin文件下载 章节寻找。这里分为两个HSE binary,一个是给AB分区的,一个是个Full memory的。我们根据业务的要求,后面会有OTA所以使用AB分区的HSE。

同样的文件还需要更改,一样的路径:

2.4 编译

点击小锤子编译。

LOG输出证明成功:

3. HSE固件安装程序的运行

编译完了就开始运行,这个工程由于是在windows的建立的,导入之后对于GDB的环境变量解析有点问题,所以需要手动更正一下。

GDB可以从这里下载:https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-eabi/gcc-linaro-7.5.0-2019.12-x86_64_arm-eabi.tar.xz

自己解压到相应的目录之后可以如图配置gdb的路径。

3.1 HSE固件安装程序的运行

按照[S32K344] PE调试器的使用 和板子建立链接。点击debug按钮:

会有如下log

Connection from "127.0.0.1" via 127.0.0.1. Connection from port "49858" to 6224
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "53272" to 7224
Telnet server running on 127.0.0.1:51794
Searching for Kernel Symbols...
rsp_qC - qSymbol: 5F74785F7468726561645F63757272656E745F707472
  _tx_thread_current_ptr not found. ThreadX analysis not enabled.
rsp_qC - qSymbol: 707843757272656E74544342
  pxCurrentTCB not found. FreeRTOS analysis not enabled.
Copyright 2024 P&E Microcomputer Systems,Inc.
Command Line :/home/haochenwei/opt/S32DS.3.5/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_5.7.8.202404031741/lin/pegdbserver_console  -device=NXP_S32K3xx_S32K344 -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=USBMULTILINK -speed�
PEmicro Interface detected - Flash Version 11.37 
 
CMD>RE
 
Initializing.
Target has been RESET and is active.
CMD>CM /home/haochenwei/opt/S32DS.3.5/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_5.7.8.202404031741/supportFiles_ARM/NXP/S32K3xx/nxp_s32k344_1x32x1012k_hse_disabled.arp
 
Initializing.
Initialized.
 
;version 1.02, 01/18/2024, Copyright 2024 P&E Microcomputer Systems, www.pemicro.com [S32K3x4_hse_disabled]
 
;device nxp, s32k344, 1x32x1012k,desc=hse_disabled 
 
;begin_cs device=$00400000, length=$003F4000, ram=$20400000
 
Loading programming algorithm ... 
 
WARNING - Selected .ARP file has been modified. CRC16 = $4298 
Done.
Programming sequency is : erase, blank check, program, and verify {default} 
CMD>VC
Verifying object file CRC-16 to device ranges ... 
   block 00400000-0042D05F ... 
Calculated CRC-16 does not match block. (File = $FD5C, Device = $E264) 
Current content of flash does not match application to be programmed 
 
CMD>EM
 
Erasing.
Module has been erased.
CMD>PM
 
Programming.
 
Checking range of data. 
Checked.
Processing Object File Data ... 
                                
                                
. 
Programmed.
CMD>VC
Verifying object file CRC-16 to device ranges ... 
   block 00400000-0042D05F ... 
Ok. 
   block 00500000-00500FFB ... 
Ok. 
   block 00501000-00501437 ... 
Ok. 
   block 10000000-100000FF ... 
Ok. 
   Checksum Verification Successful. (Cumulative CRC-16=$76CC) 
 
CMD>RE
 
Initializing.
Target has been RESET and is active.
 
Starting reset script (/home/haochenwei/opt/S32DS.3.5/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_5.7.8.202404031741/supportFiles_ARM/NXP/S32K3xx/S32K344.mac) ...  
REM Enable clocks for selected cores in MC_ME module (the sequence below enables all clocks).                                                                                                            
REM Initialize RAM and DMA:                                                                                                                                                                              
REM Initialize DMA TCD:                                                                                                                                                                                  
REM Copy valid executable code to RAM for each core to be used.                                                                                                                                          
REM Enable required cores in MC_ME:                                                                                                                                                                      
Delaying for 20mS ... 
Done. 
 
Reset script (/home/haochenwei/opt/S32DS.3.5/eclipse/plugins/com.pemicro.debug.gdbjtag.pne_5.7.8.202404031741/supportFiles_ARM/NXP/S32K3xx/S32K344.mac) completed. 

==烧录之后,板子点运行,等待一会儿。==

接着,板子断电

然后,板子上电 (板子重启,下一个power才会真正的安装HSE)

重新再烧录一次程序

==板子点运行==

查看寄存器的值,如果读出以下的版本证明HSE安装成功。

程序也会来到:

注意事项

安装的HSE FW的版本与SBAF的版本必须一致。

旧版 新版
SBAF 00000500_00040900 and before 00000500_03000A00 and beyomd
HSE FW HSE_1.1.0 and before HSE_2.1.0 and beyond

可以在0x4039c020处查看SBAF的版本号:

SBAF版本号将由“00”变为“01”,表示这是与AB swap SBAF。
我这里就是【01】 05 00 00 00 0A 00 03。

carloscn avatar Aug 08 '24 08:08 carloscn