S32K144 Fatfs

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
10,201件の閲覧回数
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,182件の閲覧回数
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,108件の閲覧回数
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,972件の閲覧回数
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,951件の閲覧回数
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,945件の閲覧回数
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,943件の閲覧回数
Teja114
Contributor III

Hi @rathi_tg ,

 

Open the  S32k reference manual .

please find the attachments where can you find 

0 件の賞賛
9,934件の閲覧回数
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,893件の閲覧回数
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,828件の閲覧回数
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,822件の閲覧回数
Teja114
Contributor III

@rathi_tg ,

Sure will try and let you know ....

0 件の賞賛
9,816件の閲覧回数
rathi_tg
Contributor III

@Teja114 

Thanks for help.

Will be waiting for your response.

Regards

Gopal Rathi

0 件の賞賛
10,183件の閲覧回数
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,176件の閲覧回数
Teja114
Contributor III

Hi @danielmartynek ,

coding done its working ..

Thanks for your response

0 件の賞賛
10,134件の閲覧回数
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,124件の閲覧回数
Teja114
Contributor III

Hi @Mrudula ,

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

0 件の賞賛
9,420件の閲覧回数
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,116件の閲覧回数
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 件の賞賛