LPCOpen v2.02 sdmmc_speed.c hard faults?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCOpen v2.02 sdmmc_speed.c hard faults?

370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jonper on Thu Nov 21 11:49:23 MST 2013
When I run lpcopen v2.02 with and unmodified misc\sdmmc_speed example, it freezes after the message "Taking back up of card." Halting the debugger shows the PC stuck in the hard fault handler. Resetting and single stepping point to something failing in the first Chip_SDMMC_ReadBlocks call.

If I revert to lpcopen 1.03 and run the older but near-twin misc\app_sdmmc_meas with the v1.03 chip/ip libraries, the same hardware gives a successful full run.

If I run the alternate v2.02 periph_sdmmc\sdmmc example using the same hardware and the same shared chip code base, everything works fine.

I've tried this with LPCXpresso_6.1.0_164, Keil uVision V4.72.10.0, and IAR 6.70.1 compilers, testing on both the MBC4357 eval board with MicroSD cards, and on our custom LPC4357 boards with various SD cards. In all those combinations of hardware and software, v2.02's misc\sdmmc_speed example hard faults while v1.03's misc\app_sdmmc_meas works.

Initial debugging attempts and code comparisons make me think its likely a simple translation error, but I just can't see it. Anyone willing to take a look or offer suggestions?

Labels (1)
0 Kudos
2 Replies

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jonper on Tue Jan 28 16:06:35 MST 2014
Thanks sundarapandian

I made the following change to the sdif_device struct at line 255 in lpc_chip_43xx\inc\sdif_18xx_43xx.h:

//pSDMMC_DMA_T mci_dma_dd[1 + (0x10000 / MCI_DMADES1_MAXTR)];
pSDMMC_DMA_T mci_dma_dd[1 + (0x100000 / MCI_DMADES1_MAXTR)];

and it does appear to work with sdmmc_speed.c and my other SD programs.
0 Kudos

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sundarapandian on Fri Jan 24 14:35:27 MST 2014
To reduce the size of SDMMC images the DMA descriptor size inside the driver is made smaller. The corresponding change in the sdmmc_speed example is missing, the problem is fixed and will be available in the next release of lpcopen. You could manually fix it by replacing "#define NUM_SECTORS     2048" by "#define NUM_SECTORS  256" inside file misc\sdmmc_speed\sdmmc_speed.c.
0 Kudos