This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi guys,
I have a TM4C123G and am trying to get some SD-card example code working with code composer 5.5. The full version of Tivaware has some example SD code for the DK-TM4C123G which seems like a good place to start.
When I import this project into CCS I get a warning that the compiler version is not currently installed (5.0.4), I have 5.1.1. When I try to debug the program with my Launchpad and SD card connected I get a fault ISR immediately. If in project settings I change the compiler version to 5.1.1 I get the errors
"symbol g_pfnVectors redefined: first defined in "./tm4c123gh6pge_startup_css.obj"; refined in "./startup_css.obj"
How do I go about porting this example code to work with my board / compiler version?
Thanks
Hi James,
So, you are importing the SD card example program for DK-TM4C123G to Tiva Launchpad? Am I correct?
James Randjelovic said:symbol g_pfnVectors redefined: first defined in "./tm4c123gh6pge_startup_css.obj"; refined in "./startup_css.obj"
This means you have two startup files at your project. Check this.
-kel
Hi,
Delete tm4c123gh6pge_startup_ccs.c and build. I think this was created when you change your compiler to 5.1.1.
-kel
Markel Robregado said:So, you are importing the SD card example program for DK-TM4C123G to Tiva Launchpad? Am I correct?
Hi Kel, yes that's correct. Removing the tm4c123 file solved that problem, thanks. I do have another problem however. I believe I've ported everything correctly, but am getting the following errors on the terminal;
"Initialising disk 0. Status = 1"
"fresult: FR_NOT_READY"
It seems like the disk is not initializing properly. At this stage I'm just trying to create a new file on the card and write a sentence to it. The relevant code is below,
UARTprintf("\n\nSD Card Example Program\n"); UARTprintf("Type \'help\' for help.\n"); // // Mount the file system, using logical disk 0. // iFResult = f_mount(0, &g_sFatFs); if(iFResult != FR_OK) { UARTprintf("f_mount error: %s\n", StringFromFResult(iFResult)); return(1); } power_on(); BOOL a = wait_ready(); DSTATUS errd; if(a) { send_initial_clock_train(); errd = disk_initialize(0); UARTprintf("\nInitialising disk 0. Status = %i\n", errd); } FIL fil; uint32_t count = 8*512; iFResult = f_open(&fil, "testfile.txt", FA_CREATE_NEW|FA_WRITE); SysCtlDelay(SysCtlClockGet()/3); if(iFResult != FR_OK) {UARTprintf("fresult: %s\n", StringFromFResult(iFResult)); } else{UARTprintf("\n Opened SD card\n");} iFResult = f_write(&fil, "Hello world", 11, &count); if(iFResult != FR_OK) {UARTprintf("Error writing to file: %s\n", StringFromFResult(iFResult));} iFResult = f_close(&fil); f_mount(0, NULL);
Am I missing some step in initializing the SD card? Any help appreciated.
Hi James,
Do click "Verify Answer" to any replies in this post that helps solve your problem. This will mark this post as "Answered".
Regarding your SD card FR_NOT_READY problem, this example program work for DK-TM4C123G. Any error with this example program, most likely at fault is the SD Card. Basic troubleshooting like formatting the SD Card might help solve the problem. But, that is for DK-TM4C123G.
Since you are porting this for Tiva Launchpad, other factors may contribute that is causing this problem, such as circuitry for SD card.
For the orderliness of the forum, it would be great to just create a new post if you have further questions not related to your initial post.
-kel