Trouble Building Simulink Blink-Example for S32K144 EVB

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

Trouble Building Simulink Blink-Example for S32K144 EVB

Jump to solution
783 Views
aheike
Contributor I

Dear Community,

I am trying to get started with model-based development for the NXP board.

I am using:

- MATLAB / Simulink 2023a (Simulink Coder, Embedded Coder, Matlab Coder are installed)

- NXP S32K144 Q100 EVB purchased this year, probably a rev C

- I also installed S32 Design studio to get the PEMicro drivers

 

What I did:

- I (re-) installed the NXP MBDT v4.3 and the NXP Hardware Support Package S32K1xx as described here

- I tried to follow the further steps in the environment setup and also the licensing seems to have worked well

- I tried to implement the LED-blink example from the HW/SW validation video

 

What I get:

When I simply want to 'build, deploy and start', the build-process seems to work - but it does not create an executable file:

Error:Unable to start target application C:\Users\xxxx\17_MATLAB\03_NXP_MBDT_Test\Blink.exe. It does not exist.

When I just 'compile', the C-compilation seems to throw an error somewhere when using gmake:

### Using toolchain: LCC-win64 v2.4.1 | gmake (64-bit Windows)
### Creating 'C:\Users\xxxxxx\xxxxxx\17_MATLAB\03_NXP_MBDT_Test\Blink_mbd_rtw\Blink.mk' ...
### Building 'Blink': "C:\PROGRA~1\MATLAB\R2023a\bin\win64\gmake" COPY_MDLREF_INCLUDES=0 -f Blink.mk all

C:\Users\xxxxxx\xxxxxx\17_MATLAB\03_NXP_MBDT_Test\Blink_mbd_rtw
> set MATLAB=C:\Program Files\MATLAB\R2023a

C:\Users\xxxxxx\xxxxxx\17_MATLAB\03_NXP_MBDT_Test\Blink_mbd_rtw
> cd .

C:\Users\xxxxxx\xxxxxx\17_MATLAB\03_NXP_MBDT_Test\Blink_mbd_rtw
> if "all" == "" ("C:\PROGRA~1\MATLAB\R2023a\bin\win64\gmake" COPY_MDLREF_INCLUDES=0 -f Blink.mk all ) else ("C:\PROGRA~1\MATLAB\R2023a\bin\win64\gmake" COPY_MDLREF_INCLUDES=0 -f Blink.mk all )
"C:/PROGRA~1/MATLAB/R2023a/sys/lcc64/lcc64/bin/lcc64" -c -w -noregistrylookup -nodeclspec -IC:/PROGRA~1/MATLAB/R2023a/sys/lcc64/lcc64/include64 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DMODEL=Blink -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/xxxxxx/ONEDRI~2/17_MAT~1/03_NXP~1 -IC:/Users/xxxxxx/ONEDRI~2/17_MAT~1/03_NXP~1/Blink_mbd_rtw -IC:/PROGRA~1/MATLAB/R2023a/extern/include -IC:/PROGRA~1/MATLAB/R2023a/simulink/include -IC:/PROGRA~1/MATLAB/R2023a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2023a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2023a/rtw/c/ert -Fo"Blink.obj" "C:\Users\xxxxxx\ONEDRI~2\17_MAT~1\03_NXP~1\Blink_mbd_rtw\Blink.c"
cpp: c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.h:21 c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c:16 Could not find include file "pcc_hw_access.h"
cpp: c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.h:22 c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c:16 Could not find include file "pins_driver.h"
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 37 undeclared identifier 'PTC'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 48 undeclared identifier 'PTD'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 50 undeclared identifier 'PTD'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 62 undeclared identifier 'PCC'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 62 undeclared identifier 'PCC_PORTC_CLOCK'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 65 Syntax error; missing semicolon before `gpioPORTCPin12'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 65 undeclared identifier 'gpioPORTCPin12'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 65 illegal expression
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 66 left operand of . has incompatible type 'int'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 66 undeclared identifier 'PORTC'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 66 the left hand side of the assignment can't be assigned to
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 67 illegal expression
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 67 Syntax error; missing semicolon before `pinPortIdx'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 67 undeclared identifier 'pinPortIdx'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 68 illegal expression
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 68 Syntax error; missing semicolon before `pullConfig'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 68 undeclared identifier 'pullConfig'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 68 undeclared identifier 'PORT_INTERNAL_PULL_NOT_ENABLED'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 69 illegal expression
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 69 Syntax error; missing semicolon before `passiveFilter'
Error c:\users\xxxxxx\onedri~2\17_mat~1\03_nxp~1\blink_mbd_rtw\blink.c: 69 too many errors
gmake: *** [Blink.obj] Error 1

