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 .....
Solved! Go to Solution.
Hi,
The project is rather complex, we can't debug it for you.
Do you have any specific questions?
Thanks,
BR, Daniel
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 ...
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.
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..
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
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.
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
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.
Sure will try and let you know ....
Hi,
The project is rather complex, we can't debug it for you.
Do you have any specific questions?
Thanks,
BR, Daniel
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
Hi @Mrudula ,
find the zip file for sdcard data_logging modify application layer for your requirements.
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??
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