Why don't imported SDK examples have a .mex file?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Why don't imported SDK examples have a .mex file?

1,594 次查看
devel
Contributor III

 I have an lpcxpresso 54628 board and a 552s28 board, and I figured I'd get up to speed on the tools by looking at examples.

To that end, I imported a handful of examples from the current 2.12.0 SDK.

I notice that none of the examples bother with the MCUXpresso config tools; that is, there are no .mex files in the imported projects.

For example, I imported the lpcxpresso54628_dev_audio_speaker_bm example. There's no .mex file. I choose the MCUXpresso Config Tools option from the "Miscellaneous" section of the Quickstart panel, and choose "Open Peripherals." 

The Config Tools Overview window opens. At the top is a small red X and the line, "Peripheral tool is disabled. Either enable it or select different tool." Over to the side is a USB symbol in a circle, under "Peripherals" and its switch is off. I turn it on. I see a lot of stuff about having to generate and update files, so I do it.

I find the Middleware for USB, and it's got a red X and I think I just destroyed the example. Is this how it's supposed to work?

I'd like to implement the simple USB MIDI class as an example to prove that I understand the device. There's no clear way to even start creating this, as there are canned options but nothing that lets me specify the MIDI streaming interface or set up the descriptors.

At some point I see the .mex file created, but I'm not sure how relevant it is.

0 项奖励
回复
5 回复数

1,587 次查看
ErichStyger
Specialist I

Technically, the .mex file should not be needed: it is a kind of cache of all the settings. The real settings are stored inside the source files in YAML format.

Check for example board/peripherals.c or board/pin_mux.c, they contain comments with YAML text, for example

/*
 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
BOARD_InitPins:
- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
- pin_list:
  - {pin_num: '45', peripheral: GPIOC, signal: 'GPIO, 2', pin_signal: ADC0_SE4b/CMP1_IN0/PTC2/SPI0_PCS2/UART1_CTS_b/FTM0_CH1/FB_AD12/I2S0_TX_FS/LPUART0_CTS_b, direction: OUTPUT,
    gpio_init_state: 'true'}
 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
 */

With starting the config tools, it is supposed to read that information and show it in the config tool, and the same time store it in the .mex file.

Having said that: if this does not work that way for your example(s), then somehow the example(s) did not use the tool, or peripherals are not supported for your device.

Using the IDE menu ConfigTools -> Data Manager you can get an high-level overview what is supported and what not:

ErichStyger_0-1666338693989.png

 

I hope this helps,

Erich

1,582 次查看
devel
Contributor III

"then somehow the example(s) did not use the tool, or peripherals are not supported for your device."

I'm pretty sure it's the former, because I opened one of the USB examples, and the configurator did not know anything about the USB stuff that was included in that example.

But that still doesn't really answer the question. If the configurator is the "intended" mechanism to create a project, why don't the examples include the .mex file which "caches" all of the settings?

1,541 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello devel,

How about click below button, the .mex file will appear:

Alice_Yang_0-1667273003353.png

 

BR

Alice

 

0 项奖励
回复

1,460 次查看
danielholala
Senior Contributor II

Dear @Alice_Yang ,

Your suggestion is not helpful in my opinion. The issue is not about just "having a *.mex" file, it's about having a *.mex file that covers the configuration that the SDK example project uses.

1,451 次查看
devel
Contributor III

Thanks, @danielholala -- you stated my concern/annoyance exactly.

0 项奖励
回复