November 24, 2024, 09:55:14 PM

Programming MSP430-PIR

Started by rith87, September 19, 2014, 03:13:48 AM

Previous topic - Next topic

rith87

Hello folks,

I'm trying to program the MSP430-PIR (https://www.olimex.com/Products/MSP430/Starter/MSP430-PIR/) with the JTAG TINY V2 (https://www.olimex.com/Products/MSP430/JTAG/MSP430-JTAG-TINY-V2/). I built the sample LED blinking code and managed to flash the chip without an error message:


mspdebug olimex prog <path to binary>/test.out

MSPDebug version 0.21 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 10004002
Set Vcc: 3300 mV
Configured for Spy-Bi-Wire
Sending reset...
Device ID: 0xf201
  Code start address: 0xf800
  Code size         : 2048 byte = 2 kb
  RAM  start address: 0x200
  RAM  end   address: 0x27f
  RAM  size         : 128 byte = 0 kb
Device: MSP430F2013
Number of breakpoints: 2
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data: f2 01 03
Erasing...
Programming...
Writing  208 bytes at f800 [section: .text]...
Writing    2 bytes at ffe4 [section: PORT1]...
Writing    2 bytes at ffe6 [section: PORT2]...
Writing    2 bytes at ffe8 [section: USI]...
Writing    2 bytes at ffea [section: SD16]...
Writing    2 bytes at fff0 [section: TIMERA1]...
Writing    2 bytes at fff2 [section: TIMERA0]...
Writing    2 bytes at fff4 [section: WDT]...
Writing    2 bytes at fffc [section: NMI]...
Writing    2 bytes at fffe [section: .reset]...
Done, 226 bytes total


Unfortunately, the LED never turns on. I've had this same problem with the TI sample code. Also, when setting other pins to high, I wasn't able to read a high from the respective pin. Any ideas what could be wrong?

rith87

Seems like the flash didn't stick or memory is somehow corrupt:


(mspdebug) dis 0xf800 200
_auto_init:
    0f800: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f804: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f808: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f80c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f810: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f814: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f818: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f81c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f820: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f824: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f828: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
$C$L6:
    0f82c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f830: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f834: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f838: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f83c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
$C$L7:
    0f840: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f844: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f848: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f84c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
$C$L8:
    0f850: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
$C$L9:
    0f854: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f858: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f85c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f860: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f864: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f868: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f86c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f870: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f874: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f878: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
$1_$2:
    0f87c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f880: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f884: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f888: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f88c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f890: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f894: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
_c_int00_noexit:
    0f898: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f89c: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f8a0: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f8a4: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
$C$L2:
    0f8a8: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f8ac: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f8b0: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
__mspabi_func_epilog_6:
    0f8b4: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
__mspabi_func_epilog_4:
    0f8b8: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
__mspabi_func_epilog_2:
    0f8bc: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f8c0: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)
    0f8c4: ff ff ff ff               AND.B   @R15+,  _reset_vector+0x1(R15)


And if I perform the same steps with the simulator (instead of the olimex programmer), I get something besides ff ff's.