S32K144 Fatfs

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

S32K144 Fatfs

跳至解决方案
10,198 次查看
Teja114
Contributor III

Hi there ,

I tried to port fatfs to S32K144 device , it compiled but not working .

please find the attachment , and give me the suggestions what  to change in the code ...

Thanks in advance .....

标签 (1)
0 项奖励
1 解答
10,179 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The project is rather complex, we can't debug it for you.

Do you have any specific questions?

 

Thanks,

BR, Daniel

在原帖中查看解决方案

0 项奖励
16 回复数
10,105 次查看
Teja114
Contributor III

Hi @Mrudula ,

please find the attached image ..

for the CS pin check out pin mux configurations i mentioned it as a PORTE->PCR[6] |= PORT_PCR_MUX(1); /* Port E6: MUX = ALT1, LPSPI1_PCS3 CS */. iam using CS as a GPIO pin .

if you want to use as a dedicated chip select PORTE->PCR[6] |= PORT_PCR_MUX(2); depending on your pin configurations ...sd_card_pins.JPG

9,969 次查看
rathi_tg
Contributor III

Hi @Teja114 

 

The file which you have shared is very helpful.

But, I made few modifications as a part of experiment.

Basically, I changed the Configuration of the pins as follow:- 

PCC->PCCn[PCC_PORTC_INDEX] |= PCC_PCCn_CGC_MASK; /* Enable clock for PORTB */
PCC->PCCn[PCC_PORTA_INDEX] |= PCC_PCCn_CGC_MASK; /* Enable clock for PORTB */
PORTC->PCR[15] |= PORT_PCR_MUX(2); /* Port B14: MUX = ALT3, LPSPI1_SCK */
PORTC->PCR[0] |= PORT_PCR_MUX(2); /* Port B15: MUX = ALT3, LPSPI1_SIN */
PORTC->PCR[1] |= PORT_PCR_MUX(2); /* Port B16: MUX = ALT3, LPSPI1_SOUT */
PORTA->PCR[15] |= PORT_PCR_MUX(2); /* Port B17: MUX = ALT3, LPSPI1_PCS3 */

 

PCC->PCCn[PCC_LPSPI2_INDEX] = 0; /* Disable clocks to modify PCS ( default) */
PCC->PCCn[PCC_LPSPI2_INDEX] = 0xC6000000; /* Enable PCS=SPLL_DIV2 (40 MHz func'l clock) */

 

 

"All the LPSPI0 are replaced with LPSPI2" in SPI_MSDO_Driver .

The Cord Builds fine without any error but no data is written on the Sd card.

Output on console is "Write Error 3".

 

Could you Even Throw light on Data Reading From Sd card.

 

Thanks in Advance!!!

Regards

Gopal Rathi.

0 项奖励
9,948 次查看
Teja114
Contributor III

Hi @rathi_tg ,

please check the pin configurations first.

Did you changed the pins on reading the datasheet ?

Is the PCR_MUX is '2' ? or something else ?

cross check the code with  datasheet .

Thanks,

Teja..  

0 项奖励
9,942 次查看
rathi_tg
Contributor III

Hi @Teja114 

I tired Searching the Mux value but could not figure it out.

Could you Please guide me too do the Same

Regards 

Gopal Rathi

0 项奖励
9,940 次查看
Teja114
Contributor III

Hi @rathi_tg ,

 

Open the  S32k reference manual .

please find the attachments where can you find 

0 项奖励
9,931 次查看
rathi_tg
Contributor III

Hi @Teja114 

I have followed the Excel sheet and made changes as required.

But, I am still unable to write data on SD Card.

I have attached the .c file of the Driver.

Please let me know if i missed something.

 

Regards 

Gopal Rathi.

0 项奖励
9,890 次查看
Teja114
Contributor III

Hi @rathi_tg ,

i went through the file , everything was looking fine. 

please check the connections from sdcard module to board .

And the supply voltage should be 3.3v.

if you're using sdcard module it is having 5v to 3.3v  regulator , must give 5V as a input .

Thanks,

saiteja.v

0 项奖励
9,825 次查看
rathi_tg
Contributor III

Hi @Teja114 

If I amusing the Configuration which you have specified everything works fine. But, as soon as i change the pin configuration I am unable to read or write the data.

 

I have tried various combinations of pins as well as LPSPI but was not successful.

 

Could you please once change the Pins to other Configuration Lets take LPSPI2 and burn the code and let me know if it was successful.

I have Tried the same using LPSPI0, LPSPI1 and LPSPI2.

 

Thanks in advance.

Regards

Gopal Rathi.

0 项奖励
9,819 次查看
Teja114
Contributor III

@rathi_tg ,

Sure will try and let you know ....

0 项奖励
9,813 次查看
rathi_tg
Contributor III

@Teja114 

Thanks for help.

Will be waiting for your response.

Regards

Gopal Rathi

0 项奖励
10,180 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The project is rather complex, we can't debug it for you.

Do you have any specific questions?

 

Thanks,

BR, Daniel

0 项奖励
10,173 次查看
Teja114
Contributor III

Hi @danielmartynek ,

coding done its working ..

Thanks for your response

0 项奖励
10,131 次查看
Mrudula
Contributor I

Hi @Teja114 ,

I am working on SD card data logging with S32k144. I found your drivers useful however I'm not able to see how and where exactly in the code the ports are configured for the MOSI, MISO, SCK and CS signals.

Could you please help?

 

Regards,

Mrudula

0 项奖励
10,121 次查看
Teja114
Contributor III

Hi @Mrudula ,

find the zip file for sdcard data_logging  modify application layer for your requirements.

0 项奖励
9,417 次查看
Nayan123
Contributor II

Hii, @Teja114 ,

I found your driver file really helpful.

But during debugging it is showing me creating directory failed 
: 3 on the console.

Could you help me to figure it out this error??

0 项奖励
10,113 次查看
Mrudula
Contributor I

Hi @Teja114 ,

Thankyou for your help! In this zip file too I'm not able to find how the MOSI,MISO , SCK and CS signals are configured for hardware implementation. Please help.

 

Regards,

Mrudula

0 项奖励