Jump to content
Forum sending old emails Read more... ×


  • Content Count

  • Joined

  • Last visited

  1. Hi Jsolarski, start simply is really the best idea. I got it running now: It wrote in the micro sd card and when I read it matched. This time not with "zeros". What was the problem: the supply voltage. Since I am using a shield for Arduino to interface the sd card, its supply was 5V, not 3.3V. What should be happening is that the writing and reading run perfectly but in 3.3V the current is not enough to write. Solved!🙂 When I placed the micro sd card in the computer adapter it could not read because there's no file system. Actually, this is still a problem I don't know how to solve... Any suggestions? Thanks Jsolarski
  2. Hi Jsolarski, 1. Yes, it does have SPI interface. The SD.h library that comes in the SDK (Software Development Kit) transparently uses its SPI. And the library documentation says it internally points to a hardware specific implementation also the MISO, MOSI, CLK and CS pins which the SPI uses. I am using RTOS, then I am using the generic drivers from the SDK. 2. It seems those FAT libraries from the posts you suggested me is intended to be used with Energia, but I just checked the Energia website right now and they still do not support CC1352R family. The example code I used has a thread to take care of the SD questions. The code is below: /* * Copyright (c) 2016-2017, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * ======== sdraw.c ======== */ #include <stddef.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <math.h> /* Driver Header files */ #include <ti/drivers/GPIO.h> #include <ti/drivers/SD.h> #include <ti/display/Display.h> /* Example/Board Header files */ #include "Board.h" /* Buffer size used for the file copy process */ #define BUFFSIZE 1024 /* Starting sector to write/read to */ #define STARTINGSECTOR 0 #define BYTESPERKILOBYTE 1024 /* * Set this constant to 1 in order to write to the SD card. * WARNING: Running this example with WRITEENABLE set to 1 will cause * any filesystem present on the SD card to be corrupted! */ #define WRITEENABLE 1 static Display_Handle display; unsigned char textarray[BUFFSIZE]; unsigned char cpy_buff[BUFFSIZE]; /* * ======== mainThread ======== * Task to perform a raw write and read from the SD card. * Note: Running this application will cause any filesystem on the * SD card to become corrupted! */ void *mainThread(void *arg0) { int_fast8_t result; uint_fast32_t cardCapacity; uint_fast32_t totalSectors; uint_fast32_t sectorSize; uint_fast32_t sectors; int i; SD_Handle sdHandle; Display_init(); GPIO_init(); SD_init(); /* Configure the LED pin */ GPIO_setConfig(Board_GPIO_LED0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW); /* Open the display for output */ display = Display_open(Display_Type_UART, NULL); if (display == NULL) { /* Failed to open display driver */ while (1); } /* Turn on user LED */ GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON); Display_printf(display, 0, 0, "Starting the SD example\n"); /* Initialize the array to write to the SD card */ for (i = 0; i < BUFFSIZE; i++) { textarray[i] = i & 0xFF; } /* Mount and register the SD Card */ sdHandle = SD_open(Board_SD0, NULL); if (sdHandle == NULL) { Display_printf(display, 0, 0, "Error starting the SD card = %d\n", sdHandle); while (1); } result = SD_initialize(sdHandle); if (result != SD_STATUS_SUCCESS) { Display_printf(display, 0, 0, "Error initializing the SD card\n"); while (1); } totalSectors = SD_getNumSectors(sdHandle); sectorSize = SD_getSectorSize(sdHandle); cardCapacity = (totalSectors / BYTESPERKILOBYTE) * sectorSize; Display_printf(display, 0, 0, "There are %u total sectors on the SD card.\n", totalSectors); Display_printf(display, 0, 0, "The Read/Write sector size is %u bytes\n", sectorSize); Display_printf(display, 0, 0, "The total card capacity is %u KB\n", cardCapacity); /* Calculate number of sectors taken up by the array by rounding up */ sectors = (sizeof(textarray) + sectorSize -1) / sectorSize; #if (WRITEENABLE) Display_printf(display, 0, 0, "Writing the array...\n"); result = SD_write(sdHandle, textarray, STARTINGSECTOR, sectors); if (result != SD_STATUS_SUCCESS) { Display_printf(display, 0, 0, "Error writing to the SD card\n"); while (1); } #endif Display_printf(display, 0, 0, "Reading the array...\n"); result = SD_read(sdHandle, cpy_buff, STARTINGSECTOR, sectors); if (result != SD_STATUS_SUCCESS) { Display_printf(display, 0, 0, "Error reading from the SD card\n"); while (1); } /* Compare data read from the SD card with expected values */ for (i = 0; i < BUFFSIZE; i++) { if (cpy_buff[i] != textarray[i]) { Display_printf(display, 0, 0,"Data read from SD card differed from expected value\n"); Display_printf(display, 0, 0,"Expected value for index %d: %d, got %d\n", i, textarray[i], cpy_buff[i]); Display_printf(display, 0, 0, "Run the example with WRITEENABLE = 1 to write expected values to the SD card\n"); break; } } if (i == BUFFSIZE) { Display_printf(display, 0, 0, "Data read from SD card matched expected values\n"); } SD_close(sdHandle); return (NULL); } The result I had in Putty (Realize I have no errors messages and instead of this, it runs normally, but in the end, the written data doesn't match the read data). When I place the sd card in an adapter to see it on the computer it also has no data.
  3. Hi everybody! Problem Description: I've been programming CC1352R platform lately. And I am realizing there are no many libraries for while. I need to implement the storage of my sensor data and I started to look for a library for using with an SD card. In the TI drivers, (from the SDK - Software Development Kit), there's a library SD.h. And in the examples folder for TI drivers there's an example which name is "sdraw". The first time I run this example It couldn't open the sd. First I sent a question on TI community: https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/p/759572/2819479#2819479 and they told me to debug. But I thought strange an example code not to run. Then I simply changed the sd card and It could open, write and read. (It did not display errors). But the example code was intended to write an array and read it to compare if the written data matches with the read data. But I read only zeros (of course it did not match). When I placed the micro sd card in a computer adapter I also had an empty sd. I don't know if that was because it has no file or no file system. What I need: I still didn't have answer from the TI community and I don't have much time to deliver this implementation. So, I would like to know if there's some library for interfacing sd card with a CC1352R. Or if someone has used this library I mentioned: "can you give me some suggestion for what is happening?". I am trying to get some help because I know that if I have to implement it from zero it will cost me a long time, and I don't have experience with sd cards. Thanks in advance, I'll appreciate any help. best regards, Sara
  4. Hi, Basically the only thing I need is to get the values such as current consumption, energy consumption to MSP430 in real time like the ones given by Energy Trace without using CCs. Because it provides only a graphical information. Not enough to be an input for a code in a host computer. I tried a solution given in this own forum and had problems during building, the steps taken are bellow, if you have another solution, please let me know. We try to build the project energy-trace-util to use the energy trace feature on ours msp without the need of CCS, but we had erros on compiling the debug Stack, required by the project. You can read the readme of the project at https://github.com/carrotIndustries/energytrace-util/blob/master/README.md They said that the msp debug Stack is necessary for it works and made a PKGBUILD process on other repo to automatize the installation of it in the Arch Linux system. We use the Ubuntu so we could not use that script but we read it to understand what it does and they require the file slac460p.zip which is not online anymore, I thought that this file was updated to the slac460t which we have but following the process (wrote here: https://github.com/carrotIndustries/aur-mspds/blob/master/PKGBUILD) the file named MSPDSOS- did not exist on the .zip, and is a executable file apparently, so we seeing the zip that we have, we discovered that it have a makefile that we could use to build that slac460, we followed that way then. We try to build the slac460t, it fails, saying the file hdiapi.h is not found, we added the path to that file on the makefile and they process with the compilation. Then is fails again, saying that the hid_libusb.o is not found and we don't have that file. We try to build the hdi project from the directory on the slac460t/ThirdParty but it fails saying that libusb directory not exist, then we downloaded the hid project from the net (here: https://github.com/signal11/hidapi) We build, with some difficult on the way, but we successful compiled and installed that project. On /usr/local/lib then was installed some files of hid and libusb, some shared libraries (.so) but no .o anywhere. So the error on debug Stack compile process still. We need that debug process on our Ubuntu to use the energy trace, what is your solution for us to use the energy trace without the CCS on Ubuntu ? thank you!