fopen fails with esdhc

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

fopen fails with esdhc

Jump to solution
676 Views
michele_novalia
Contributor III


Dear all,

I have this problem with kwikstik-k40 rev 5, but it works when using twr-k60 and I was suggest it maybe an MQX problem.
I am trying to access the SDCARD and I am using CodeWarrior 10.1.

When attempting to access to esdhc I get the following error:

    com_handle = fopen("esdhc:", NULL);
    if( !com_handle ) {
        printf("DBG: Opening ESDHC device failed, is ESDHC controller enabled in MQX?");        

Problem is that I have to enable ESDHC in bsp, but the
init_bsp.c
file retreives me the following error:
#error This modul unsupported with Kiwkstik Board.Please disable BSPCFG_ENABLE_ESDHC to 0 in user_config.h

So I have just disabled this error and recompiled bsp & psp to get rid of the error (but is anything else to be done?).

Then I try to access the esdhc and I still get the error of above.
It fails while doing fopen()... and I cannot understand why.

For what I can see the execution goes in here:
in io_fopen.c #93

   if (dev_ptr == (pointer)&kernel_data->IO_DEVICES.NEXT) {

       return(NULL);

 

Does anyone have any clue please?

thanks in advance for any suggestion,
Mik

0 Kudos
1 Solution
329 Views
PetrM
Senior Contributor I

Hello,

 

you must set BSPCFG_ENABLE_ESDHC non-zero to get esdhc driver installed and working. And opening a driver is essential thing in MQX. Perhaps you have some beta version of MQX, where the esdhc support is not ready yet. There were also some problems with older versions of the board.

Anyway, the (correct) support will be available in MQX 3.8.

 

Regards,

PetrM

 

View solution in original post

0 Kudos
1 Reply
330 Views
PetrM
Senior Contributor I

Hello,

 

you must set BSPCFG_ENABLE_ESDHC non-zero to get esdhc driver installed and working. And opening a driver is essential thing in MQX. Perhaps you have some beta version of MQX, where the esdhc support is not ready yet. There were also some problems with older versions of the board.

Anyway, the (correct) support will be available in MQX 3.8.

 

Regards,

PetrM

 

0 Kudos