Unable to flash S32K3X4EVB-T172 using MBDT

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

Unable to flash S32K3X4EVB-T172 using MBDT

1,741 Views
eduardovila
Contributor I

We have purchased a S32K3X4EVB-T172 board for PIL testing.

On my windows machine, I installed all software according to the guide https://www.nxp.com/document/guide/mcu-automotive-board-quick-starts:GS-S32K3X4EVB-T172

I am able to flash via S32 Design Studio for the S32 Platform 3.6.1.

But once I try using MATLAB 2023a and NXP Support Package S32K3 1.4.0, I am not able to flash.

I am using these outdated versions since they are the latest supported by the BMS Support Package.

In an empty directory, I created a blank simulink model (asdf.mdl) and in the hardware settings:

1) Hardware> Set it to Hardware Part: S32K344-Q172;
2) Tool Paths > Set it to Configuration Tool: S32 Configuration Tool;
3) Download > Left it to USB Multilink/Embedded Debugger - JTAG, Target Memory: FLASH

When I press "Build, Deploy & Start", it builds but is unable to download to the board.

Simulink diagnostics says "Error:Problem occured while downloading the application on target. Download aborted!"

A pop-up says "Runtime error 216 at 6C64A7AE"

A command line window says:

 

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>set WINDOW_TITLE="mbd_s32k3_pegdbserver_window_title"

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>set SERVER_FULL_NAME="C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\pegdbserver_console.exe"

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>set S32K3_PLATFORM="NXP_S32K3xx_S32K344"

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>set SERVER_PORT=7224

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>set MI_PORT=6224

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>set SPEED=5000

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>title "mbd_s32k3_pegdbserver_window_title"

C:\Users\EduardoVila\Repos\asdf\asdf_ert_rtw>"C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\pegdbserver_console.exe" -device="NXP_S32K3xx_S32K344" -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=USBMULTILINK -speed=5000 -port=USB1

P&E GDB Server for Arm(R) devices, Version 9.01.00.00
Copyright 2018, P&E Microcomputer Systems Inc, All rights reserved

Loading library C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\unit_ngs_arm_internal.dll ... Done.

Command line arguments: -device=NXP_S32K3xx_S32K344 -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=USBMULTILINK -speed=5000 -port=USB1
Device selected is NXP_S32K3xx_S32K344
User Specified Hardware Selection : Interface=USBMULTILINK and Port=USB1
Connecting to target.
Unable to load libusb0.dll
PEmicro Interface detected - Flash Version 10.98

Starting reset script (C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\P&E\supportFiles_ARM\NXP\S32K3xx\S32K344.mac) ...o
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 (C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\P&E\supportFiles_ARM\NXP\S32K3xx\S32K344.mac) completed.

Device is NXP_S32K3xx_S32K344.
Mode is In-Circuit Debug.

(C)opyright 2012, P&E Microcomputer Systems, Inc. (www.pemicro.com)
API version is 101

TARGET XML PATH is C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\P&E\supportFiles_ARM\target_v7m_vfp.xml
Server 1 running on 127.0.0.1:7224
Server 2 running on 127.0.0.1:7226
Server 3 running on 127.0.0.1:7228
Server 4 running on 127.0.0.1:7230
Server 5 running on 127.0.0.1:7232
Server 6 running on 127.0.0.1:7234
Server 7 running on 127.0.0.1:7236
Server 8 running on 127.0.0.1:7238
Server 9 running on 127.0.0.1:7240
Server 10 running on 127.0.0.1:7242
Server 11 running on 127.0.0.1:6224
All Servers Running
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "56192" to 7224
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.
Unable to load libusb0.dll
Copyright 2023 P&E Microcomputer Systems,Inc.
Command Line :"C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\pegdbserver_console.exe" -device="NXP_S32K3xx_S32K344" -star?
PEmicro Interface detected - Flash Version 10.98

CMD>RE

Initializing.
Target has been RESET and is active.
CMD>CM C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\P&E\supportFiles_ARM\NXP\S32K3xx\nxp_s32k344_1x32x1012k_hse_disab

.ARP file does not exist.
Error loading programming algorithm - load aborted.
Error occured during Flash programming.

Starting reset script (C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\P&E\supportFiles_ARM\NXP\S32K3xx\S32K344.mac) ...o
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 (C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\eclipse\plugins\com.pemicro.debug.gdbjtag.pne.alpha_5.4.7.202301252033\win32\gdi\P&E\supportFiles_ARM\NXP\S32K3xx\S32K344.mac) completed.


PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session.

And I also get a log from Simulink saying:

C:\Users\EduardoVila\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
GNU gdb (GDB build.sh rev=g0219b1f s=F930 Earmv7nGDB (BLD = 1701)) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from C:/Users/EduardoVila/Repos/asdf/asdf.elf...
Remote debugging using tcp:localhost:7224
0x00402420 in Adc_Calibrate (Unit=<optimized out>, pStatus=0x0)
at C:/Users/EduardoVila/Repos/asdf/asdf_Config/RTD/src/Adc.c:4463
4463 if ((Std_ReturnType)E_OK == Adc_ValidateCallAndUnit(ADC_CALIBRATE_ID, Unit, CoreId))
Loading section .pflash, size 0x23508 lma 0x400000
Loading section .ARM.exidx, size 0x8 lma 0x423508
Loading section .sram_data, size 0x180 lma 0x423510
Loading section .non_cacheable_data, size 0x10 lma 0x423690
Remote communication error. Target disconnected.: Not a directory.

 

0 Kudos
Reply
1 Reply

1,504 Views
georgevictor
NXP Employee
NXP Employee

Hi @eduardovila

Please check the latest MBDT 1.7.0 release, as the S32K3X4EVB-T172 board was not validated on version 1.4.0, which might explain the download issue you are seeing. The newer release includes important fixes and extended support for S32K3 devices.

Also, review the NXP Community thread (link) in case you encounter reset-related issues similar to those discussed there. Some users reported that incorrect reset handling during flashing, and I suggested some workarounds there.

Best regards,
Victor

0 Kudos
Reply