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

Firmware 8 byte alignment

This problem I have I really don't understand. I've got some code which runs fine. Is encorperates an SD-card interface (NXP/Martin Thomas/CHaN). At some point I found out that a certain SD-card was recognized poorly: it took my app 10 extra seconds to initialize the SD-card subsystem. Adding debug info I tried to figure out the cause. It's the MCI_Send_Status() from mci.c which takes so long.

What amazes me is that by just adding 8 bytes of arbitrary code (e.g. by extending a const string with 8 characters), in a seemingly arbitrary module (.o file), makes my app boot quickly again. Add by adding 8 more bytes slow, etc.

So it seems to be some delicate alignment issue in ROM. But what exactly is going on? Has anyone encountered similar issues?

LPC 2386

Thanks, Mark

Parents Reply Children
  • Hi Per,

    It seems that my issue is indeed related to the MAM. My application runs with MAMCR=1, MAMTIM=4. When I change MAMCR to 0 or to 2, the specific SD-card is recognized quickly (no 10 secs delay anymore), regardless alignment/padding. I can't see why exactly, but I'll try to figure this out.

    Thanks for pointing me to MAM,

    Mark