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.

MSP430: Trouble Writing Memory Block!

Other Parts Discussed in Thread: MSP430F5419, CC430F6137, CC1101, MSP430F5438A

I had ordered the CC430 Wireless Development Kit.   It has MSP430F5xx core and supports all CC430F613x and CC430F612x flash parts.

What is meant by flash parts? How are those different from the core? MSP430 is a microcontroller, right? So it must have the flash in itself?  (sorry, I am a beginner.)

I run Windows 7 Ultimate 64-bit edition.

 

I also downloaded and installed Code Composer Studio v4 for MSP430. This is my first time using CCS and so I followed the instructions on the welcome screen. The "Flashing the LED" example worked flawlessly. However, then I tried to import an existing project from:

<Installation root>\Texas Instruments\ccsv4\msp430\examples\example projects\msp430x5xx C Example

It gave an error with configuration file not matching the hardware. So, I had to replace the configuration file initially. It was MSP430F5419.ccxml (which gave an error). So I copied CC430F6137.ccxml from flashing the LED project. Is this alright/allowed?? Can I do this??

 

Then, when I click, Target ---> Debug Active Project,  I come up with the following error:

MSP430: Trouble Writing Memory Block at 0x5c00 on Page 0 of Length 0x22: Could not write device memory

Cannot write to target

 

How can I solve this??

I tried to access check the address in the memory map documentation (user guide slau259b, pg. 37). The memory locations are from 00000h to FFFFFh (5 digits). However, the error is at 0x5c00 ('5c00' is four digits). So, is 0x5c00 = 05c00h?? (That would be at the starting locations of the memory then).

 

Also, when I go to View--->Memory, it opens a new window on the right. However, everything is grayed out. I cannot enter the memory location. I wanted to check if the memory at 0x5c00 can be written to or not. How can I check memory locations?

 

Sorry about too many questions. I am eager to learn more and at the same time in need of guidance.

