Hi Marcus,
I think that I may have found the issue with the source code that you are encountering. Please see the information below. If this doesn't resolve it, please let me know.
Have a great weekend!
Carlos
Enable ESDHC controller in BSP for KwikStik
Rev. 5 of the KwikStik board now has the SD data lines connected to the microSD card slot, which lets us hope that the card will start working. However, the MQX patch for KwikStik dated 21.06.2011 still does not support the ESDHC controller on this board. This results in
fopen("esdhc:", NULL);
returning NULL instead of a device handle. To enable the ESDHC controller for this board, open \mqx\source\bsp\kwikstikk40x256\init_bsp.c and change the line
#error This modul unsupported with Kiwkstik Board.Please disable BSPCFG_ENABLE_ESDHC to 0 in user_config.h
to the following:
_esdhc_install ("esdhc:", &_bsp_esdhc0_init);
What also needs to be changed is the pin multiplexing setup. In rev. 4 and earlier, the D4-D7 signals were connected to PTD12..PTD15 and D0-D3 were not connected at all. As the same pins are used in the TWR-K40 board (which also features a 144-pin K40, but in a BGA package), the multiplexing configuration code can be copied from the TWR-K40 BSP. (see init_gpio.h)
The ESDHC controller should work now.