1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #15535 from aabadie/pr/tools/lpc2k_pgm

tools/lpc2k_pgm: refactor build system integration
This commit is contained in:
Alexandre Abadie 2020-12-01 21:13:52 +01:00 committed by GitHub
commit 2dc5a69939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 62 additions and 18 deletions

View File

@ -67,3 +67,7 @@ jobs:
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/fixdep
- name: Build lpc2k_pgm tool
uses: aabadie/riot-action@v1
with:
cmd: make -C dist/tools/lpc2k_pgm

View File

@ -1,26 +1,13 @@
BOARDS_COMMON_MSBA2_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
# Compile `lpc2k_pgm` when required
# It is still compiling in `boards` as it was the case before introducing the
# rule to autobuild
MSBA2_TOOLS = $(BOARDS_COMMON_MSBA2_DIR)/tools
LPC2K_PGM = $(MSBA2_TOOLS)/bin/lpc2k_pgm
$(LPC2K_PGM): FORCE
env -i PATH=$(PATH) $(MAKE) -C $(MSBA2_TOOLS)
FLASHDEPS += $(if $(findstring $(LPC2K_PGM),$(FLASHER)),$(LPC2K_PGM))
FLASHER ?= $(LPC2K_PGM)
# configure serial interface
PORT_LINUX ?= /dev/ttyUSB0
# This does not make a lot of sense, but it has the same value as the previous code
PORT_DARWIN ?= /dev/tty.usbserial-ARM
# Use lpc2k_pgm programmer
PROGRAMMER ?= lpc2k_pgm
# when using miniterm set RTS and DTR lines to 0, otherwise the board is reset
MINITERMFLAGS += --rts 0 --dtr 0
PYTERMFLAGS += -tg
include $(RIOTMAKE)/tools/serial.inc.mk
FLASHFILE ?= $(HEXFILE)
FFLAGS = $(PROG_DEV) $(FLASHFILE)

View File

@ -18,7 +18,8 @@ cd $RIOTBASE
ROOT=$(git rev-parse --show-toplevel)
EXIT_CODE=0
FILES=$(FILEREGEX='\.h$' changed_files)
EXCLUDE='^(dist/tools/)'
FILES=$(FILEREGEX='\.h$' EXCLUDE=${EXCLUDE} changed_files)
# check files
for FILE in ${FILES}; do

View File

@ -1,4 +1,4 @@
CFLAGS += -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
CFLAGS = -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
CC = gcc
prefix=/usr/local

View File

@ -16,6 +16,9 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef BOOT_H
#define BOOT_H
/**
* @brief structure to hold boot partition
*/
@ -24,3 +27,5 @@ typedef struct {
int size; /**< size of partition */
const int *prog; /**< partition data */
} boot_t;
#endif /* BOOT_H */

View File

@ -16,5 +16,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef BOOT_23XX_H
#define BOOT_23XX_H
/* automatically generated from boot_23xx.armasm */
extern const unsigned int boot_23xx[];
#endif /* BOOT_23XX_H */

View File

@ -16,5 +16,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef BOOT_2XXX_H
#define BOOT_2XXX_H
/* automatically generated from boot_2xxx.armasm */
extern const unsigned int boot_2xxx[];
#endif /* BOOT_2XXX_H */

View File

@ -16,6 +16,9 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef CHIPINFO_H
#define CHIPINFO_H
extern char *lpc_return_strings[];
/**
@ -41,3 +44,5 @@ struct chip_info_struct {
};
extern struct chip_info_struct chip_info[];
#endif /* CHIPINFO_H */

View File

@ -16,6 +16,9 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DOWNLOAD_H
#define DOWNLOAD_H
extern int download_begin(char *file);
extern void soft_reboot_begin(void);
extern void hard_reset_to_bootloader(void);
@ -24,3 +27,5 @@ extern void download_cancel(const char *mesg);
extern void download_rx_term(const unsigned char *buf, int num);
extern void download_rx_port(const unsigned char *buf, int num);
extern void download_timer(void);
#endif /* DOWNLOAD_H */

View File

@ -16,6 +16,11 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef GUI_H
#define GUI_H
extern void create_window(int *argc, char ***argv);
extern void run_gui(void);
extern void done_program(int still_in_bootloader);
#endif /* GUI_H */

View File

@ -16,6 +16,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
extern void init_settings(void);
extern const char *file_setting(void);
@ -28,3 +30,5 @@ extern void new_baud_setting(const char *new_baud);
extern void new_crystal_setting(const char *new_xtal);
extern char *baud_list[];
#endif /* SETTINGS_H */

View File

@ -16,5 +16,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef UUENCODE_H
#define UUENCODE_H
extern void uuencode(char *str, const unsigned char *data, int num);
extern int uudecode(const char *str, unsigned char *data, int max);
#endif /* UUENCODE_H */

View File

@ -0,0 +1,8 @@
# Compile `lpc2k_pgm` when required
LPC2K_PGM = $(RIOTTOOLS)/lpc2k_pgm/bin/lpc2k_pgm
FLASHDEPS += $(LPC2K_PGM)
FLASHER ?= $(LPC2K_PGM)
FLASHFILE ?= $(HEXFILE)
FFLAGS ?= $(PROG_DEV) $(FLASHFILE)

View File

@ -44,3 +44,8 @@ $(RIOTTOOLS)/flatc/flatc: $(RIOTTOOLS)/flatc/Makefile
@echo "[INFO] flatc binary not found - building it from source now"
$(MAKE) -C $(RIOTTOOLS)/flatc
@echo "[INFO] flatc binary successfully built!"
$(RIOTTOOLS)/lpc2k_pgm/bin/lpc2k_pgm: $(RIOTTOOLS)/lpc2k_pgm/Makefile
@echo "[INFO] lpc2k_pgm binary not found - building it from source now"
@$(MAKE) -C $(RIOTTOOLS)/lpc2k_pgm
@echo "[INFO] lpc2k_pgm binary successfully built!"