This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC2400 startup file - SD Card (MCI Interface)

Hi everyone,

I have a very strange problem with LPC2400 startup file. I took me some time to figure what is going on so I would appreciate any suggestion or opinion.

I have Olimex LPC2478 development board. I have already completed few projects but not with KEIL MDK-ARM. Back than I was using WinARM compiler.

I have functional U-boot loader with support for booting uCLinux from SD Card (MCI interface). I also finished project without OS but with support for SD CARD (I used U-boot loader source code as template).

Now I'm working on new project on same LPC2478 development board but with my new MDK-ARM. I have included RT TCP/IP stack which is now fully operational. UART and TIMERs are alse working without problem.

I haven't managed to port my code for SD Card to KEIL. Apparently, problem is not in my code. I wrote exactly the same code (identical syntax) for KEIL and for WinARM compiler. Only difference is in startup files (LPC2400.s versus asmfunc.s). WinARM project is working, but KEIL project not.

After that, I wrote empty KEIL program.


int  main()
{
    return 1;
}

To make story shorter, now I have 4 hex files.

1. KEIL hex with empty main program
2. KEIL hex with SD card support (initialization and reading card size, no interrupts or DMA)
2. WinARM U-boot loader with SD CARD support
3. WinARM hex SD CARD support(initialization and reading card size, no interrupts or DMA)

I'm using Flash Magic and UART for programming (ISP and RST controlled by UART).

WinARM projects are working fine. SD Card is initialized and I can read disk size etc.

When I upload project compiled with KEIL ( hex files 1) and 2) and few others project) and run them, AND after uploading my WinARM project without powering down LPC2478, WinARM projects are no longer fully functional. Everything is working fine except SD card.

But, when I manualy reset LPC2748 (power off/power on), SD card is working again. Apparently , software reset is not enough when switching from KEIL projects to WinARM projects.

I also noticed that voltage level on SD pins are 3V instead 3.3V before I power off LPC2478.
I WinARM project I'm manualy initializing clock and every other peripheral. I tried to read all relevant registers but everything seems ok.

I'll now print startup files from WinARM and KEIL and try to find something that could cause this problem. I don't now anymore what to look for because everything should be OK with starup initialization and SD card initialization.

I would appreciate any help.