Skip to content

Instantly share code, notes, and snippets.

@jadonk
Created February 18, 2015 23:57
Show Gist options
  • Save jadonk/a6432fde48408e72fdd7 to your computer and use it in GitHub Desktop.
Save jadonk/a6432fde48408e72fdd7 to your computer and use it in GitHub Desktop.
How to build a PRU binary using libstarterware.a
"/usr/share/ti/cgt-pru/lib/lnk.cmd"
MEMORY
{
PAGE 2:
MEM : org = 0x00026000 len = 0x00002000 CREGISTER=4
}
CC := clpru
LD := lnkpru
HEXBIN := hexpru
SWDIR = /usr/share/pru_am335x_starterware
CGTDIR = /usr/share/ti/cgt-pru
INCLUDEDIR = -I$(SWDIR)/include -I$(SWDIR)/include/hw -I$(SWDIR)/include/pru -I$(CGTDIR)/include
LIBDIR = -i$(SWDIR)/lib -i$(CGTDIR)/lib
CMD = lnk.cmd
OBJECTS = blinkled.o
TARGET = blinkled.out
CFLAGS := -O3 -Dam335x $(INCLUDEDIR)
$(TARGET): $(OBJECTS)
$(LD) $(CMD) -o $@ $(OBJECTS) $(LIBDIR) -llibstarterware.a
%.o: %.c
$(CC) -c --output_file=$@ $< $(CFLAGS)
.PHONY: clean
clean:
rm -f $(OBJECTS) $(TARGET)
@jadonk
Copy link
Author

jadonk commented Feb 18, 2015

@jadonk
Copy link
Author

jadonk commented Feb 19, 2015

I believe this partially addresses some concerns seen at BeaglePilot/PRUSS-C#6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment