Matlab R2018a - S32K148EVB - Model build problem

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

Matlab R2018a - S32K148EVB - Model build problem

Jump to solution
2,655 Views
mfarag
Contributor II

Hi all,

I have a problem with flashing the S32K148EVB with Simulink auto code generation toolbox. 

I followed the steps proposed in the "Model_Based_Design_Toolbox_Quick_Start.pdf" and was trying to flash the hello world UART example. I always get the following error.

Can someone help?

--------------------------------------------------------------------------------------------------------------------------------------------------------

### Starting build procedure for model: lpuart_hello_world_s32k14x
### Generating code and artifacts to 'Model specific' folder structure


### Generating code into build folder: C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\lpuart_hello_world_s32k14x_mbd_rtw
Warning: This concatenation operation includes an empty array with an incorrect number of rows.
Concatenation including empty arrays will require all arrays to have the same number of rows in a future release. [7 similar]
### Invoking Target Language Compiler on lpuart_hello_world_s32k14x.rtw
### Using System Target File: C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\mbd_s32k14.tlc
### Using Model-Based Design Toolbox for S32K1xx Series 2018.R1 (R2016b-R2018a) 23-Jul-2018
### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code
### Writing header file lpuart_hello_world_s32k14x_types.h
.
### Writing source file lpuart_hello_world_s32k14x.c
### Writing header file lpuart_hello_world_s32k14x_private.h
### Writing header file lpuart_hello_world_s32k14x.h
### Writing header file rtwtypes.h
### Writing source file lpuart_hello_world_s32k14x_data.c
.
### Writing source file mbd_main.c
### TLC code generation complete.
.
### Processing Template Makefile: C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\mbd_s32k14.tmf
### Creating lpuart_hello_world_s32k14x.mk from C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\mbd_s32k14.tmf
### Building lpuart_hello_world_s32k14x: .\lpuart_hello_world_s32k14x.bat
C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\lpuart_hello_world_s32k14x_mbd_rtw>set MATLAB=C:\Program Files\MATLAB\R2018a
C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\lpuart_hello_world_s32k14x_mbd_rtw>"C:\Program Files\MATLAB\R2018a\bin\win64\gmake" -f lpuart_hello_world_s32k14x.mk COPY_MDLREF_INCLUDES=0 GENERATE_ERT_S_FUNCTION=0 INCLUDE_MDL_TERMINATE_FCN=1 COMBINE_OUTPUT_UPDATE_FCNS=1 MULTI_INSTANCE_CODE=0 INTEGER_CODE=0 ISPROTECTINGMODEL=NOTPROTECTING
Cleaning...
RELATIVE_PATH_TO_ANCHOR is ..
==== Removing object files from build directory ====
Copying necessary files to build directory...
Compiler details : "C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O1 -g -gstrict-dwarf -DARM_MATH_CM4 -D__FPU_PRESENT=1 -D__FPU_USED=1 -D__NVIC_PRIO_BITS=FEATURE_NVIC_PRIO_BITS -o SetupFiles -DCPU_S32K148 -I. -I.. -I.. -I"C:\Program Files\MATLAB\R2018a\simulink\include" -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\rtw\c\src" -I"C:\Program Files\MATLAB\R2018a\rtw\c\libsrc" -I"C:\Program Files\MATLAB\R2018a\rtw\c\src\ext_mode\common" -I"C:\Program Files\MATLAB\R2018a\rtw\c\src\ext_mode\tcpip" -I"C:\Program Files\MATLAB\R2018a\rtw\c\src\ext_mode\serial" -I"C:\Program Files\MATLAB\R2018a\rtw\c\src\ext_mode\custom" -IC:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code -IC:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\lpuart_hello_world_s32k14x_mbd_rtw -IC:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\S32_Examples\common\lpuart -I"C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi/arm-none-eabi/include" -I"./common" -I"./inc" -I"./src/clock/S32K1xx" -I"./src/sim/S32K148" -I"./src/power/S32K1xx" -I"./S32K148/include" -I"../common" -I"../inc" -I"../src/clock/S32K1xx" -I"../src/sim/S32K148" -I"../src/power/S32K1xx" -I"../S32K148/include"
Assembler details : "C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -x assembler-with-cpp -o SetupFiles
Product: lpuart_hello_world_s32k14x.mot
Build product type: executable
Building file startup_S32K148.o...
"C:\Users\MMM\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -x assembler-with-cpp -o startup_S32K148.o startup_S32K148.s
gmake: *** [startup_S32K148.o] Error 1

### Build procedure for model: 'lpuart_hello_world_s32k14x' aborted due to an error.

Error(s) encountered while building "lpuart_hello_world_s32k14x"

Labels (2)
1 Solution
1,805 Views
constantinrazva
NXP Employee
NXP Employee

I'd like you to try one more thing - please run this in the MATLAB terminal

setenv('PATH',[getenv('PATH'),';C:\Users\MMM\Documents\MATLAB\AddOns\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi\bin']);

After running this command, can you run your model again? If this works, it can be that it can't find libwinpthread-1.dll. This is used by gcc 6.3. For this, as a hotfix you should go to the environmental variables in windows and add it to your PATH variable - the value for it being

C:\Users\MMM\Documents\MATLAB\AddOns\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi\bin

Kind regards,

Razvan.

View solution in original post

5 Replies
1,805 Views
constantinrazva
NXP Employee
NXP Employee

Hello mfarag‌,

As I'm not currently able to reproduce that error on my side, could you give me some more details?

Can you run

ver

 

command in the MATLAB interpreter and write here its output ? And can you attach the example you're having trouble running, so I have the exact settings you're running it with?

Also can you try and reset the MATLAB path? Sometimes we get strange issues when some paths are broken/invalid .For that you should go to MATLAB Home tab -> Set Path -> Default -> Save.

Capture.JPG

Untitled.png

and then run the mbd_s32k_path script again, so you install the path for the toolbox over a fresh, default MATLAB path. 

 

Note: this will remove additional toolboxes path, so you'll have to add them back later.

Kind regards,

Razvan.

0 Kudos
1,805 Views
constantinrazva
NXP Employee
NXP Employee

