TI の MSP430 ランチパッド (1.5 with MSP430g2553) について質問があります。
次の hello ワーク コードを使用して MCU をプログラムすると、デバッグ モードで gdb を使用して細かい値を読み取る際に問題が発生します。
#include <msp430g2553.h>
**const int titi = 3;//Global variable**
int main(){
WDTCTL = WDTPW + WDTHOLD;
P1DIR = 0x41;
**int tata = 0x1;//first local variable**
while(1){
P1OUT = 0x41;
**int toto = 10;//Second local variable**
__delay_cycles(99999);
P1OUT=~0x41;
int tyty = 20;
__delay_cycles(99999);
}
return 0;
}
- gcc は mcu を介してコードをダウンロードするために使用しています: $ make prog v=main.c
- $ mspdebug rf2500 gdbおよび msp430-gdb main.elf
- 対象のリモート localhost:2000
LED が点滅します。数時間後、実行を停止し、ローカル変数に問い合わせます: (gdb) info locals toto = 1 tyty = 10 tata = -577
グローバル変数titiに関する情報は問題ありません。totoとtytyは私のコードに表示される値ですが、それはtataの別の値です。なんで ?
それがgdbのバグだとは思わないでください....
よろしくお願いします、
GM