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.

CCS/LAUNCHXL-F28069M: Is it possible to read/write to an SD card via SPI? (i'd like to use an SD card shield popular for use with arduino)

Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: CONTROLSUITE,

Tool/software: Code Composer Studio

I'm new to TI's launchpad, and i've got GPS data coming via SCI every 200 ms, i'd like to save this data to an SD card for later examination on a PC. Which is the best way to do it? i found that this is usually done via the so called "SD card shields" with arduino, which use two libraries <SD.h> and <SPI.h>.  But this libraries are not available for the F28069M, i've searched control suite and i cannot find any SD_card examples for the F28069M. Even though there are a few SPI examples, i cannot figure out how to use those with my SPI Sd card shield.

  • Hi Joan,

    1. One of the easiest way is to use the USB peripheral directly instead of SPI interface. You can use a pendrive or card reader for storing data. Do go through the peripheral details in TRM.  Eg. C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\usb_host_msc

    2. You can very well use SD card shields but a pure 3.3V one and not 5V to 3.3V ones. Some shields tend to convert 5V signals to 3.3V ones, but for C2000 signals are already at 3.3V level. There's no direct example for SD card interface but you can find the Fatfs library here: C:\ti\controlSUITE\device_support\f2806x\v151\MWare\third_party\
    This you can integrate with SPI peripheral example. Also do check this link:

    Regards,

    Gautam

  • Hi Joan,
    There is an SD card example for the F2837xD in controlSuite. It is a different device, but the content should still be mostly portable. Please take a look at that example and see if it helps you integrate that into your project.

    Best,
    Marlyn
  • Thank you very much for the info, i still need to polish the code but i think i got the basics covered so far with the examples suggested
  • Hi Marlyn,

    Thank you for the advice, however i wanted to ask for some advice on how to port this example onto F28069 LaunchXL. I imported the example into CCS, and checked which pins correspond to the GPIO's used in the example, so i plugged my SD card shield (which by the way has a 5V to 3.3V regulator, but i believe it can also work directly on 3.3V).

    GPIO16 -> SPISIMOA -> corresponds to J2.15 launchpad pin

    GPIO17 -> SPISOMIA -> J2.14

    GPIO18 -> SPICLKA -> J1.7

    GPIO19 -> SPISTEA -> J2.19

    According to LAUNCHXL-F28069M Usr guide. After plugging this pins to the SD card shield i tried to run the example on F28069M,  but when i tried to debug the example i got this error:

    <Linking>
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 7: error #10263:
       BEGIN memory range has already been specified
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 7: error #10264:
       BEGIN memory range overlaps existing memory range BEGIN
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 8: error #10263:
       RAMM0 memory range has already been specified
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 8: error #10264:
       RAMM0 memory range overlaps existing memory range RAMM0
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 10: error #10263:
       RESET memory range has already been specified
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 10: error #10264:
       RESET memory range overlaps existing memory range RESET
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 22: error #10263:
       BOOT_RSVD memory range has already been specified
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 22: error #10264:
       BOOT_RSVD memory range overlaps existing memory range BOOT_RSVD
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 23: error #10263:
       RAMM1 memory range has already been specified
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 23: error #10264:
       RAMM1 memory range overlaps existing memory range RAMM1
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 24: error #10264:
       RAMD1 memory range overlaps existing memory range RAML4
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 29: error #10264:
       RAMLS3_RAMLS4_RAMLS5 memory range overlaps existing memory range RAML4
    "C:/ti/controlSUITE/device_support/F2837xD/v210/F2837xD_common/cmd/2837xD_RAM_lnk_cpu1_USB.cmd", line 34: error #10264:
       RAMGS7 memory range overlaps existing memory range RAML8
    "../28069_RAM_lnk.cmd", line 121: error #10099-D: program will not fit into
       available memory.  placement with alignment/blocking fails for section
       ".text" size 0x2f1d page 0.  Available memory ranges:
       RAML0_L3     size: 0x2000       unused: 0x2000       max hole: 0x2000    
    error #10010: errors encountered during linking; "sd_card_cpu01.out" not built
     
    >> Compilation failure
    makefile:160: recipe for target 'sd_card_cpu01.out' failed
    gmake: *** [sd_card_cpu01.out] Error 1
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****

    I am really not familiar with what linkers do and how they work... If you could give me some advice on how these work i would really appreciate it.

  • Hi Joan,

    You appear to be using the support files for the F2837xD device. What I would recommend is to relink everything to F28069 device files.

    What might be easier is to move your code to an F28069 project and add the necessary header files for the SD Card.

    If you want to change the files to be linked you can do so as below,

    Right click on the project->Click 'Properties'-> Go to C2000 Linker-> Click on 'File Search Path' ->Add files using the (+) sign where it says "Add <dir> to library search path'

    You can also change the complier files by Clicking on 'C2000 Complier' then 'Include Options'.

    Best Regards,

    Marlyn