Error in makefile and applicationmk
응답
19. 5. 2 오전 6:53

Hello,

i used the StreamSensorDataOverUSB an changed the Appcontroller.c to save the data in a csv-file.

but  now i get an error in the makefile and the application.mk and i don't know how to solve it

 

Thank you for your help

0 (0 투표)
RE: Error in makefile and applicationmk
응답
19. 5. 2 오전 8:03 as a reply to Michael Österreicher.

Hello Michael,

could you please post a picture of the console output when you try to build your programm.

Best regards,

Christian

0 (0 투표)
RE: Error in makefile and applicationmk
응답
19. 5. 2 오전 8:19 as a reply to Christian Köhler.

Hello Christian

there is the error code from then console.

 

regards,

Michael

0 (0 투표)
RE: Error in makefile and applicationmk
응답
19. 5. 2 오전 9:02 as a reply to Michael Österreicher.

Hello Michael,

due to the information you gave me, I would assume your added custom code causes this error for some reason.

If I am understanding your use case right, you want to store sensor data on the SD card of the XDK.

To do this i would recommend the ff.h API.

Please have a look to the code snippets below. Maybe they are helpful.

#include "ff.h"

// init sd card

Retcode_T SDCard_Initialize(void){

    static FATFS fat_file_system_object;

    if(RETCODE_SUCCESS == SDCardDriver_Initialize()){

        if(SDCARD_INSERTED == SDCardDriver_GetDetectStatus()){

            if(RETCODE_SUCCESS == SDCardDriver_DiskInitialize(SDCARD_DRIVE_ZERO)){

                if(FR_OK == f_mount(&fat_file_system_object, SDCARD_DEFAULT_LOGICAL_DRIVE, SDCARD_FORCE_MOUNT)){

                    return RETCODE_SUCCESS;
                }
            }
        }
    }
    printf("SDCard_Initialize : Failed!  \r\n");

    return RETCODE_FAILURE;
}

// create file

Retcode_T SDCard_CreateFile(const char *filename){

    if(FR_OK == f_open(&file_object, filename, FA_CREATE_ALWAYS)){

        printf("File %s was created successfully \r\n", filename);
        return RETCODE_SUCCESS;
    }
    else{

        printf("File %s could not be created \r\n", filename);
        return RETCODE_FAILURE;
    }
}

// write already with fprintf formatted data to file

Retcode_T SDCard_Write(const char *filename, char *content){

    FRESULT fileSystemResult = (FRESULT) FR_OK;
    UINT retBytes = 0U;

    fileSystemResult = f_open(&file_object, filename, FA_OPEN_ALWAYS | FA_WRITE);
    if(FR_OK == fileSystemResult){

        fileSystemResult = f_lseek(&file_object, f_size(&file_object));
    }
    if(FR_OK == fileSystemResult){

        fileSystemResult = f_write(&file_object, content, strlen(content), &retBytes);
    }
    if(FR_OK == fileSystemResult){

        fileSystemResult = f_close(&file_object);
    }
    if(FR_OK == fileSystemResult){

        return RETCODE_SUCCESS;
    }
    else{

        printf("SDCard_Write : Failed! \r\n");
        return RETCODE_FAILURE;
    }
}

If you have any further questions dont hesitate to ask.

Best regards,

Christian

+1 (1 투표)