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.
Hi,
I am writing the "LED blink" assembly program on the msp430g2553 micro processor based only on the MSP430 Assembly Language documentation provided by TI. I am trying to learn basically from scratch. So far, I have written a correctly structured .asm file in which I assemble with the cl430 program, then link using the same program with appropriate options. I am able to produce an executable that I flash onto the board using the mspdebug tool. The problem is that the PC remains set to 0xFFFF after it is loaded. Based on the documentation, I was under the impression that the debugger would set the PC according to the entry point specified by the linker. This apparently is not the case.
The PC gets set correctly if I use a C program instead, which I compile+assemble+link using the msp gcc toolchain (taken from online examples), and even then I am not fully sure how that happens. I realize that I could go about my life just using C instead of assembly, but I am trying to learn how this stuff works.
So, my question is, how do I go about getting the PC to set itself to the entry point of my assembly program?
At startup, the PC is set from the Reset vector (up at 0xFFFE). Here's the base example for the G2553. Note in particular the last 3 lines, which set the ".reset" vector.
http://dev.ti.com/tirex/explore/node?node=AOC8DYkpquW-61388bZk5g__IOGqZri__LATEST
Thanks for that. It didn't immediately work when I implemented that in my file but it's given me something to go off of.
This is how I do it using the GNU assembler:
.section .resetvec,"ax",@progbits .word sys_init
Where "sys_init" is my program entry point.
Your answer is what led me to the correct place. The problem I was seeing afterwards was that I did not have the reset section and memory map defined in my linker command file. After adding this, having the reset vector mentioned in my .asm file was the ticket. Thanks a million.
Thanks. Good to know if I use the GNU assembler one of these days. Right now I am using the TI provided development kit because it matches one to one with the documentation.
**Attention** This is a public forum