Also you can watch this video to go through the installation part (if you haven't already). This is for a previous version, but the steps are the same on our latest release.

More information you can find on the following:

S32 – Videos - https://community.nxp.com/thread/465923

S32 – How To - https://community.nxp.com/thread/465924

S32 – Tutorials - https://community.nxp.com/thread/465925

Hope this helps,

Razvan.

0 Kudos
1,806 Views
constantinrazva
NXP Employee
NXP Employee

I'd like you to try one more thing - please run this in the MATLAB terminal

setenv('PATH',[getenv('PATH'),';C:\Users\MMM\Documents\MATLAB\AddOns\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi\bin']);

After running this command, can you run your model again? If this works, it can be that it can't find libwinpthread-1.dll. This is used by gcc 6.3. For this, as a hotfix you should go to the environmental variables in windows and add it to your PATH variable - the value for it being

C:\Users\MMM\Documents\MATLAB\AddOns\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi\bin

Kind regards,

Razvan.

1,805 Views
mfarag
Contributor II

Thank you constantinrazvan.chivu

1,805 Views
mfarag
Contributor II

Hi Razvan,

Thanks for your fast response.

  • Regarding the setup processes

I followed this video and please check the attached photos

  • Regarding the example I am running

Please check the attached files

  • Regarding the enviroment variables: 

>> getenv('GCC_S32K_TOOL')

         ans = 'C:\Users\Moe\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi'

  • Regarding the ver

>> ver

         -----------------------------------------------------------------------------------------------------
         MATLAB Version: 9.4.0.813654 (R2018a)
         Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 17134)
         Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
         -----------------------------------------------------------------------------------------------------
         MATLAB Version 9.4 (R2018a) 
         Simulink Version 9.1 (R2018a) 
         Aerospace Blockset Version 3.21 (R2018a) 
         Aerospace Toolbox Version 2.21 (R2018a) 
         Antenna Toolbox Version 3.1 (R2018a) 
         Audio System Toolbox Version 1.4 (R2018a) 
         Automated Driving System Toolbox Version 1.2 (R2018a) 
         Communications System Toolbox Version 6.6 (R2018a) 
         Computer Vision System Toolbox Version 8.1 (R2018a) 
         Control System Toolbox Version 10.4 (R2018a) 
         Curve Fitting Toolbox Version 3.5.7 (R2018a) 
         DSP System Toolbox Version 9.6 (R2018a) 
         Data Acquisition Toolbox Version 3.13 (R2018a) 
         Embedded Coder Version 7.0 (R2018a) 
         Filter Design HDL Coder Version 3.1.3 (R2018a) 
         Fixed-Point Designer Version 6.1 (R2018a) 
         Fuzzy Logic Toolbox Version 2.3.1 (R2018a) 
         GPU Coder Version 1.1 (R2018a) 
         Image Acquisition Toolbox Version 5.4 (R2018a) 
         Image Processing Toolbox Version 10.2 (R2018a) 
         MATLAB Coder Version 4.0 (R2018a) 
         MATLAB Compiler Version 6.6 (R2018a) 
         MATLAB Compiler SDK Version 6.5 (R2018a) 
         MATLAB Distributed Computing Server Version 6.12 (R2018a) 
         MATLAB Report Generator Version 5.4 (R2018a) 
         Model Predictive Control Toolbox Version 6.1 (R2018a) 
         Model-Based Calibration Toolbox Version 5.4 (R2018a) 
         Model-Based Design Toolbox for S32K1xx Series Version 2018.R1 (R2016b-R2018a)
         Neural Network Toolbox Version 11.1 (R2018a) 
         Optimization Toolbox Version 8.1 (R2018a) 
         Parallel Computing Toolbox Version 6.12 (R2018a) 
         Partial Differential Equation Toolbox Version 3.0 (R2018a) 
         Phased Array System Toolbox Version 3.6 (R2018a) 
         Polyspace Bug Finder Version 2.5 (R2018a) 
         Polyspace Code Prover Version 9.9 (R2018a) 
         Powertrain Blockset Version 1.3 (R2018a) 
         Robotics System Toolbox Version 2.0 (R2018a) 
         Robust Control Toolbox Version 6.4.1 (R2018a) 
         Signal Processing Toolbox Version 8.0 (R2018a) 
         Simulink 3D Animation Version 8.0 (R2018a) 
         Simulink Check Version 4.1 (R2018a) 
         Simulink Code Inspector Version 3.2 (R2018a) 
         Simulink Coder Version 8.14 (R2018a) 
         Simulink Control Design Version 5.1 (R2018a) 
         Simulink Coverage Version 4.1 (R2018a) 
         Simulink Design Optimization Version 3.4 (R2018a) 
         Simulink Design Verifier Version 3.5 (R2018a) 
         Simulink Desktop Real-Time Version 5.6 (R2018a) 
         Simulink PLC Coder Version 2.5 (R2018a) 
         Simulink Real-Time Version 6.8 (R2018a) 
         Simulink Report Generator Version 5.4 (R2018a) 
         Simulink Requirements Version 1.1 (R2018a) 
         Simulink Test Version 2.4 (R2018a) 
         Stateflow Version 9.1 (R2018a) 
         System Identification Toolbox Version 9.8 (R2018a) 
         Vehicle Dynamics Blockset Version 1.0 (R2018a) 
         Vehicle Network Toolbox Version 4.0 (R2018a) 

---------------------------------------------------------------------------------------------------------------------------------------------------------------

1.PNG

---------------------------------------------------------------------------------------------------------------------------------------------------------------

3.PNG

---------------------------------------------------------------------------------------------------------------------------------------------------------------

pastedImage_19.png

---------------------------------------------------------------------------------------------------------------------------------------------------------------

2.PNG

---------------------------------------------------------------------------------------------------------------------------------------------------------------

0 Kudos