IMXRT1050-EVKB SD card Integration in a C++ project

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

IMXRT1050-EVKB SD card Integration in a C++ project

Jump to solution
5,572 Views
yogesh_modi
Contributor II

Hello,

I'm trying to integrate SD card FatFs in my tensorflow lite KWS project, I've added all the dependencies like FatFs folder, SDmmc folder in the path, updated the pinMUX.c , Their are no errors in the build.

But still when I call to f_open or any file operation the program gets stuck in a never ending wait state.

It been many days I'm struggling with this iss

Labels (1)
0 Kudos
Reply
1 Solution
5,367 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
It seems a bit weird, I was wondering if you can introduce the steps of the integration process in details, next, I'd like to suggest you find the cause related to the phenomenon by the method of exclusion.
Looking forward to your reply.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

View solution in original post

20 Replies
5,546 Views
yogesh_modi
Contributor II

SD card mount is successful but the program gets stuck in any file operation like f_open,f_mkfs, etc.

I'm not able to find the possible issue. So please look into it 

0 Kudos
Reply
5,537 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you to introduce the steps of porting code in brief at firstly, in further, I was wondering if you can upload the code, as I can replicate the phenomenon on my site.
Looking forward to your reply.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
5,534 Views
yogesh_modi
Contributor II

Hello,

Thanks for your reply, I tried to integrate two example projects, tensorflow lite KWS and the SD card FatFs example provided in the SDK. I've attached my project below please have a look on it.

https://drive.google.com/file/d/1U_BvPPCIARN9pA5_B9Eh6TuF7rI9lbNT/view?usp=sharing

Thank you.

0 Kudos
Reply
5,533 Views
yogesh_modi
Contributor II

The following are the steps I took to integrate the SD card in my project

  1. copied the source code to my project
  2. copied all the dependencies (Fatfs,SDMMC folders)
  3. added the dependencies to my compile path
  4. updated pin_mux 
  5. Updated the preprocessors.

 

0 Kudos
Reply
5,510 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
After having a brief review of your demo, I guess the phenomenon is related to the inappropriate porting.
So I created a C++ demo project for SDCARD FATFS, it works well on the MIMXRT1050 EVK board (QSPI) and you can refer to it for details.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

5,501 Views
yogesh_modi
Contributor II

I tried to upload this project to my board, But it is showing some memory related error.

I've attached the screenshot

0 Kudos
Reply
5,469 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
The attached project is suited for the QSPI version of the MIMXRT1050 board, however, the default Nor Flash of the MIMXRT1050 board is Hyperflash, so I guess the error is related to Nor Flash incompatibility, and it needs you to check it by yourself, and if my guess is right, please adapt this project to suit for your board.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
5,466 Views
yogesh_modi
Contributor II

Yes your guess is right the default is hyperflash for my board. So where do I need to make the changes?

0 Kudos
Reply
5,464 Views
yogesh_modi
Contributor II

Actually I'm new to NXP and I don't understand the project structure till now so I'm facing many difficulties to port the code, So please let me know when do I need to make the changes to adapt the code to the default hyperflash.

0 Kudos
Reply
5,456 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I've adapted the demo project, I think it's Okay now and you can give it a try again.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

5,454 Views
yogesh_modi
Contributor II

Thanks man,

This is working on my board, now I will try to integrate this to my C++ project and will let you know if it works

0 Kudos
Reply
5,450 Views
yogesh_modi
Contributor II

I tried to integrate this to my project but the issue is still their, SD card mount is successful but the program hangs in file operation like f_open etc. The issue is something else.

0 Kudos
Reply
5,421 Views
yogesh_modi
Contributor II

Hello @jeremyzhou ,

Happy new year!

I tried integrating the CPP project you provided but the problem still exists, So can you try on your end to integrate it in my project?

0 Kudos
Reply
5,368 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
It seems a bit weird, I was wondering if you can introduce the steps of the integration process in details, next, I'd like to suggest you find the cause related to the phenomenon by the method of exclusion.
Looking forward to your reply.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

5,361 Views
yogesh_modi
Contributor II

Hello @jeremyzhou ,

I followed the following steps:

  1. Copied SDMMC & FTAFS directory to my project
  2. Added them to the compile path as done in sd card project
  3. Updated the preprocessors in project settings
  4. Updated the pinMux file
  5. Copied the source code to my project 

I'm trying to find out the issue by exclusion, if I get any will let you know.

Thank you for your support.

 

0 Kudos
Reply
5,360 Views
yogesh_modi
Contributor II

Program is hanging in sd_disk_initialize()

0 Kudos
Reply
5,326 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
The sd_disk_initialize is called in many file operations actually,
so whether you mean this function works well sometimes, however, fails sometimes too.
And in my opinion, you give a try to port your project to the
evkbimxrt1050_sdcard_fatfs_C_Plus.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
5,322 Views
yogesh_modi
Contributor II

Hii @jeremyzhou ,

Thanks for you great support, I found the issue while debugging both projects side by side. The issue was in board.h file a pre-processor was missing, now SD card is working perfectly in my projects.

Thank you.

0 Kudos
Reply
5,508 Views
yogesh_modi
Contributor II

Hello,

Thanks for your efforts, I also think the same that it might be the porting issue,

I will try to port this C++ project and will let you know.

 

Thank you.

0 Kudos
Reply
3,688 Views
Arkadiusz
Contributor I

Hello. What was wrong inside board.h file? I'm trying to run C++ project with freertos, fatfs & sdcard too but im stuck on the same function as you described.

I attached my project

0 Kudos
Reply