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.

Writing data into MSP430FR5969 FRAM

Other Parts Discussed in Thread: MSP-FET

Hello!

I wrote a piece of code to write data into FRAM. I tested the code with 5969 Launchpad and our custom boards. Everything is working fine at my workplace. But if I flash the same code at home on my Launchpad using MacBook, I can't get the code working. However, the FRAM example in Driver Library is working though

/*
 * FRAM.c
 *
 *  Created on: Feb 11, 2016
 *  Author: Teja Chintalapati
 *	Contact: teja.chintalapati@gmail.com
 *	Phone: +91-8792-355-512
 *	Description: Contains code to read and write into FRAM
 *
 */

/******************************************************************************
 * INCLUDES
 */

#include "FRAM.h"

/******************************************************************************
 * DEFINITIONS
 */

//To know till what address FRAM is filled
#define	FRAM_FILL_LOCATION							0xBABA

/******************************************************************************
 * FUNCTION DEFINITION
 */

void FRAMWriteString(uint8_t *writeAddress, char *writeData)
{
	uint16_t *ptr;
	while(*writeData != '\0')
	{
		*(writeAddress++) = *writeData++;
		//Incrementing the address till which FRAM is filled
		ptr = (uint16_t *)FRAM_FILL_LOCATION;
		*ptr = *ptr + 1;
	}
}

void FRAMReadString(uint8_t *readAddress, char *readData, uint16_t dataLength)
{
	while(dataLength-- > 0)
		*readData++ = (*readAddress++);

}

void FRAMClearData(uint8_t *endAddress, uint8_t *startAddress)
{
	uint16_t *ptr;
	while(endAddress - startAddress + 1)
	{
		*(startAddress++) = 0xFF;
		//Decrementing the address till which FRAM is written
		ptr = (uint16_t *)FRAM_FILL_LOCATION;
		*ptr = *ptr - 1;
	}
	//We've deleted one extra location. So, add 1
	*ptr = *ptr + 1;
}

void FRAMClearAll(void)
{
	FRAMClearData((uint8_t *) 0xFFE0, (uint8_t *)0xC000);
	*lastFilledFRAMLocation = START_ADDRESS;
}

Additional Info: At workplace, I used FET to flash the code. OS: Windows 8 and CCS6.1.2

At Home: Flashed Launchpad using USB. OS: OSX El Capitan, CCS: CCS Mac Beta.

Please help me understand why the same code is working differently in different platforms.

Thanks

Teja

  • Hi Teja,

    I've examined your code, and the write functions seems to match the function in driverlib; so it's probably not an issue with the code itself but the debugger setup. Which version of CCS for OS X are you using? There's currently a beta version out that supports debugging with MSP-FET and FR5969.
    e2e.ti.com/.../code-composer-studio-beta-for-msp430
    I suggest you update CCS on your Mac if needed as that version is released Dec 2015.
    Let me know if that resolves the issue, if not, then we would require further troubleshooting and possibly looking at the entirety of the project files.

    Sincerely,
    Sean
  • Sean,

    Thanks for the reply. I'll update the CCS and update you on the status

    Teja

**Attention** This is a public forum