From d39b1c2290b255cfbbcbe2c58eda0fea34903d31 Mon Sep 17 00:00:00 2001 From: edolomb Date: Wed, 21 Feb 2018 20:59:01 +0000 Subject: Now demo works in DDR git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11534 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/ATSAMA5D2/UART/Makefile | 3 ++- testhal/ATSAMA5D2/UART/halconf.h | 2 +- testhal/ATSAMA5D2/UART/main.c | 20 ++++++-------------- testhal/ATSAMA5D2/UART/mcuconf.h | 19 ++++++++++++++++++- 4 files changed, 27 insertions(+), 17 deletions(-) (limited to 'testhal') diff --git a/testhal/ATSAMA5D2/UART/Makefile b/testhal/ATSAMA5D2/UART/Makefile index 6610a8bea..c92c547f1 100644 --- a/testhal/ATSAMA5D2/UART/Makefile +++ b/testhal/ATSAMA5D2/UART/Makefile @@ -127,7 +127,8 @@ include $(CHIBIOS)/os/common/ports/ARMCAx-TZ/compilers/GCC/mk/port_generic.mk #include $(CHIBIOS)/test/oslib/oslib_test.mk # Define linker script file here -LDSCRIPT= $(STARTUPLD)/SAMA5D2.ld +#LDSCRIPT= $(STARTUPLD)/SAMA5D2.ld +LDSCRIPT= $(STARTUPLD)/SAMA5D2ddr.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. diff --git a/testhal/ATSAMA5D2/UART/halconf.h b/testhal/ATSAMA5D2/UART/halconf.h index ff3532571..37b5f29bb 100644 --- a/testhal/ATSAMA5D2/UART/halconf.h +++ b/testhal/ATSAMA5D2/UART/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SERIAL subsystem. */ #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE +#define HAL_USE_SERIAL FALSE #endif /** diff --git a/testhal/ATSAMA5D2/UART/main.c b/testhal/ATSAMA5D2/UART/main.c index 2f57ac0ad..2150eb3a1 100644 --- a/testhal/ATSAMA5D2/UART/main.c +++ b/testhal/ATSAMA5D2/UART/main.c @@ -17,11 +17,11 @@ #include "ch.h" #include "hal.h" -#define BUFFER_SIZE 5 +#define BUFFER 5 static virtual_timer_t vt3, vt4, vt5; -static const uint8_t message[] = "ABCDE"; -static uint8_t buffer[BUFFER_SIZE]; +static const uint8_t message[] = {'a','b','c','d','e','f'}; +static uint8_t buffer[BUFFER]; static void led3off(void *p) { @@ -140,15 +140,6 @@ int main(void) { */ uartStart(&FUARTD0, &uart_cfg_1); - /* - * Activates the serial driver 0 using the driver default configuration. - */ - sdStart(&SD0, NULL); - - /* Redirecting SERIAL RX on PB26 and UART0 TX on PB27. */ - palSetGroupMode(PIOB, PAL_PORT_BIT(26) | PAL_PORT_BIT(27), 0U, - PAL_SAMA_FUNC_PERIPH_C | PAL_MODE_SECURE); - /* Redirecting UART FLEXCOM0 RX on PB28 and UART FLEXCOM0 TX on PB29. */ palSetGroupMode(PIOB, PAL_PORT_BIT(28) | PAL_PORT_BIT(29), 0U, PAL_SAMA_FUNC_PERIPH_C | PAL_MODE_SECURE); @@ -165,9 +156,10 @@ int main(void) { */ uartStopReceive(&FUARTD0); uartStopSend(&FUARTD0); - uartStartReceive(&FUARTD0, BUFFER_SIZE, buffer); - uartStartSend(&FUARTD0, BUFFER_SIZE, message); + uartStartReceive(&FUARTD0, BUFFER, buffer); + uartStartSend(&FUARTD0, 6, message); } + chThdSleepMilliseconds(500); } } diff --git a/testhal/ATSAMA5D2/UART/mcuconf.h b/testhal/ATSAMA5D2/UART/mcuconf.h index 4466ef90b..2e50baab8 100644 --- a/testhal/ATSAMA5D2/UART/mcuconf.h +++ b/testhal/ATSAMA5D2/UART/mcuconf.h @@ -23,7 +23,7 @@ * HAL driver system settings. */ #define SAMA_HAL_IS_SECURE TRUE -#define SAMA_NO_INIT FALSE +#define SAMA_NO_INIT TRUE #define SAMA_MOSCRC_ENABLED FALSE #define SAMA_MOSCXT_ENABLED TRUE #define SAMA_MOSC_SEL SAMA_MOSC_MOSCXT @@ -35,6 +35,23 @@ #define SAMA_PLLADIV2_EN TRUE #define SAMA_H64MX_H32MX_RATIO 2 +/* + * ST driver settings. + */ +#define SAMA_ST_USE_PIT FALSE +#define SAMA_ST_USE_TC0 FALSE +#define SAMA_ST_USE_TC1 TRUE + +/* + * SECUMOD driver system settings. + */ +#define HAL_USE_SECUMOD FALSE + +/* + * SDMMC driver system settings. + */ +#define HAL_USE_SDMMC FALSE + /* * SPI driver system settings. */ -- cgit v1.2.3