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.

Reset vector for MSP430G2210

Other Parts Discussed in Thread: MSP430G2230

We have a working design using the MSP430G2230, that we now wish to modify to use the 2210 (for the internal analog comparator). Using the IAR toolchain, and removing the code that relates to differences, I can compile and download to the 2230 and the code runs correctly. When I download to the 2210, the reset vector is unprogrammed and therefore the part goes into its "low power, unprogrammed, on-the-shelf stock" mode of conserving power. I can select either 2230 or 2210 as the build target, and I get the appropriate warning when downloading into the opposite processor. But either target selected, when I download to the 2210, I get a blank reset vector. Surely I'm just missing a setting somewhere in the IAR tools, but I can't find it.

  • Did you make sure that on the project configuration "General Options" page, "Target" tab, that you don't have "Exclude RESET Vector" checked by accident?

  • YEs, I saw the option for "Exclude reset vector", and it's not checked. Something is decidedly fishy here, because the whole 2K program area comes up blank on the 2210. If I program the same thing on the 2230, it programs and runs fine. And it's not an issue with being able to modify memory; I manually entered a 0x5A in a program memory location, and it was there when I read back the program memory. I have verify checked, and it always says it verified okay. I've even used a second board with another 2210 on it. Right now I have three mostly identical boards; one has a 2230 and two have a 2210. Only the 2230 programs correctly.

  • Did you create new project (with the new mcu selected) and copy and pasted the source code over?
    That is what I do, as making changes to a project with a different mcu gives me problems.

  • I hadn't thought of that, but when I tried it just now, here's what I got:

    Linking
    Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment CODE. Unable to place 5  
    block(s) (0xf9c byte(s) total) in 0x792 byte(s) of memory. The problem occurred while processing the segment placement  
    command "-P(CODE)CODE=F800-FFDF", where at the moment of placement the available memory ranges were  
    "CODE:f84e-ffdf"
    Error while running Linker

    This is surely some kind of a clue, but I'm not sure where it points. My code is one simple main.c file, nothing fancy in it yet, and certainly nothing trying to do any special memory allocation.But this happens also if I compile for the 2230. I haven't even gotten to the point of trying to download with this new project.

  • Steve Hendrix said:

    This is surely some kind of a clue, but I'm not sure where it points. My code is one simple main.c file, nothing fancy

    That single character in red above might worth (or cost) many thousands or words.

  • I'm not sure what you're saying - something about the fact of programming in C?


    I have now created a completely new project, in a clean directory, and simply accepted all the defaults and let the IAR environment create a shell of a C file. When downloaded, all of program memory (F800-FFFF) is blank (FFFF), except for two widely separated words of 4343, and the single byte of 5A that I manually entered into this chip yesterday. The labels are properly placed, yet the code isn't there.

    I noticed a warning about downloading with "Attach to running target". I have always had that turned on, and it doesn't seem to bother the 2230. But on a hunch, I turned that off. Now all appears well.

    So just what DOES that option do (under the FET Debugger in project options), aside from the obvious?

  • It tells the debugger to NOT WRITE CODE TO FLASH, but instead you have a programmed part that is already running and you want to attach the debugger to the CPU without disrupting current execution.

    This mode assumes the target is already programmed with the exact same binary that is in the Executable directory of the current project.

  • I used the same setting on the 2230 without issues. There's still something seriously wrong (at a minimum, very bad design), when I can attach to the target and then explicitly do a download, it tells me it downloaded and verified just fine, and it actually did nothing at all. It behaved as expected on the 2230, just not on the 2210 - even if I didn't rebuild in between, but built for the 2210 (with the portion of my code that will run on either one).

  • Steve Hendrix said:
    Failed to fit all segments into specified ranges. Problem discovered in segment CODE. Unable to place 5  block(s) (0xf9c byte(s) total) in 0x792 byte(s) of memory.

    This is surely some kind of a clue,


    It definitely is. For some reason, the generated code is significantly larger than the amount of flash you have available.

    The 2210, as well as the 2230(!), has only 2k of flash. Of which 32 bytes are reserved for interrupt vectors. And 78 bytes are already occupied by constants or init values for variables. The generated almost 4 k of code won't fit in there.

    So apparently, the original 2230 project did something fancy to make the code fit. Probably, it messed with the linker command file. And when switching to the 2210, the command file was not appropriately changed to match the new target. And the fresh command file used in the newly created project won't work at all.
    I'm no expert for IAR or CCS (I use MSPGCC), but I think this is the place for further investigations.

**Attention** This is a public forum