MBDT for KVx Series MCUs 1.0.0 Build failure

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

MBDT for KVx Series MCUs 1.0.0 Build failure

Jump to solution
1,276 Views
Dilettante
Contributor II

I thought I'd give the very new, fresh out of the oven, MBDT for KVx 1.0.0 a go and so I installed it and I loaded a basic model, frdmkv31f_gpio_polling.mdl. I configured the model for my environment, i.e. OpenSDA drive, port, et al. The build encounters a hiccup here:

 

### Evaluating PostCodeGenCommand specified in the model
Failure in mbd_kvx_generate_configuration_code(0) : MEX code generation: Failed to generate configuration files for mex "C:\Users\Dilettante\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_KVx\KVx_Examples\KV3x\gpio\gpio_polling\frdmkv31f_gpio_pollingConfig.mex"

 

which in turn throws a warning in the compile stage: 

 

C:/Users/Dilettante/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/NXP_MB~1/KVX_EX~1/KV3x/gpio/GPIO_P~1/frdmkv31f_gpio_polling_ert_rtw/ert_main.c:50:3: warning: implicit declaration of function 'BOARD_BootClockRUN'; did you mean 'BOARD_BootClockHSRUN'? [-Wimplicit-function-declaration]
   50 |   BOARD_BootClockRUN();
      |   ^~~~~~~~~~~~~~~~~~
      |   BOARD_BootClockHSRUN

 

 not finding the declaration of the function in the ConfigTool-generated code, I assume. The function is not declared, nor defined anywhere in the project folder, although it is mentioned in the MEX file. Of course, the linker trips over when it cannot resolve the reference:

 

c:/users/Dilettante/appdata/roaming/mathworks/matlab add-ons/toolboxes/nxp_mbdtoolbox_kvx/tools/buildtools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: ert_main.o: in function `main':
C:/Users/Dilettante/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/NXP_MB~1/KVX_EX~1/KV3x/gpio/GPIO_P~1/frdmkv31f_gpio_polling_ert_rtw/ert_main.c:50: undefined reference to `BOARD_BootClockRUN'
collect2.exe: error: ld returned 1 exit status

 

Now it all seems to start with the call to  mbd_kvx_generate_configuration_code, which is a p-file, so can't see within. Given that it is a brand new installation, and all else seems in order, any suggestions?

0 Kudos
1 Solution
1,249 Views
Dilettante
Contributor II

What do you know? I got it to work!

I had to go to the MCUXpresso SDK Dashboard, go to the SDK 2.8.0 that I had created in the past for MCUxpresso IDE, download just the config data archive, "SDK_2.8.0_FRDM-KV31F_ConfigTools_data.zip", go to the Config Tool at File -> Data Manager, Import the file, and then from there on all built. Of course, the app also works on the target, so all is honky-dory! 

View solution in original post

0 Kudos
5 Replies
1,262 Views
nxa11767
NXP Employee
NXP Employee

Hello Dilletante,

Before loading any models, did you run the m script: mbd_kvx_path.m  found in the root of the toolbox path? Did you see any errors while running it? On success you should see in the matlab command window a similar log:

nxa11767_0-1609919495405.png

After you open the model, did you see a new file next to the model called: frdmkv31f_gpio_pollingConfig.mex ?

If you did the above steps and still see the problem, then can you please try the next: open the GPIO block and press the Configure button. That action will open another tool - MCUX Configuration Tool (it might take a little longer when opening this tool for the first time), and will open that .mex file I mentioned above with the peripherals configuration parameters. I want to know if it opens this configuration on your side and if you noticed any errors reported.

nxa11767_1-1609919926043.png

 

Best Regards,

Alexandra

 

0 Kudos
1,256 Views
Dilettante
Contributor II

Hello Alexandra,

Thank you for replying.

I undertook all the steps in Chapter 1 of the document "Model_Based_Design_Toolbox_KVx_Series_Quick_Start_Guide.pdf" successfully, including running  the script 'mbd_kvx_path.m' to a successful completion.

The things I changed after opening the model were as follows:

Configuration Parameters -> Hardware Implementation -> Hardware board settings -> Target hardware resources -> Download set to the drive of my Freedom board

However, when I open the Configuration Tool, I am presented with the following:

ConfigToolsError.png

I am connected to the Internet. All the settings did not make the tool budge. I also tried importing the SDKs that are shipped with the MBDT, but to no avail. One interesting thing I noticed, though: when trying to create a new configuration in the Config Tools v9, I got this:

SDK.png

Any ideas?

 

0 Kudos
1,250 Views
Dilettante
Contributor II

What do you know? I got it to work!

I had to go to the MCUXpresso SDK Dashboard, go to the SDK 2.8.0 that I had created in the past for MCUxpresso IDE, download just the config data archive, "SDK_2.8.0_FRDM-KV31F_ConfigTools_data.zip", go to the Config Tool at File -> Data Manager, Import the file, and then from there on all built. Of course, the app also works on the target, so all is honky-dory! 

0 Kudos
1,240 Views
nxa11767
NXP Employee
NXP Employee

I'm glad to hear that it worked. The MCUX Configuration Tool within the toolbox is a newer version and it looks to be some issues with the online update site used to get the processor data - i will try to find more about and keep you posted.

Another solution for this is to use another installation of the MCUX Configuration Tool in the Simulink models. E.g you can install the standalone version 8.1 of the MCUX CFG Tool and point in the model to that installation path - this change can be done in the Target Hardware Resources under User Paths/ MCUX Configuration Tools location.

 

BR,

Alexandra

 
 

 

 

 

 

 

 

0 Kudos
1,215 Views
Dilettante
Contributor II

That is a good point. I noticed that with the latest version of MCUxpresso IDE there is a ConfigTools version, but baked into the IDE, rather than a standalone. The ConfigTools version in the MBDT 1.0.0 seems to be v9, as does the one in MCUxpresso IDE, but the stand-alone version available to download is v8.1. Any rationale for why the v9 is not available as a standalone? Other than copying it from the MBDT directory structure

0 Kudos