• AVR Freaks

Hot!Project import with custom makefile and M-Stack issues

Author
Jakka
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2020/02/09 18:24:45
  • Location: 0
  • Status: offline
2020/07/08 13:45:18 (permalink)
0

Project import with custom makefile and M-Stack issues

Hello all,
I am trying to utilize an open-source potentiostat board and am stuck on getting the firmware they provided set up and I think it is coming down to the makefile and getting the includes right. The device uses M-Stack, which is also new to me, so that is why there are all the includes and such. I've never had to mess with it in my own projects and so I am not sure what is required. The only instructions the paper for the potentiostat gives is:
 
"The microcontroller firmware, including the source code and a complied .hex image, may be found in the design files under the filename firmware.zip. The source code is written in C and can be compiled using the MPLAB XC8 compiler. The provided makefile allows easy compilation because it automatically provides the compiler with the necessary flags and include paths."
 
I know it probably seems trivial to some but I could really use the help to understand what I need to important where, if I need to combine this makefile with the default makefile code you get from a new project, etc. The firmware folder won't open as a complete project as it is, making a new project and adding all the files to the computer's directory and adding it to MPLab's directory in the program gives a lot of include errors. I tried looking at M-Stacks examples but they don't mess with the Makefile at all so I don't know if I am missing anything important there.
 
The Makefile code:
# customize the following paths for your computer
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
INCLUDE1 = ./usb/include
INCLUDE2 = ./usb/src
INCLUDE3 = ./spi
INCLUDE4 = ./heflash
CC = xc8
CHIP = 16F1459
CFLAGS = --chip=$(CHIP) -Q -G --double=24 --float=24
CFLAGS += --opt=default,+asm,-asmfile,+speed,-space,-debug --addrqual=ignore
CFLAGS += --mode=pro -N64 -I. -I$(INCLUDE1) -I$(INCLUDE2) -I$(INCLUDE3) -I$(INCLUDE4) --warn=0 --asmlist
CFLAGS += --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032
CFLAGS += --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib
CFLAGS += --ROM=default,-1f80-1fff
all: Makefile
$(CC) $(CFLAGS) -o./firmware.hex main.c spi/spi_software.c usb_descriptors.c usb/src/usb.c heflash/Flash.c heflash/HEFlash.c
rm -f *.p1 *.d *.pre *.sym *.cmf *.cof *.hxl *.lst *.obj *.rlf *.sdb
rm -f funclist
clean:
rm -f firmware.hex
flash: Makefile
$(CC) $(CFLAGS) -o./firmware.hex main.c spi/spi_software.c usb_descriptors.c usb/src/usb.c heflash/Flash.c heflash/HEFlash.c
rm -f *.p1 *.d *.pre *.sym *.cmf *.cof *.hxl *.lst *.obj *.rlf *.sdb
rm -f funclist
pk2cmd -P -M -F$(ROOT_DIR)/firmware.hex

 
The link to the website about the device is:
https://www.sciencedirect.../pii/S2468067217300317

Attachment(s)

Attachments are not available: Download requirements not met
#1

0 Replies Related Threads

    Jump to:
    © 2020 APG vNext Commercial Version 4.5