I am interfacing my cc2650 + smartrf06eb board with sd card over spi but still i did not found any driver which support FatFs or any other file system. Please suggest me which driver file support cc26xx or any other way to do file operation.
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.
Thanks for reply,
CC3200 and Tiva have SDSPi driver SDSPI3200 and SDSPITiva. In these driver have been used driverlib which are not available in CC26xx. In short still i am unable to create text file in sd card.
Regards,
Rajneesh
Hi Vikram.,
I seen this link :
There are initialize VL01_initSDSPI for Configure pad settings but in case of cc26xx there are no any api for do this. Is it necessary in cc26xx?
Regards,
Rajneesh
I have modify SDSPITiva.c and SDSPITiva.h according to cc26xx and modify HWAttrs, SDSPI_config, CC26XXObjects. When I call SDSPI_open its returns proper handle but cant create any file in sdcard. Tell me Any configuration is needed for FATFs system?
Hi Svend,
I have interfaced sdspi driver for cc26xx. Take reference of SDSPITiva driver to make compatible for CC26xx and make changes according to SPI and PIN driver and add Power management.
SSIDataPut(hwAttrs->baseAddr, 0xFF);
/* Flush data read during data write. */
SSIDataGet(hwAttrs->baseAddr, &dat);
I am confuse above two function call. When SSIDataGet call its wait for data as infinite time.
Have you any solution for ssi.c/h make running in SDSPI driver or any other way?
I have read SDSPI driver for SD card use SPI(SSI) bus.
Regards,
Rajneesh
Hi Nathaly,
Vikram is on vacation now, so I will fill in for him. You need to add the SDSPI_config structure to your <board>.c file. For example, here is the SPI_config:
/* Include drivers */
#include <ti/drivers/spi/SPICC26XXDMA.h>
/* SPI objects */
SPICC26XXDMA_Object spiCC26XXDMAObjects[CC1310_LAUNCHXL_SPICOUNT];
/* SPI configuration structure, describing which pins are to be used */
const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC1310_LAUNCHXL_SPICOUNT] = {
{
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI0,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
.mosiPin = Board_SPI0_MOSI,
.misoPin = Board_SPI0_MISO,
.clkPin = Board_SPI0_CLK,
.csnPin = Board_SPI0_CSN
},
{
.baseAddr = SSI1_BASE,
.intNum = INT_SSI1_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI1,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
.mosiPin = Board_SPI1_MOSI,
.misoPin = Board_SPI1_MISO,
.clkPin = Board_SPI1_CLK,
.csnPin = Board_SPI1_CSN
}
};
/* SPI configuration structure */
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[0],
.hwAttrs = &spiCC26XXDMAHWAttrs[0]
},
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[1],
.hwAttrs = &spiCC26XXDMAHWAttrs[1]
},
{NULL, NULL, NULL}
};
You need to do something similar for SDSPI.
Best regards,
Janet
Thanks Janet,
I added the necessary code. But now I get a memory size error. I tried disabling the peripherals in <board>.c and <board>.h files as it says in the comments ( so I commented out I2C, ADC, GPTimer, etc)
This is the error:
#10099-D program will not fit into available memory. run placement with alignment fails for section ".bss" size 0x22641 . Available memory ranges:
1) Note that the available memory ranges are not shown
2) is the size shown (0x22461) a number in bytes? does it refer to the size of my code, or the limit available? I built my code with all the ADC and without it and this number is still the same.
3) How do I know which available memory is being used here? Does it refer to RAM or flash? I am using CC1310, which has 20 KB of RAM and 128 KB of FLASH.
Thanks for your guidance
Hi Nathaly,
Your code is not fitting into memory. The size of your .bss section 0x 0x22641 bytes. You can see how much memory you have available by looking at your linker command file. For example, this is from the CC2650DK_71D linker command file:
#define FLASH_BASE 0x0
#define FLASH_SIZE 0x20000
#define RAM_BASE 0x20000000
#define RAM_SIZE 0x5000
/* System memory map */
MEMORY
{
/* Application stored in and executes from internal flash */
FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE
/* Application uses internal RAM for data */
SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE
}
/* Section allocation in memory */
SECTIONS
{
.text : > FLASH
.const : > FLASH
.constdata : > FLASH
.rodata : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.emb_text : > FLASH
.ccfg : > FLASH (HIGH)
#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
.TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
#endif
#endif
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM (HIGH)
.nonretenvar : > SRAM
}
For this device, .bss is placed in SRAM which has size 0x5000 bytes. You can look in your map file to see what is taking up so much of .bss.
Best regards,
Janet
Hi Janet,
I got the files, and indeed I can see .bss is assigned to SRAM which is 4K in the .cmd file. In the map, i can see that .bss is not initialized because it takes around 21K. I tried changing .bss to go into FLASH and made sure to apply the W (write) attribute to the Flash description. Builds fine, but when I go to debug I still get an error:
One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target.
--Is there a correct way to write to FLASH instead of SRAM?
So when I look further into the memory map, I can see what is inside of .bss that takes up so much space:
00020000 rfExamples_pem3.oem3 (.bss:data$1)
--So I would like to reduce this file! Is this trying to include all the example files in with my code? Is this coming from an include directory that I gave too high level an address?
Thanks,
~Nathaly
Hi Nathaly,
No, you can't put .bss in Flash. I would look at the map file and see what is taking up so much of .bss. Maybe you can reduce that somehow.
Best regards,
Janet