From 729653ba7181bacdb782e029868460bcbfd42c4b Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Mon, 15 Jun 2015 09:51:07 -0700 Subject: [PATCH] SITL: changed posix_default to posix_sitl The SITL build is now the default posix build. The linker script for posix was moved to makefiles/posix. The rc.S file was moved to posix-configs/SITL/init/ The POSIXTEST board definition is now SITL To run the SITL test run: make sitlrun This replaces the make posixrun target. The build directory is now Build/posix_sitl.build/ Signed-off-by: Mark Charlebois --- Makefile | 4 ++-- Tools/posix_run.sh | 5 ----- Tools/sitl_run.sh | 5 +++++ makefiles/posix-arm/config_eagle_default.mk | 2 +- makefiles/posix/board_posix.mk | 3 ++- .../posix/{config_posix_default.mk => config_posix_sitl.mk} | 2 +- .../posixtest/scripts => makefiles/posix}/ld.script | 0 makefiles/posix/toolchain_native.mk | 2 +- posix-configs/{posixtest => SITL}/init/rc.S | 0 src/drivers/drv_gpio.h | 6 +++--- src/lib/version/version.h | 2 +- src/platforms/posix/drivers/adcsim/adcsim.cpp | 2 +- src/platforms/px4_config.h | 2 +- 13 files changed, 18 insertions(+), 17 deletions(-) delete mode 100755 Tools/posix_run.sh create mode 100755 Tools/sitl_run.sh rename makefiles/posix/{config_posix_default.mk => config_posix_sitl.mk} (97%) rename {posix-configs/posixtest/scripts => makefiles/posix}/ld.script (100%) rename posix-configs/{posixtest => SITL}/init/rc.S (100%) diff --git a/Makefile b/Makefile index 2d1307a074..34a56853ec 100644 --- a/Makefile +++ b/Makefile @@ -324,8 +324,8 @@ else export PX4_TARGET_OS=$@ endif -posixrun: - Tools/posix_run.sh +sitlrun: + Tools/sitl_run.sh qurtrun: make PX4_TARGET_OS=qurt sim diff --git a/Tools/posix_run.sh b/Tools/posix_run.sh deleted file mode 100755 index 3a20dc3766..0000000000 --- a/Tools/posix_run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -mkdir -p Build/posix_default.build/rootfs/fs/microsd -mkdir -p Build/posix_default.build/rootfs/eeprom -cd Build/posix_default.build && ./mainapp ../../posix-configs/posixtest/init/rc.S diff --git a/Tools/sitl_run.sh b/Tools/sitl_run.sh new file mode 100755 index 0000000000..9f63d731d4 --- /dev/null +++ b/Tools/sitl_run.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +mkdir -p Build/posix_sitl.build/rootfs/fs/microsd +mkdir -p Build/posix_sitl.build/rootfs/eeprom +cd Build/posix_sitl.build && ./mainapp ../../posix-configs/SITL/init/rc.S diff --git a/makefiles/posix-arm/config_eagle_default.mk b/makefiles/posix-arm/config_eagle_default.mk index 30dada7bbd..d66cc5ed73 100644 --- a/makefiles/posix-arm/config_eagle_default.mk +++ b/makefiles/posix-arm/config_eagle_default.mk @@ -1,5 +1,5 @@ # -# Makefile for the POSIXTEST *default* configuration +# Makefile for the EAGLE *default* configuration # # diff --git a/makefiles/posix/board_posix.mk b/makefiles/posix/board_posix.mk index 9982680f92..4e8c9e9f58 100644 --- a/makefiles/posix/board_posix.mk +++ b/makefiles/posix/board_posix.mk @@ -1,11 +1,12 @@ # # Board-specific definitions for the POSIX port of PX4 +# for use in SITL testing # # # Configure the toolchain # CONFIG_ARCH = NATIVE -CONFIG_BOARD = POSIXTEST +CONFIG_BOARD = SITL include $(PX4_MK_DIR)/posix/toolchain_native.mk diff --git a/makefiles/posix/config_posix_default.mk b/makefiles/posix/config_posix_sitl.mk similarity index 97% rename from makefiles/posix/config_posix_default.mk rename to makefiles/posix/config_posix_sitl.mk index f479505b30..d0ec4086bb 100644 --- a/makefiles/posix/config_posix_default.mk +++ b/makefiles/posix/config_posix_sitl.mk @@ -1,5 +1,5 @@ # -# Makefile for the POSIXTEST *default* configuration +# Makefile for the SITL configuration # # diff --git a/posix-configs/posixtest/scripts/ld.script b/makefiles/posix/ld.script similarity index 100% rename from posix-configs/posixtest/scripts/ld.script rename to makefiles/posix/ld.script diff --git a/makefiles/posix/toolchain_native.mk b/makefiles/posix/toolchain_native.mk index 28cf32c518..ff4cdc4702 100644 --- a/makefiles/posix/toolchain_native.mk +++ b/makefiles/posix/toolchain_native.mk @@ -262,7 +262,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \ $(EXTRADEFINES) \ $(EXTRAAFLAGS) -LDSCRIPT = $(PX4_BASE)/posix-configs/posixtest/scripts/ld.script +LDSCRIPT = $(PX4_BASE)/makefiles/posix/ld.script # Flags we pass to the linker # LDFLAGS += $(EXTRALDFLAGS) \ diff --git a/posix-configs/posixtest/init/rc.S b/posix-configs/SITL/init/rc.S similarity index 100% rename from posix-configs/posixtest/init/rc.S rename to posix-configs/SITL/init/rc.S diff --git a/src/drivers/drv_gpio.h b/src/drivers/drv_gpio.h index a0faab8098..acddadfdbe 100644 --- a/src/drivers/drv_gpio.h +++ b/src/drivers/drv_gpio.h @@ -114,14 +114,14 @@ /* no GPIO driver on the PX4_STM32F4DISCOVERY board */ #endif -#ifdef CONFIG_ARCH_BOARD_POSIXTEST -/* no GPIO driver on the POSIXTEST board */ +#ifdef CONFIG_ARCH_BOARD_SITL +/* no GPIO driver on the SITL configuration */ #endif #if !defined(CONFIG_ARCH_BOARD_PX4IO_V1) && !defined(CONFIG_ARCH_BOARD_PX4IO_V2) && \ !defined(CONFIG_ARCH_BOARD_PX4FMU_V1) && !defined(CONFIG_ARCH_BOARD_PX4FMU_V2) && \ !defined(CONFIG_ARCH_BOARD_AEROCORE) && !defined(CONFIG_ARCH_BOARD_PX4_STM32F4DISCOVERY) && \ - !defined(CONFIG_ARCH_BOARD_POSIXTEST) + !defined(CONFIG_ARCH_BOARD_SITL) # error No CONFIG_ARCH_BOARD_xxxx set #endif /* diff --git a/src/lib/version/version.h b/src/lib/version/version.h index ddf13822df..9d7e471adc 100644 --- a/src/lib/version/version.h +++ b/src/lib/version/version.h @@ -59,7 +59,7 @@ #define HW_ARCH "PX4_STM32F4DISCOVERY" #endif -#ifdef CONFIG_ARCH_BOARD_POSIXTEST +#ifdef CONFIG_ARCH_BOARD_SITL #define HW_ARCH "LINUXTEST" #endif #endif /* VERSION_H_ */ diff --git a/src/platforms/posix/drivers/adcsim/adcsim.cpp b/src/platforms/posix/drivers/adcsim/adcsim.cpp index fa6690ac21..d81b4a4552 100644 --- a/src/platforms/posix/drivers/adcsim/adcsim.cpp +++ b/src/platforms/posix/drivers/adcsim/adcsim.cpp @@ -274,7 +274,7 @@ adcsim_main(int argc, char *argv[]) int ret = 0; if (g_adc == nullptr) { - /* XXX this hardcodes the default channel set for POSIXTEST - should be configurable */ + /* FIXME - this hardcodes the default channel set for SITL - should be configurable */ g_adc = new ADCSIM((1 << 10) | (1 << 11) | (1 << 12) | (1 << 13)); if (g_adc == nullptr) { diff --git a/src/platforms/px4_config.h b/src/platforms/px4_config.h index e724411080..4417c5b894 100644 --- a/src/platforms/px4_config.h +++ b/src/platforms/px4_config.h @@ -49,7 +49,7 @@ #define CONFIG_SCHED_WORKQUEUE 1 #define CONFIG_SCHED_HPWORK 1 #define CONFIG_SCHED_LPWORK 1 -#define CONFIG_ARCH_BOARD_POSIXTEST 1 +#define CONFIG_ARCH_BOARD_SITL 1 /** time in ms between checks for work in work queues **/ #define CONFIG_SCHED_WORKPERIOD 50000