iMXRT: Model won't solve when activating USB

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

iMXRT: Model won't solve when activating USB

1,651 Views
Sam_ECU
Contributor V

Hello @stefancinipeanu 

I'm trying to enact USB-HID on the iMXRT1010-EVB to test the MCU Boot Utility.

I can active USB-HID in .mex but the MBDT model won't solve.

I've attached the error log. The missing file "usb_device_composite" is generated, but in the "Source - generated" folder.

Also, how can I active HID (Flashing) and CDC (Freemaster) over the one USB-Port when using MBDT?

Regards,
Sam

0 Kudos
Reply
4 Replies

1,645 Views
stefancinipeanu
NXP Employee
NXP Employee

Hello, @Sam_ECU 

The USB_OTG peripheral is not supported by the last version of the NXP MBDT IMXRT toolbox. Even if you enable the USB peripheral from the MCUXpresso ConfigTools, the compiler was not instruct to build the sources generated for this peripheral and Simulink Coder will through this kind of error. 

All peripherals that are supported by our toolbox are listed in the Release Notes.

Also, regarding the MCU BootUtility, as far as I know, it uses the Flashloader behind, which generates a bootable image file from an executable axf file, then it will load the generated bootable image file into the QSPI NOR Flash memory. For this kind of deploying an executable file, we have support for IMXRT1010 and IMXRT1060. For testing the Flashloader, in your model you can click on Hardware settings button, then go on Hardware Implementation -> Target Hardware resources-> Download tab and you can choose from multiple download methods.

Regards,

Stefan

0 Kudos
Reply

1,639 Views
Sam_ECU
Contributor V

Hello @stefancinipeanu 

I had read through the release notes but understood, that there were no supported blocks in MBDT (eg. "GPIO Input"). Not that functionality wouldn't be available at all. Lesson learned.

Is USB something that can be expected to be supported in the future?

Is there a way to import a compiled MBDT project into MCUXpresso to further the project and then recompile?

Regards,
Sam

0 Kudos
Reply

1,619 Views
stefancinipeanu
NXP Employee
NXP Employee

Hello, @Sam_ECU 

Sorry for the delayed answer.

Currently, we do not have any plans to add support for USB peripheral for IMXRT toolbox, but I have a kind of approach for your case. So in order to build your application to use USB, you have to do some preliminary steps:

1. You have to go in MCUXpreeso IDE, to import an USB example for IMXRT1010, for example evkmimxrt1010_dev_hid_generic_bm;

2. Copy the usb folder and the osa folder from MCUXpresso IDE into the generated evkmimxrt1010_gpio_interruptConfig folder in MATLAB;

stefancinipeanu_0-1654869922331.png

3. In your Simulink model, go to Hardware tab, Hardware Settings -> expand Code Generation drop-down->Custom Code->Additional build information and to Include directories and Source files text areas add the following folders and source file as shown in the next pictures:

stefancinipeanu_1-1654870204456.png

stefancinipeanu_2-1654870232035.png

The model should now build with no errors. More information about adding external C code sources and custom code you will find on the following link

Also, the functionality of importing the generated Simulink project into MCUXpresso is available. To do this, you have to go again to Hardware Settings->Hardware Implementation->Target hardware resources->Tools Paths. There you will find an option for Export generated projects

stefancinipeanu_4-1654871434773.png

 

You have to click the Export button, and it will pop-up an exporting option which will let you choose where to export the generated project: in the model folder or to a different path in the local file system. There will be 2 folders generated: one will end in '_ert_rtw' and the other one will end in 'Config'.

In the MCUXpresso IDE you have to go on Import project(s) from file system..., then browse for the generated project ending in 'Config' (for example evkmimxrt1010_gpio_interruptConfig) in the Root directory option, then uncheck Copy projects into workspace and click Finish. You can now build the project into MCUXpresso IDE and flash your board.

stefancinipeanu_3-1654871323208.png

Hope this helps.

Best regards!

Stefan.

 

 

0 Kudos
Reply

1,609 Views
Sam_ECU
Contributor V

Hello @stefancinipeanu 

This is a huge help, thanks a lot.

Regards,

Sam

0 Kudos
Reply