lpcware

Hard time getting started with the LPCXpresso Experiment Kit

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by markfink on Sun Feb 09 03:00:19 MST 2014
I am on a Ubuntu laptop and I am using gcc and plain text editors. I hope somebody on this forum has similar preferences and helps me getting started.

I bought the LPCXpresso Experiment Kit because I thought this would be an easy way to get started...

* the first obstacle is that LPCXpresso Experiment Kit framework + solutions are targeted to LPC11xx (archives include Lib_CMSISv1p30_LPC11xx). I downloaded and compiled Lib_CMSISv1p30_LPC17xx
* obviously the Lab1a solution main.c is not compatible with the LPC17xx version:

arm-none-eabi-gcc -c -Os -I. -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=cortex-m3 -DTARGET=LPC17xx -fno-builtin -I../distr/inc -D__USE_CMSIS  -o main.o main.c 
main.c: In function 'main':
main.c:13:33: error: 'LPC_GPIO_TypeDef' has no member named 'DIR'
#define DIR_REG_LED1   LPC_GPIO0->DIR
main.c:23:3: note: in expansion of macro 'DIR_REG_LED1'
   DIR_REG_LED1 |= (0x1<<PIO_PIN_LED1);
main.c:14:33: error: 'LPC_GPIO_TypeDef' has no member named 'DATA'
#define DATA_REG_LED1  LPC_GPIO0->DATA
main.c:16:24: note: in expansion of macro 'DATA_REG_LED1'
#define LED1_ON        DATA_REG_LED1 &= ~(1<<PIO_PIN_LED1)
main.c:26:3: note: in expansion of macro 'LED1_ON'
   LED1_ON;


here is the main.c for Lab1a (does anybody have a version working with LPC1769?):
#include "LPC17xx.h"

// Create defines for simpler access of LED1
#define DIR_REG_LED1   LPC_GPIO0->DIR
#define DATA_REG_LED1  LPC_GPIO0->DATA
#define PIO_PIN_LED1   2
#define LED1_ON        DATA_REG_LED1 &= ~(1<<PIO_PIN_LED1)
#define LED1_OFF       DATA_REG_LED1 |= (1<<PIO_PIN_LED1)

int main (void)
{
  // Set PIO0_2 as an output
  DIR_REG_LED1 |= (0x1<<PIO_PIN_LED1);

  // Turn LED1 on
  LED1_ON;

  while(1)
;

  return 0;
}


* once the sample will compile I still need linkscript.ld + memory.ld
* and then I need to put the fimware.bin on the target though LPC-Link (I have no clue how to do that on Linux)
  I have found about 20 different blogs on how to do that (some use cp, dd, mtools, lpc21isp, pyserial)

Outcomes