|                                                                                                       |  | # Introduction
Basic code to Blink the LED on the MSP430 F5529 Launchpad Evaluation Kit MSP-EXP430F5529LP from Texas Instruments, using the GCC tool-chain from terminal.
# The repository
This repository includes the `main.c` and `msp430.dat` files required to accomplish the compilation and debuging process.
## The Code `main.c`
The example code blinks the on board LED attached to **P1.0**, you can copy the contents from here or clone use the file included in the repository:
```#include <msp430f5529.h> 
void main(void){	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer//	PM5CTL0 = 0x0000;		// disable high impedance mode	P1DIR = 0x01;   		//set up bit 0 of P1 as output	P1OUT = 0x00;  			//initialize bit 0 of P1 to 0		for(;;){    			//loop	    volatile unsigned int i;	    P1OUT ^= 0x01;  		//toggle bit 0 of P1	    				//Delay	    for(i=40000; i>0;){	        i--;	        __no_operation();	    }	}}``` 
## The `msp430.dat`
The content of `msp430.dat` configures the communication between computer and the launchpad.
Add more description later
# Compiling 
```export PATH="/home/gmarx/msp430-gcc/bin:$PATH"msp430-elf-gcc -I /home/gmarx/msp430-gcc/include -L /home/gmarx/msp430-gcc/include  -mmcu=msp430f5529 -O2 -g main.c -o main.o```
# Debuging
```gdb_agent_console msp430.datCPU Name             Port--------             ----msp430              :55000
Starting all coresCPU Name             Status--------             ------msp430               Waiting for client```
In a new terminal tab or window:```msp430-elf-gdb --tui main.o(gdb) target remote :55000Remote debugging using :550000x00004400 in __crt0_start ()
```
The agent will response in the other terminal:```msp430               Client connected...Connecting to TargetFound USB FET at ttyACM0Target connected...Starting server```
Then, continue in the gdb terminal prompt:
```(gdb) loadLoading section .lowtext, size 0xa lma 0x4400Loading section .text, size 0x2e lma 0x440aLoading section __reset_vector, size 0x2 lma 0xfffeStart address 0x00004400, load size 58Transfer rate: 38 bytes/sec, 19 bytes/write.(gdb) b 1Breakpoint 1 at 0x440c: file main.c, line 4.(gdb) continueContinuing.
Breakpoint 1, main () at main.c:4(gdb) s 1 ```
and you will see the code in the terminal running step by step, or write `continue` to observe the LED blinking on the Launch pad board.
# Problems:
```msp430-elf-gdb main.omsp430-elf-gdb: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
yay -S ncurses5-compat-libs```
 |