diff --git a/configs/README.txt b/configs/README.txt index 8ea6099810..0c774c45c3 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -429,6 +429,12 @@ configs/olimex-stm32-h405 further information. This board features the STMicro STM32F405RGT6 MCU. Contributed by Martin Lederhilger. +configs/olimex-stm32-h407 + This port uses the Olimex STM32 H407 board and a GNU arm-nuttx-elf + toolchain* under Linux or Cygwin. See the http://www.olimex.com for + further information. This board features the STMicro STM32F407ZGT6 (144 + pins). Contributed by Neil Hancock. + configs/olimex-stm32-p107 This port uses the Olimex STM32-P107 board (STM32F107VC) and a GNU arm-nuttx-elf toolchain* under Linux or Cygwin. See the https://www.olimex.com/dev/stm32-p107.html diff --git a/configs/olimex-stm32-h407/README.txt b/configs/olimex-stm32-h407/README.txt index 30f193f38b..5bb5c5dfda 100644 --- a/configs/olimex-stm32-h407/README.txt +++ b/configs/olimex-stm32-h407/README.txt @@ -11,6 +11,3 @@ nsh - Only basic shell response tested on USART2 This realease provides baseline for H407 12MHZ clock in include/board.h TODO: Update to use mini USB-OTG and USB HOST - - - diff --git a/configs/olimex-stm32-h407/include/board.h b/configs/olimex-stm32-h407/include/board.h index beee81bcf9..3aacd64c1a 100644 --- a/configs/olimex-stm32-h407/include/board.h +++ b/configs/olimex-stm32-h407/include/board.h @@ -1,9 +1,9 @@ /************************************************************************************ * configs/olimex-stm32-h407/include/board.h * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt - * Modified for H407 Neil Hancock + * Modified for H407 Neil Hancock * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -204,23 +204,27 @@ /* Alternate function pin selections ************************************************/ -//USART3: -//#define GPIO_USART3_RX GPIO_USART3_RX_1 //PB11 -//#define GPIO_USART3_TX GPIO_USART3_TX_1 //PB10 -//#define GPIO_USART3_CTS GPIO_USART3_CTS_1 //PB13 -//#define GPIO_USART3_RTS GPIO_USART3_RTS_1 //PB14 +/* USART3: */ +#if 0 +#define GPIO_USART3_RX GPIO_USART3_RX_1 /* PB11 */ +#define GPIO_USART3_TX GPIO_USART3_TX_1 /* PB10 */ +#define GPIO_USART3_CTS GPIO_USART3_CTS_1 /* PB13 */ +#define GPIO_USART3_RTS GPIO_USART3_RTS_1 /* PB14 */ +#endif -//USART2 -#define GPIO_USART2_RX GPIO_USART2_RX_1 // -#define GPIO_USART2_TX GPIO_USART2_TX_1 // -#define GPIO_USART2_CTS GPIO_USART2_CTS_1 // -#define GPIO_USART2_RTS GPIO_USART2_RTS_1 // +/* USART2: */ -//CAN: -#define GPIO_CAN1_RX GPIO_CAN1_RX_2 //PB8 -#define GPIO_CAN1_TX GPIO_CAN1_TX_2 //PB9 -#define GPIO_CAN2_RX GPIO_CAN1_RX_2 //PB5 -#define GPIO_CAN2_TX GPIO_CAN1_TX_2 //PB6 +#define GPIO_USART2_RX GPIO_USART2_RX_1 +#define GPIO_USART2_TX GPIO_USART2_TX_1 +#define GPIO_USART2_CTS GPIO_USART2_CTS_1 +#define GPIO_USART2_RTS GPIO_USART2_RTS_1 + +/* CAN: */ + +#define GPIO_CAN1_RX GPIO_CAN1_RX_2 /* PB8 */ +#define GPIO_CAN1_TX GPIO_CAN1_TX_2 /* PB9 */ +#define GPIO_CAN2_RX GPIO_CAN1_RX_2 /* PB5 */ +#define GPIO_CAN2_TX GPIO_CAN1_TX_2 /* PB6 */ /************************************************************************************ * Public Data diff --git a/configs/olimex-stm32-h407/nsh/Make.defs b/configs/olimex-stm32-h407/nsh/Make.defs index 38887dee87..41cbe33313 100644 --- a/configs/olimex-stm32-h407/nsh/Make.defs +++ b/configs/olimex-stm32-h407/nsh/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/olimex-stm32-h407/nsh/Make.defs # -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/olimex-stm32-h407/nsh/setenv.sh b/configs/olimex-stm32-h407/nsh/setenv.sh index d67e6fdc7d..38135e980e 100755 --- a/configs/olimex-stm32-h407/nsh/setenv.sh +++ b/configs/olimex-stm32-h407/nsh/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash # configs/stm32f4discovery/nsh/setenv.sh # -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/olimex-stm32-h407/scripts/ld.script b/configs/olimex-stm32-h407/scripts/ld.script index 508d49e59c..8cb28bca07 100644 --- a/configs/olimex-stm32-h407/scripts/ld.script +++ b/configs/olimex-stm32-h407/scripts/ld.script @@ -1,7 +1,7 @@ /**************************************************************************** * configs/olimex-stm32-h405/scripts/ld.script * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,12 +33,12 @@ * ****************************************************************************/ -/* The STM32F405RGT6 has 1024Kb of FLASH beginning at address 0x0800:0000 and +/* The STM32F407ZGT6 has 1024Kb of FLASH beginning at address 0x0800:0000 and * 192Kb of SRAM. SRAM is split up into two blocks: * * 1) 112Kb of SRAM beginning at address 0x2000:0000 * 2) 16Kb of SRAM beginning at address 0x2001:c000 - 3) 64Kb of SRAM beginning at address 0x2002:0000 + * 3) 64Kb of SRAM beginning at address 0x2002:0000 * * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 * where the code expects to begin execution by jumping to the entry point in @@ -48,8 +48,8 @@ MEMORY { - flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K + flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K + sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K } OUTPUT_ARCH(arm) diff --git a/configs/olimex-stm32-h407/src/Makefile b/configs/olimex-stm32-h407/src/Makefile index 99492bb638..98727266da 100644 --- a/configs/olimex-stm32-h407/src/Makefile +++ b/configs/olimex-stm32-h407/src/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/olimex-stm32-h407/src/Makefile # -# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/olimex-stm32-h407/src/olimex-stm32-h407.h b/configs/olimex-stm32-h407/src/olimex-stm32-h407.h index 730769dbcd..6a43407657 100644 --- a/configs/olimex-stm32-h407/src/olimex-stm32-h407.h +++ b/configs/olimex-stm32-h407/src/olimex-stm32-h407.h @@ -1,5 +1,5 @@ /**************************************************************************** - * configs/olimex-stm32-h405/src/olimex-stm32-h405.h + * configs/olimex-stm32-h407/src/olimex-stm32-h407.h * * Copyright (C) 2014 Max Holtzberg. All rights reserved. * Author: Max Holtzberg diff --git a/configs/olimex-stm32-h407/src/stm32_adc.c b/configs/olimex-stm32-h407/src/stm32_adc.c index f91e59a8d8..a7f3e6aa32 100644 --- a/configs/olimex-stm32-h407/src/stm32_adc.c +++ b/configs/olimex-stm32-h407/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/olimex-stm32-h405/src/stm32_adc.c + * configs/olimex-stm32-h407/src/stm32_adc.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -87,22 +87,22 @@ * ADC123_IN10 */ -/* Identifying number of each ADC channel: Variable Resistor. */ +/* Identifying number of each ADC channel: Variable Resistor. + * + * {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15}; + */ #ifdef CONFIG_STM32_ADC1 -static const uint8_t g_chanlist[ADC1_NCHANNELS] = {1};/*, 2, 3, - 4, 5, 6, - 7, 8, 9, - 10, 11, 12, - 13, 15};*/ +static const uint8_t g_chanlist[ADC1_NCHANNELS] = {1}; -/* Configurations of pins used byte each ADC channels */ +/* Configurations of pins used byte each ADC channels + * + * {GPIO_ADC1_IN1, GPIO_ADC1_IN2, GPIO_ADC1_IN3, GPIO_ADC1_IN4, GPIO_ADC1_IN5, + * GPIO_ADC1_IN6, GPIO_ADC1_IN7, GPIO_ADC1_IN8, GPIO_ADC1_IN9, GPIO_ADC1_IN10, + * GPIO_ADC1_IN11, GPIO_ADC1_IN12, GPIO_ADC1_IN13, GPIO_ADC1_IN15}; + */ -static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN1};/*, GPIO_ADC1_IN2, GPIO_ADC1_IN3, - GPIO_ADC1_IN4, GPIO_ADC1_IN5, GPIO_ADC1_IN6, - GPIO_ADC1_IN7, GPIO_ADC1_IN8, GPIO_ADC1_IN9, - GPIO_ADC1_IN10, GPIO_ADC1_IN11, GPIO_ADC1_IN12, - GPIO_ADC1_IN13, GPIO_ADC1_IN15};*/ +static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN1}; #endif /************************************************************************************ diff --git a/configs/olimex-stm32-h407/src/stm32_autoleds.c b/configs/olimex-stm32-h407/src/stm32_autoleds.c index 53a764327e..01bc2b5dae 100644 --- a/configs/olimex-stm32-h407/src/stm32_autoleds.c +++ b/configs/olimex-stm32-h407/src/stm32_autoleds.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/olimex-stm32-h407/src/stm32_autoleds.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -70,14 +70,6 @@ # define ledvdbg(x...) #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -99,11 +91,15 @@ void board_autoled_initialize(void) void board_autoled_on(int led) { - if(led == LED_STARTED) - stm32_gpiowrite(GPIO_LED_STATUS, true); + if (led == LED_STARTED) + { + stm32_gpiowrite(GPIO_LED_STATUS, true); + } - if(led == LED_ASSERTION || led == LED_PANIC) + if (led == LED_ASSERTION || led == LED_PANIC) + { stm32_gpiowrite(GPIO_LED_STATUS, false); + } } /**************************************************************************** @@ -112,11 +108,15 @@ void board_autoled_on(int led) void board_autoled_off(int led) { - if(led == LED_STARTED) + if (led == LED_STARTED) + { stm32_gpiowrite(GPIO_LED_STATUS, false); + } - if(led == LED_ASSERTION || led == LED_PANIC) - stm32_gpiowrite(GPIO_LED_STATUS, true); + if (led == LED_ASSERTION || led == LED_PANIC) + { + stm32_gpiowrite(GPIO_LED_STATUS, true); + } } #endif /* CONFIG_ARCH_LEDS */ diff --git a/configs/olimex-stm32-h407/src/stm32_boot.c b/configs/olimex-stm32-h407/src/stm32_boot.c index 5dfad7fb64..cd4a5a5416 100644 --- a/configs/olimex-stm32-h407/src/stm32_boot.c +++ b/configs/olimex-stm32-h407/src/stm32_boot.c @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/olimex-stm32-h405/src/stm32_boot.c + * configs/olimex-stm32-h407/src/stm32_boot.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,14 +49,6 @@ #include "olimex-stm32-h407.h" #include "stm32_ccm.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -73,27 +65,27 @@ void stm32_boardinitialize(void) { +#if defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS) /* Initialize USB if the 1) OTG FS controller is in the configuration and 2) * disabled, and 3) the weak function stm32_usbinitialize() has been brought * into the build. Presumeably either CONFIG_USBDEV is also selected. */ -#if defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS) if (stm32_usbinitialize) { stm32_usbinitialize(); } #endif +#ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ -#ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif +#ifdef CONFIG_ARCH_BUTTONS /* Configure on-board BUTTONs if BUTTON support has been selected. */ -#ifdef CONFIG_ARCH_BUTTONS board_button_initialize(); #endif } @@ -114,12 +106,12 @@ void stm32_boardinitialize(void) #ifdef CONFIG_BOARD_INITIALIZE void board_initialize(void) { +#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_NSH_ARCHINIT) /* Perform NSH initialization here instead of from the NSH. This * alternative NSH initialization is necessary when NSH is ran in user-space * but the initialization function must run in kernel space. */ -#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_NSH_ARCHINIT) board_app_initialize(); #endif } diff --git a/configs/olimex-stm32-h407/src/stm32_buttons.c b/configs/olimex-stm32-h407/src/stm32_buttons.c index d98b0c109e..7bd3ff2f53 100644 --- a/configs/olimex-stm32-h407/src/stm32_buttons.c +++ b/configs/olimex-stm32-h407/src/stm32_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * configs/olimex-stm32-h405/src/stm32_buttons.c + * configs/olimex-stm32-h407/src/stm32_buttons.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -49,14 +49,6 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/configs/olimex-stm32-h407/src/stm32_can.c b/configs/olimex-stm32-h407/src/stm32_can.c index cae95ab053..521c444511 100644 --- a/configs/olimex-stm32-h407/src/stm32_can.c +++ b/configs/olimex-stm32-h407/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimex-stm32-405/src/stm32_can.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -80,10 +80,6 @@ # define canllvdbg(x...) #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-stm32-h407/src/stm32_cxxinitialize.c b/configs/olimex-stm32-h407/src/stm32_cxxinitialize.c index 30704c57a4..23c17bb57d 100644 --- a/configs/olimex-stm32-h407/src/stm32_cxxinitialize.c +++ b/configs/olimex-stm32-h407/src/stm32_cxxinitialize.c @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/olimex-stm32-h405/src/stm32_cxxinitialize.c + * configs/olimex-stm32-h407/src/stm32_cxxinitialize.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/configs/olimex-stm32-h407/src/stm32_nsh.c b/configs/olimex-stm32-h407/src/stm32_nsh.c index 6b655d24eb..f343c6838c 100644 --- a/configs/olimex-stm32-h407/src/stm32_nsh.c +++ b/configs/olimex-stm32-h407/src/stm32_nsh.c @@ -1,7 +1,7 @@ /**************************************************************************** - * config/olimex-stm32-h405/src/stm32_nsh.c + * config/olimex-stm32-h407/src/stm32_nsh.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/configs/olimex-stm32-h407/src/stm32_usb.c b/configs/olimex-stm32-h407/src/stm32_usb.c index 6188f99cb2..22b246af38 100644 --- a/configs/olimex-stm32-h407/src/stm32_usb.c +++ b/configs/olimex-stm32-h407/src/stm32_usb.c @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/olimex-stm32-h405/src/stm32_usbdev.c + * configs/olimex-stm32-h407/src/stm32_usbdev.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/configs/olimex-stm32-h407/src/stm32_userleds.c b/configs/olimex-stm32-h407/src/stm32_userleds.c index 2dd8e8708f..44d85989e6 100644 --- a/configs/olimex-stm32-h407/src/stm32_userleds.c +++ b/configs/olimex-stm32-h407/src/stm32_userleds.c @@ -1,7 +1,7 @@ /**************************************************************************** - * configs/olimex-stm32-h405/src/stm32_leds.c + * configs/olimex-stm32-h407/src/stm32_leds.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without