cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Adventurer
Adventurer
793 Views
Registered: ‎03-12-2018

SD Card Access from CPU1 after Booting (Dual Core)

Jump to solution

Hi there,

 

I'm working on a simple project, in which I'm reading and writing into SD card. There's just a small difference i.e. for my experiment I'm working with Dual Cores. On Power-Up, CPU0 Boots from SD card and then give sev() to CPU1 to start. Now I want CPU1 to read some files from SD card and Put the data into DDR. I want CPU1 to do this, as CPU0 is busy with other stuffs.

 

Both CPUs are running with Bare Metal.

 

Following things are happening:

1. CPU0 successfully boots and able to start the CPU1 as well. (Both CPU's are running independently)

2. If I try to read files from SD card in CPU0, it successfully able to read it and pass to DDR.

3. If I try to do the same with CPU1, then I'm getting a print

 "SD card could not be initialized", 

  If I ignore the above error and try to open a file, it give me the ERROR Code 3

FR_NOT_READY,			/* (3) The physical drive cannot work */

Can anyone tell me how to access SD card from CPU1.?

       OR

How to Pass the control of SD card from CPU0 to CPU1.?

 

Thanks

Lokesh_OEPL

Lokesh J.
0 Kudos
Reply
1 Solution

Accepted Solutions
Adventurer
Adventurer
741 Views
Registered: ‎03-12-2018

Yes, I'm using xilffs.h.

 

I'm using Dual Core. So I don't even want to open any file from CPU0. I directly tried it from CPU1 but it is giving me the Error No 3. Anyways. I've got solution for this problem.

 

In my scenario, CPU1 badly need to use the data present in SD card. So what I've done is, just after CPU0 gets boot up and before giving SEV() to CPU1 to start, I'm initialing the SD cards and coping all the data from the files to DDR's free memory locations. As my DDR is shared between CPU1 and CPU0 so the copied memory locations can be accessed through CPU1. 

 

I know that I'm not able to handover the control from CPU0 to CPU1, but this approach is actually helping me to save CPU cycles, as the data I want from SD card is already there in DDR, so transfer from DDR is much faster than reading the SD card every time.

 

Thanks 

Lokesh_OEPL

Lokesh J.

View solution in original post

0 Kudos
Reply
2 Replies
Xilinx Employee
Xilinx Employee
769 Views
Registered: ‎10-11-2011

Are you using XilFFS to perform these operations?

Are you closing the file you used from CPU0 before accessing it from CPU1?

 

 /*
  * Close file.
  */
 Res = f_close(&fil);
 if (Res) {
  return XST_FAILURE;
 }

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Reply
Adventurer
Adventurer
742 Views
Registered: ‎03-12-2018

Yes, I'm using xilffs.h.

 

I'm using Dual Core. So I don't even want to open any file from CPU0. I directly tried it from CPU1 but it is giving me the Error No 3. Anyways. I've got solution for this problem.

 

In my scenario, CPU1 badly need to use the data present in SD card. So what I've done is, just after CPU0 gets boot up and before giving SEV() to CPU1 to start, I'm initialing the SD cards and coping all the data from the files to DDR's free memory locations. As my DDR is shared between CPU1 and CPU0 so the copied memory locations can be accessed through CPU1. 

 

I know that I'm not able to handover the control from CPU0 to CPU1, but this approach is actually helping me to save CPU cycles, as the data I want from SD card is already there in DDR, so transfer from DDR is much faster than reading the SD card every time.

 

Thanks 

Lokesh_OEPL

Lokesh J.

View solution in original post

0 Kudos
Reply