SdCard inserted block K60 boot

cancel
Showing results for 
Search instead for 
Did you mean: 

SdCard inserted block K60 boot

786 Views
guillaumetiffin
Contributor III

Hi all,

I have a problem with a custom card and the MK60FX512VLQ15.

I have a SDCARD connector. It is mapped on the pin 1, 2, 3, 4, 7 and 8 (SD1, SD0, SDCLK, SDCMD, SD3 and SD2).

The Card Detect signal is mapped to PTA4 (pin 54).

When I put a SDCARD inside, everything is ok.

The problem is when I let the SDCARD inserted.

In this case the program don't boot and if I try to program it with the JTAG mapped from PTA0 to PTA3, the K60 cannot be reach.

What am I doing wrong?

How can I correct this?

Thank you for you ranswer.

Regards,

Guillaume

0 Kudos
11 Replies

247 Views
georgschmidt
Contributor III

Hi,

I have the same problem currently.

Due to the wiring of the EZP_CS - pin of my K60 (I want to use this pin as PWM output) I need to disable the EZP functionality.

Can anyone tell me how to do this?

Regards,

Georg

0 Kudos

247 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Georg Schmidt:

Did you resolve your doubt?

EZPORT can be disabled from the NV_FOPT flash space. The next thread provides some hints about this:

Re: How to modify FTFL_FOPT register on Kinetis K10 to change boot options?

Regards!

Jorge Gonzalez

0 Kudos

247 Views
guillaumetiffin
Contributor III

Hi Hector,

Thank you for your answer.

I can't post the schematic right now.

The SD Card slot is well connected. I checked it before. And it works well. Hte problem is only at the startup.

After some investigation, it seems to have some conflicts with the EZP_CS signal. My SD_CARD_DETECT signal is on the EZP_CS pin.

When the card is inserted in the slot, the SD_CARD_DETECT signal is pull_down. So I think that the EzPort operation is enabled.

So I think that I need to disable the EzPort and after set this pin as an IO.

But if I don't change this option in the boot sequence, it won't works.

I tried to write the FOPT register but without any succes. I didn't find the right way to do this.

Do you think that it could be the source of my problem?

If you think so, can you tell me how to do this please?

Thank you.


Regards,

Guillaume

0 Kudos

247 Views
hectorsanchez
Contributor IV

Update: if EZP_CS rises with VDD the board will not enter EZPort.

0 Kudos

247 Views
guillaumetiffin
Contributor III

Exactly but when a SD card is inserted, the signal is pull down. So I need to disable this functionnality.

The SD card will be inserted after the first programming of the microcontroller.

After it's no possible to have an acces to the sd card. So the SD card need to be inserted all the time after the first programming sequence.

0 Kudos

247 Views
hectorsanchez
Contributor IV

Hi , I'm glad to help,

If you want to do it the software way, put this in your code:

FTFE_FOPT &= ~(0x02);  // EZPORT_DIS cleared , EZPort Operation disabled.

// This is just to make sure it disables the EZport mode pins

PORTA_PCR6 |= PORT_PCR_MUX(1)  // Set PortA pin 6 as PTA6 function

PORTA_PCR4 |= PORT_PCR_MUX(0)  // Set PortA pin 4 as IO (EZP_CS_b)

247 Views
guillaumetiffin
Contributor III

Hi,

I tried your solution.

It doesn't work. Here is the test code.

   printf("\n FTFE_FOPT = %d \n", FTFE_FOPT);

   printf("\n NV_FOPT = %d \n", NV_FOPT);

  

   FTFE_FOPT &= ~(0x02);

  

   printf("\n FTFE_FOPT = %d \n", FTFE_FOPT);

   printf("\n NV_FOPT = %d \n", NV_FOPT);

After a restart I still have the same value (255 instead of 253).

I also tried

#define SET_FOPT @0x040D = 0xFD;

But with the same result.

I also tried

NV_FOPT = 0xFD;

and

FTFE_FlashConfig_BASE_PTR->FOPT = 0xFD;

but the program stop.

0 Kudos

247 Views
lvw
Contributor II

I got the same problem, here is my solution:

You must set NV_OPT, because FTFL_OPT is loaded with the value NV_FOPT at each reset.

But you cannot just dynamically set NV_FOPT = 0xFD, because NV_FOPT resides in the program flash sector.

So you have to find the the sector cfmconfig in your code,change it, and recompile .

Note that if you use mqx(4.1.1), PEx will not do the expected job because the bsp values take the place in this sector.

After checking that the register FTFL_OPT is now correct, if you still have problems, look a the NMI ...

0 Kudos

247 Views
hectorsanchez
Contributor IV

Hi Guillaume,

The problem is , if the EZP_CS pin is low on reset, the k60 will enter EZP mode as stated here:

EZP_CS.png

I would try to set the Reset Signal pin to High and see if i can set the pin as an I/O, i don't have my board right now but i will try as soon as possible if this can be done.

The EzProg can operate as a MicroSD card reader, i recommend you to read this AN: AN4406

I'm looking for a workaround right now.

Keep me informed,

Hector Sanchez

247 Views
guillaumetiffin
Contributor III

Hi Hector,

Thank you very much for your help. It's very nice to you to help me.

It's my first board with a Freescale's product. So I'm facing some problems wich can be really silly.

The EZP port mode problem, is exactly what I thought but I didn't find the way to write to the register to disable this option. I just have to write a 0 instead of a 1 (0xFD)

EZP_CS.png

If you know the way to do, please tell me and I'll try it.

I think that it's possible to use it as a GPIO because I already use it as a GPIO but the pin is not pull down during startup.


Best regards,

Guillaume

0 Kudos

247 Views
hectorsanchez
Contributor IV

Hi Guillaume,

Make sure your SD connector is connected to grounds like this:

SD.PNG.png

Would be useful if you can post your SD custom board to take a look at it. I'll keep looking for the problem.
Keep me informed,

Hector Sanchez

0 Kudos