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?
解決済! 解決策の投稿を見る。
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!
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:
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.
Best Regards,
Alexandra
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:
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:
Any ideas?
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!
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
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