Error .mexw64 is not a valid Win32 application

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

Error .mexw64 is not a valid Win32 application

1,928 Views
patrick_schmid
Contributor I

Hello,
I have a Windows 10 PC (64-bit operating system, x64-based processor) and I followed the Model-Based Design Toolbox MPC57xx Series Quick Start Guide for running the Hello World example on the DEVKIT MPC5744P. I use the current version of the toolbox, i.e. 4.2.0.
When I try to build the Simulink model, i.e. Step 3 of Section 2.4 I get the following error

Error while obtaining sizes from MEX S-function 'uart_mpc_config' in 'uart_hello_world_mpc574xP/UART_Config'.
Caused by:
Invalid MEX-file 'C:\Users\username\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_MPC57xx\code\mbdtbx_mpc\blocks\uart\uart_mpc_config.mexw64': C:\Users\username\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_MPC57xx\code\mbdtbx_mpc\blocks\uart\uart_mpc_config.mexw64 is not a valid Win32 application..

By a short research, I have figured out that it might have to do with some libraries (DLL), but I have thought that they are installed during the installation of S32_Design_Studio by additionally installing Visual Studio redistributables.

I have also tried to specify the compiler path explicitly by the environment variable S32DS_PA_TOOL as described in the quick start guide. Then the following error occurs

Error while obtaining sizes from MEX S-function 'uart_mpc_config' in 'uart_hello_world_mpc574xP/UART_Config'.
Caused by:
Invalid MEX-file 'C:\Users\username\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_MPC57xx\code\mbdtbx_mpc\blocks\uart\uart_mpc_config.mexw64': The specified module could not be found.

 

There still seems to be a library problem...

Can anybody help me?
Many thanks in advance.

0 Kudos
1 Reply

1,881 Views
patrick_schmid
Contributor I

I fixed the problem by installing Visual Studio Community 2019 and thus implicitly install

  • Microsoft Visual C++ 2015-2019 Redistributable (x64)
  • Microsoft Visual C++ 2015-2019 Redistributable (x86)

Consequently, it might be helpful to install these packages already with S32 Design Studio in future releases.

0 Kudos