Thank you very much, everyone, for the help and the time. I appreciate it. :)


  • Rajat Srivastav said:
    So, is 0x5c00 = 05c00h?? (That would be at the starting locations of the memory then)

    Ah, no.
    If you compiled the project for 54xx, then yes, 0x5c00 (or 0x05c00, but preceding zeroes are usually omitted, since the code can run in 16bit address range too, the 5th digit is only important if you want to express that it is indeed a real 20bit value rather than a 16 bit value with impicit zeroed upper bits and only on MSPs which support >16 bit address range) is the starting location of flash memory.

    On 6137, flash starts at 0x8000 as there are only 32k and have to extend to 0xffff.

    What likely happened is that you compiled the project for the 54xx, then replaced the ccxml file and now the debuffer maches ccxml and processor, but cannot upload the compiled file as it is compiled for the 54xx address layout. Since you copied the ccxml file, it is 'older' than the compiled data and the toolchain does not notice that something has changed and a recompilation is rquired.

    So

    Rajat Srivastav said:
    Is this alright/allowed?? Can I do this??

    Yes, AFAIK you can, but you should clean the project after doing so and compile everythign anew, as the toolechain won't notice the change.

    Rajat Srivastav said:
    How can I solve this??

    The toolchain usually works based on file dates. There are rules like 'object file must be newer than source file'. If it isn't, it is recompiled. If you copy a file from outside that it older than your already compiled object file, this change is invisible and no recompilation will happen, since the obect file is still newer than the source. You'll have to 'touch' the source or clear the object file. Then the toolchain will detect that the source (or in your case the project settings) have changed and will recompile/link. And this time for the correct memory layout.

  • Rajat,

    1 - The term "flash parts" is put there for redundancy. Since the MSP430 is on there, it is implied that there is embedded memory as well. But to clarify further we say that they're flash parts.

    2 - You want to use the *.ccxml file that matches your part. Check your part number and be sure to use the correct file.

    3 - Depending on what part you have, there are different memory sizes.

    4 - Using the memory window is a good way to check the memory. I'm not sure why you can't see it, but it could be related to you not having the project setup properly. The first step is to find out which part you are using and setup CCS properly for that part.

     

    -Alex

  • Rajat Srivastav said:
     MSP430 is a microcontroller, right? So it must have the flash in itself

    Not necessarily flash. There are some one-time-programmable MSPs and some which are mask-programmed at production. (MSP430Cxxx)
    But by far the most have internal flash.

  • Thank you a Jens-Michael Gross and TI Alex.  Those replied were very helpful and I learned a lot.

    I tried the "clean..." option and then rebuilt the active project before debugging. It gave me the same error. 

     

    Steps I followed (Windows 7 64-bit):

     

    1. Start -> Code Composer Studio v4 Core Edition (installed the tools for MSP430 only)

    2. Project -> Import Existing CCS/CCE Eclipse Project

    3. C:\Program Files (x86)\Texas Instruments\ccsv4\msp430\examples\example projects\msp430x5xx C Example

     

    On the development board, there is a label stating that:

    EM-CC430F6137-900

     

    The website ( http://focus.ti.com/docs/toolsw/folders/print/em430f6137rf900.html ) states that:

    The CC430 integrates the latest MSP430F5xx core (which combines 25 MHz performance with a 200-ksps 12-bit ADC, AES hardware security module and a 96 segment LCD driver) with the CC1101 multi-channel RF transceiver designed for low-power wireless applications.

    The EM430F6137RF900 development board supports all CC430F613x and CC430F612x flash parts in the 64-pin QFN (RGC) package. It also supports software development for the CC430F513x parts (48-pin QFN (RGZ) package). 

     

     

    Since it has MSP430F5xx core, I used  <<Installation Root>>\msp430\examples\example projects\msp430x5xx C Example   (in Step 3)

    Is this right??

     

    4. In the C/C++ Perspective, I right-clicked and selected New -> Target Configuration File

    5. Named it as "NewMSP430F6137.ccxml". Clicked "Finish".

    6. In the new window, there is a 'Connection'. I chose 'Data Snapshot Viewer' (default).

    7. In the device list, I chose 'CC430F6137'. Click "Save" on the right. Then I closed the ccxml file.

    8. The new file is ACTIVE. (I tried the same process by deleting the old target file and the error is same.)

    9. I go to Project -> Clean...

    10. I chose "Clean projects selected below". Then checked "msp430x5xx C Example".

    11. Checked "Start a build immediately". Clicked OK. The process was successful.

     

    12. There is 1 warning:

    This project was created using a version of Code Generation tools that is not currently installed: 3.2.1 [MSP430]. Please install the Code Generation tools of this version, or migrate the project to one of the supported versions.

     

    13. Target -> Debug Active Project.

    14: Error:

     

    Console:

    MSP430: Trouble Writing Memory Block at 0x5c00 on Page 0 of Length 0x22: This operation is not supported by this driver

    Cannot write to target

     

     

    ***************************************************************************************************************************************************************************

     

    Next I tried the above steps by importing an example project for msp430x6xx  from:

    C:\Program Files (x86)\Texas Instruments\ccsv4\msp430\examples\example projects\msp430x6xx C Example

    I get the error as:

     

     

    Console:

    MSP430: Trouble Writing Memory Block at 0x8000 on Page 0 of Length 0x22: This operation is not supported by this driver

    Cannot write to target



    I am really not sure where I am going wrong. I have not edited any C or header files. Flashing the LED example worked flawlessly without any warnings. And I was also able to see the memory locations and the data they have.

     

    So I am guessing that the warning has to do something with it. However, it is just a warning and not an error. I don't think it should have such an impact, could it?

     

    Jens-Michael Gross said:
    On 6137, flash starts at 0x8000 as there are only 32k and have to extend to 0xffff.

    And 0x8000 is where the flash memory starts, right? I was hoping, this error wouldn't occur.

     

  • Another question from this curious mind: After my LED flash program worked successfully, I clicked View -> Memory.

    In the memory window (below), I noticed some characters in blue and corresponding data in the memory locations below them:

     

    In expanded window:

     

    What do these blue symbols stand for? I see the work "main" so I am guessing they are formed when the main function of the C file is compiled and executed.

     

    I really appreciate your time in answering my questions. None of my friends have used CCS before so this is the only place I can post my doubts and get good answers. :)

     

    Thanks you. Have a nice day!

  • Rajat Srivastav said:
    Since it has MSP430F5xx core

    'Core' means that the CPU is identical. THis does not mean that the peripherals, including ram and flash, are same, same size or same location (except for flash memory on 0xff80-0xffff, since the core expects the vector table there).

    Rajat Srivastav said:
    Trouble Writing Memory Block at 0x8000 on Page 0 of Length 0x22: This operation is not supported by this driver

    This looks like a driver misconfiguration rather than a problem with the project configuration. (You see, it is a different error type than before.)
    But it's possible that this arises because of a wrong setting for JTAG or SpyByWire programming.

    But I'm not an expert for these IDEs. I use MSPGCC and therefore my projects are configured a totally different way.

  • Thank you so very much!! :)

    You have been very helpful. I will looking into driver configurations and try to find the problem. I will also look into settings for JTAG. I just hope it works.

    Have a nice day! 

  • Where you able to program the flash in the microcontroller? If so, could you please let me know what else did you do in order to be able to do it?

    I am having a similar problem with Code Composer where I can't write to the target, and the error code is the same MSP430: Trouble Writing Memory Block at 0x5c00 on Page 0 of Length 0x22: Could not erase device memory Cannot write to target.

     

    I am using the experimenter board for the MSP430F5438A connected through SPY-bi Wire.

  • Julio Armijos said:

    Where you able to program the flash in the microcontroller? If so, could you please let me know what else did you do in order to be able to do it?

    I had to give up on that project as I had to move to a new city but I couldn't take the board out from the lab at my university. However, I did solve a few of the problems (but not all) before leaving by following the code examples.

     

    Julio Armijos said:

    I am having a similar problem with Code Composer where I can't write to the target, and the error code is the same MSP430: Trouble Writing Memory Block at 0x5c00 on Page 0 of Length 0x22: Could not erase device memory Cannot write to target.

     

    I am using the experimenter board for the MSP430F5438A connected through SPY-bi Wire.

    I have worked a little with MSP430F5438A board recently. And also with CCS. In my very honest and frank opinion, I prefer to use IAR Kickstart (free) or the IAR Embedded Workbench (paid).

    That said, I think the best way is to go through the flash memory code examples found here:

    MSP430F55xx Code Examples  from their MSP430  Code Examples page

     

    A few tips I was told about (I didn't really find the first one in the user's guide):

    1.Always write to flash of MSP430 as a 16-bit word. Writing only 8 bits at a time is not a good practice.

    2.Always erase (set all bits to default value = 1) before writing to flash

    3.Initiate a dummy write to erase the flash. And then write your data.

     

    Few CCS stuff you can check:

    1. Target configuration files

    2. The jumpers have to connected in the right way. Refer to the website for MSP430F5438A and check for details. They usually put the schematics and instruction on what jumpers have to connected.

     

    Go through the code examples and things will be clear. If they are not, let me know and I will try my best to help you.

    Good luck!

     

    -Rajat

  • Thank you for the quick reply. First, let me elaborate a bit more on my problem. Contrary to the initial situation that you had where you were able to write a simple LED routine and write it to the flash, I am not able to write anything into the flash. It is really odd.

    I have checked all of the jumpers on the board, and they are all in the proper positions. I have the power switch on the USB position, and I have the spy-by-wire connections as follows:

    SBWCLK = Pin 8 of 14 pin header.

    SBWTDIO = Pin 11 of 14 pin header.

    Power (Vcc) goes into pin 2, while ground goes to pin 9.

     

    Now the CCS settings is what has me worried. I have created a new project where I set the target to be the MSP430F5438A. Once the project is created I just simply create a main.c file that I want to write into the flash. All I am doing for now is stopping the Watch dog timer since all I am trying to see is if I can write to the flash in that board. The program compiles properly, and from there CCS erases the flash, but as soon as it tries to write the program, it gives me the error.

    Do you know of any way to delete the flash without the use of CCS? I have not tried IAR just yet since I have been able to use CCS with the board that I created without any problems.

    I appreciate your assistance.

**Attention** This is a public forum