From ba98596ccdc9f1ed7c0b085723602ed07e81a05b Mon Sep 17 00:00:00 2001 From: Marshal Horn Date: Sun, 5 Jul 2020 10:27:38 -0700 Subject: [PATCH] Created new board template for uSDX Also, switched to an eclipse project --- ChibiOS | 2 +- NIL-STM32F051-DISCOVERY/.cproject | 368 ++++++++++++++++++++++++++++++ NIL-STM32F051-DISCOVERY/.project | 95 ++++++++ NIL-STM32F051-DISCOVERY/Makefile | 2 +- NIL-STM32F051-DISCOVERY/main.c | 5 +- 5 files changed, 466 insertions(+), 6 deletions(-) create mode 100644 NIL-STM32F051-DISCOVERY/.cproject create mode 100644 NIL-STM32F051-DISCOVERY/.project diff --git a/ChibiOS b/ChibiOS index 3249070..f1258a7 160000 --- a/ChibiOS +++ b/ChibiOS @@ -1 +1 @@ -Subproject commit 3249070d416831189da73676219723c24de04934 +Subproject commit f1258a70ac8403796bbb340659a688776a36bf82 diff --git a/NIL-STM32F051-DISCOVERY/.cproject b/NIL-STM32F051-DISCOVERY/.cproject new file mode 100644 index 0000000..d4bd69a --- /dev/null +++ b/NIL-STM32F051-DISCOVERY/.cproject @@ -0,0 +1,368 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NIL-STM32F051-DISCOVERY/.project b/NIL-STM32F051-DISCOVERY/.project new file mode 100644 index 0000000..7f78aa9 --- /dev/null +++ b/NIL-STM32F051-DISCOVERY/.project @@ -0,0 +1,95 @@ + + + NIL-STM32F051-DISCOVERY + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + mingw32-make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + false + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + board + 2 + CHIBIOS/os/hal/boards/uSDX + + + os + 2 + CHIBIOS/os + + + test + 2 + CHIBIOS/test + + + diff --git a/NIL-STM32F051-DISCOVERY/Makefile b/NIL-STM32F051-DISCOVERY/Makefile index 42d2773..b7222b1 100644 --- a/NIL-STM32F051-DISCOVERY/Makefile +++ b/NIL-STM32F051-DISCOVERY/Makefile @@ -101,7 +101,7 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.m # HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk -include $(CHIBIOS)/os/hal/boards/ST_STM32F0_DISCOVERY/board.mk +include $(CHIBIOS)/os/hal/boards/uSDX/board.mk include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/nil/nil.mk diff --git a/NIL-STM32F051-DISCOVERY/main.c b/NIL-STM32F051-DISCOVERY/main.c index 94d106f..6b3e60b 100644 --- a/NIL-STM32F051-DISCOVERY/main.c +++ b/NIL-STM32F051-DISCOVERY/main.c @@ -64,15 +64,12 @@ THD_FUNCTION(Thread3, arg) { * PA9 and PA10 are routed to USART1. */ sdStart(&SD1, NULL); - palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(1)); /* USART1 TX. */ - palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(1)); /* USART1 RX. */ - /* Welcome message.*/ chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14); /* Waiting for button push and activation of the test suite.*/ while (true) { - if (palReadLine(LINE_BUTTON)) { + if (palReadLine(LINE_ENC0)) { test_execute((BaseSequentialStream *)&SD1, &nil_test_suite); test_execute((BaseSequentialStream *)&SD1, &oslib_test_suite); }