How to add middleware for MCUXpresso project?

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

How to add middleware for MCUXpresso project?

1,756 Views
paulkamel
Contributor I

I have a custom designed board using a MK20DN512VLL10. I am using MCUXpresso for code development and downloaded the SDK V2.2 (generated by on line tool). I've spent some time adjusting to the new way of doing things (for previous projects I used Kinetis Design Studio with processor expert). Personally I think the new MCU Config Tools is a little underdeveloped in comparison however I'm sure with time it will become a very useful tool.

I've had no problems using the various drivers for hardware initialization etc. I seem to have hit a wall however when it comes to implementing the SDK's middle-ware - specifically I want to use FatFS for SD card & USB MSD. I can't seem to find any application notes or documentation on how to do this. I've had a look at the sample code provided as part of the SDK (under /SDK_2.2_MK20DN512xxx10/boards/twrk60d100m/driver_examples/sdcard_fatfs ) which is specifically for the MK60 based board - there aren't any examples for  the K20. The example code middle-ware seems quite different in structure and layout to the stack provided under /SDK_2.2_MK20DN512xxx10/middleware/fatfs_0.12b.

Any pointers to web sites, App notes (official NXP or otherwise) or how to videos to help point me in the right direction?

0 Kudos
1 Reply

981 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Paul Kamel 

Unfortunately there isn't any step by step document that explain how to add the specific middleware for your application. There are some community post where you could check how they add some header files, but there will not necessary fix in your application, as reference:

Porting FatFs file system to KL26 SPI SD card code 

My recommendation is base your code in the example code provided in the SDK package . You won't see the same structure in the sdcard_fatfs example and in the middleware folder because the example is using actually 2 middleware, one for the SD card control (sdmmc_2.1.2) and the one to mount the file system (fatfs_0.12b). Moreover, the middleware include headers and code for other specific application, like SD with SPI, usb_disk, etc. in this case the example only uses the fsl_sd_disk.c and the common files.

Now, as long as there isn't evaluation board for the MK20DN512VLL10, the pin and module compatible is the MK60D_10. bur the hardware implementation shouldn't be a big change.

Hope this information could help you.

Best Regards

Jorge Alcala

0 Kudos