Tool/software: mspdebug, msp430-elf-gdb, CCS
I want to program the MSP430 evaluation board with a simple uart loopback code. My host machine is Linux (Ubuntu 22.04).
CCS displays the following error when trying to flash:
Error initializing emulator:
No USB FET was found
So I'm using CCS to build the code and mspdebug to flash along with msp430-elf-gdb. But the breakpoint set at the beginning of main is never hit. Here are some snippets:
$: mspdebug rf2500
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 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.
Trying to open interface 1 on 006
Initializing FET...
FET protocol version is 30328680
Set Vcc: 3000 mV
Configured for Spy-Bi-Wire
Device ID: 0x0381
Code start address: 0xc200
Code size : 15872 byte = 15 kb
RAM start address: 0x1c00
RAM end address: 0x1fff
RAM size : 1024 byte = 1 kb
Device: MSP430FR5739
Number of breakpoints: 3
fet: FET returned NAK
warning: device does not support power profiling
Chip ID data: 03 81 24 [FRAM]
Available commands:
= erase isearch power save_raw simio
alias exit load prog set step
break fill load_raw read setbreak sym
cgraph gdb md regs setwatch verify
delbreak help mw reset setwatch_r verify_raw
dis hexout opt run setwatch_w
Available options:
color gdb_loop
enable_bsl_access gdbc_xfer_size
enable_locked_flash_access iradix
fet_block_size quiet
gdb_default_port
Type "help <topic>" for more information.
Use the "opt" command ("help opt") to set options.
Press Ctrl+D to quit.
(mspdebug) prog ~/eusci_a_uart_ex1_loopbackAdvanced/Debug/eusci_a_uart_ex1_loopbackAdvanced.out
Erasing...
warning: not attempting erase of FRAM device
Programming...
Writing 126 bytes at c200 [section: .text]...
Writing 2 bytes at ffce [section: RTC]...
Writing 2 bytes at ffd0 [section: PORT4]...
Writing 2 bytes at ffd2 [section: PORT3]...
Writing 2 bytes at ffd4 [section: TIMER2_B1]...
Writing 2 bytes at ffd6 [section: TIMER2_B0]...
Writing 2 bytes at ffd8 [section: PORT2]...
Writing 2 bytes at ffda [section: TIMER1_B1]...
Writing 2 bytes at ffdc [section: TIMER1_B0]...
Writing 2 bytes at ffde [section: PORT1]...
Writing 2 bytes at ffe0 [section: TIMER1_A1]...
Writing 2 bytes at ffe2 [section: TIMER1_A0]...
Writing 2 bytes at ffe4 [section: DMA]...
Writing 2 bytes at ffe6 [section: USCI_A1]...
Writing 2 bytes at ffe8 [section: TIMER0_A1]...
Writing 2 bytes at ffea [section: TIMER0_A0]...
Writing 2 bytes at ffec [section: ADC10]...
Writing 2 bytes at ffee [section: USCI_B0]...
Writing 2 bytes at fff0 [section: USCI_A0]...
Writing 2 bytes at fff2 [section: WDT]...
Writing 2 bytes at fff4 [section: TIMER0_B1]...
Writing 2 bytes at fff6 [section: TIMER0_B0]...
Writing 2 bytes at fff8 [section: COMP_D]...
Writing 2 bytes at fffa [section: UNMI]...
Writing 2 bytes at fffc [section: SYSNMI]...
Writing 2 bytes at fffe [section: .reset]...
Writing 4 bytes at ff80 [section: $fill000]...
Writing 4 bytes at ff84 [section: $fill001]...
Writing 8 bytes at ff88 [section: $fill002]...
Done, 192 bytes total
(mspdebug) gdb
Bound to port 2000. Now waiting for connection...
Client connected from 127.0.0.1:34646
Clearing all breakpoints...
Reading registers
Reading 1 bytes from 0xc200
Reading 1 bytes from 0xc201
Reading 1 bytes from 0xc202
Reading 1 bytes from 0xc203
Reading 1 bytes from 0xc204
Reading 1 bytes from 0xc205
Reading 1 bytes from 0xc200
Reading 1 bytes from 0xc201
Reading 1 bytes from 0xc202
Reading 1 bytes from 0xc203
Reading 1 bytes from 0xc204
Reading 1 bytes from 0xc205
Reading 2 bytes from 0xc200
Breakpoint set at 0xc200
Running
$: msp430-elf-gdb ~/eusci_a_uart_ex1_loopbackAdvanced/Debug/eusci_a_uart_ex1_loopbackAdvanced.out
GNU gdb (Mitto Systems Limited - msp430-gcc 9.3.1.11) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=msp430-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ~/eusci_a_uart_ex1_loopbackAdvanced/Debug/eusci_a_uart_ex1_loopbackAdvanced.out...
(gdb) target remote localhost:2000
Remote debugging using localhost:2000
0x1ffeed9c in ?? ()
(gdb) break main
Breakpoint 1 at 0xc200: file ../eusci_a_uart_ex1_loopbackAdvanced.c, line 67.
(gdb) continue
Continuing.
Can you please give pointers on what could be missing? Is it something to do with fet: FET returned NAK
warning: device does not support power profiling in the above bit, under the mspdebug command?