C:\Users\xxxxxx\xxxxxx\17_MATLAB\03_NXP_MBDT_Test\Blink_mbd_rtw
> echo The make command returned an error of 2
The make command returned an error of 2

C:\Users\xxxxxx\xxxxxx\17_MATLAB\03_NXP_MBDT_Test\Blink_mbd_rtw
> exit /B 1
### Build procedure for Blink aborted due to an error.

 

What I am unsure about:

The interface in Simulink has changed quite a lot since the video where I drew the example from. I am actually unsure, if I am using the correct tool to build. The only 'build'-button I find is in the tab 'hardware' (I think from Simulink Coder?). There I configured the system target file description as 'mbd_s32k.tlc' and the device as NXP / CortexM4.

 

I would be rather sure, there is something wrong with my setup, but what am I missing?

 

Thank you and best regards,

Alexander

 

0 Kudos
1 Solution
689 Views
georgevictor
NXP Employee
NXP Employee

Hi, @aheike,

Thank you for using MBDT for S32K1xx in your projects.

The video that you are referring to is indeed obsolete and doesn't reflect the S32K1XX 4.3.0 toolbox layout. I suggest watching the following video that shows a more recent version of the toolbox:

Get to Know the User-Friendly NXP MBDT for Application Development in MATLAB/Simulink.

We include in the toolbox examples that were tested on multiple evaluation boards and are ready to go. You can simply run an example like GPIO that blinks an LED. You can find it in the Examples directory of the toolbox: NXP_MBDToolbox_S32K1xx\S32_Examples\s32k14x\gpio\gpio_s32k144.mdl

In case you want to create a new model, there is no need to configure the Code generation system target file and the Device in model configuration. The MBD_S32K1xx_Config_Information block automatically updates the model settings for the S32K1xx target. All you have to do is drag it into your new model.

Let me know if you managed to run an example on your evaluation board.

 

Best regards,

Victor

View solution in original post

2 Replies
690 Views
georgevictor
NXP Employee
NXP Employee

Hi, @aheike,

Thank you for using MBDT for S32K1xx in your projects.

The video that you are referring to is indeed obsolete and doesn't reflect the S32K1XX 4.3.0 toolbox layout. I suggest watching the following video that shows a more recent version of the toolbox:

Get to Know the User-Friendly NXP MBDT for Application Development in MATLAB/Simulink.

We include in the toolbox examples that were tested on multiple evaluation boards and are ready to go. You can simply run an example like GPIO that blinks an LED. You can find it in the Examples directory of the toolbox: NXP_MBDToolbox_S32K1xx\S32_Examples\s32k14x\gpio\gpio_s32k144.mdl

In case you want to create a new model, there is no need to configure the Code generation system target file and the Device in model configuration. The MBD_S32K1xx_Config_Information block automatically updates the model settings for the S32K1xx target. All you have to do is drag it into your new model.

Let me know if you managed to run an example on your evaluation board.

 

Best regards,

Victor

671 Views
aheike
Contributor I

Dear @georgevictor 

Thank you for the advice, I got to work the example in the more updated tutorial!

One thing, that I learned in the tutorial and that might be worth pointing out is, that there the embedded coder as a MATLAB / Simulink app is used for the compilation. I am not sure, if the same result can be achieved by one of the other 'compile' or 'build' or 'build and deploy'-buttons in other apps. This is a bit confusing.

I hope to be back with more sophisticated questions from more relevant use-cases.

Best regards,

Alexander

0 Kudos