From 698f71a1764497504bb8de332ba8713c5165e47f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Apr 2015 14:29:21 -0600 Subject: [PATCH 1/5] STM32F4-Discover: Initialize the ELF loaded in the board startup logic. From Leo aloe3132 --- configs/stm32f4discovery/src/stm32_bringup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configs/stm32f4discovery/src/stm32_bringup.c b/configs/stm32f4discovery/src/stm32_bringup.c index 1c803183b6..cba0b704d3 100644 --- a/configs/stm32f4discovery/src/stm32_bringup.c +++ b/configs/stm32f4discovery/src/stm32_bringup.c @@ -154,5 +154,15 @@ int stm32_bringup(void) } #endif +#ifdef HAVE_ELF + /* Initialize the ELF binary loader */ + + ret = elf_initialize(); + if (ret < 0) + { + sdbg("ERROR: Initialization of the ELF loader failed: %d\n", ret); + } +#endif + return ret; } From 916ccc78bb852f1053e0c0bdc0ebc90c2607b536 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Apr 2015 14:31:04 -0600 Subject: [PATCH 2/5] binfmt: Fix a debug statement that does not have the correct number of arguments. From Leo aloe3132 --- binfmt/libelf/libelf_bind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binfmt/libelf/libelf_bind.c b/binfmt/libelf/libelf_bind.c index 58ceb148f8..59782bb1ca 100644 --- a/binfmt/libelf/libelf_bind.c +++ b/binfmt/libelf/libelf_bind.c @@ -222,7 +222,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, ret = up_relocate(&rel, psym, addr); if (ret < 0) { - bdbg("ERROR: Section %d reloc %d: Relocation failed: %d\n", ret); + bdbg("ERROR: Section %d reloc %d: Relocation failed: %d\n", relidx, i, ret); return ret; } } From c4a337389c5e4edb93893b5333baa25c3dc03b15 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Apr 2015 14:32:30 -0600 Subject: [PATCH 3/5] STM32F4-Discovery: Part of logic to initialize the ELF loaded in the board startup logic. From Leo aloe3132 --- configs/stm32f4discovery/src/stm32f4discovery.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/stm32f4discovery/src/stm32f4discovery.h b/configs/stm32f4discovery/src/stm32f4discovery.h index 5c29e38b79..d907e1e4d2 100644 --- a/configs/stm32f4discovery/src/stm32f4discovery.h +++ b/configs/stm32f4discovery/src/stm32f4discovery.h @@ -68,6 +68,7 @@ #define HAVE_USBMONITOR 1 #define HAVE_SDIO 1 #define HAVE_RTC_DRIVER 1 +#define HAVE_ELF 1 /* Can't support USB host or device features if USB OTG FS is not enabled */ @@ -140,6 +141,13 @@ # undef HAVE_RTC_DRIVER #endif +/* ELF */ + +#if defined(CONFIG_BINFMT_DISABLE) || !defined(CONFIG_ELF) +# undef HAVE_ELF +#endif + + /* STM32F4 Discovery GPIOs **************************************************/ /* LEDs */ From 63dce70d2b02b89cf6ed357e3bfa7f7a8ef9a47c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 1 May 2015 07:31:56 -0600 Subject: [PATCH 4/5] Added missing EXTI definitions for the STM32 F3; Correct an error the port D base address in the STM32 F3 and F37 memory maps. From Greg Meiste. --- arch/arm/src/stm32/chip/stm32_exti.h | 7 +++++++ arch/arm/src/stm32/chip/stm32f30xxx_memorymap.h | 4 ++-- arch/arm/src/stm32/chip/stm32f37xxx_memorymap.h | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32/chip/stm32_exti.h b/arch/arm/src/stm32/chip/stm32_exti.h index 50191ecdcc..ad636417ec 100644 --- a/arch/arm/src/stm32/chip/stm32_exti.h +++ b/arch/arm/src/stm32/chip/stm32_exti.h @@ -137,6 +137,13 @@ # define EXTI_RTC_TAMPER (1 << 21) /* EXTI line 21 is connected to the RTC Tamper and TimeStamp events */ # define EXTI_RTC_TIMESTAMP (1 << 21) /* EXTI line 21 is connected to the RTC Tamper and TimeStamp events */ # define EXTI_RTC_WAKEUP (1 << 22) /* EXTI line 22 is connected to the RTC Wakeup event */ +#elif defined(CONFIG_STM32_STM32F30XX) +# define EXTI_PVD_LINE (1 << 16) /* EXTI line 16 is connected to the PVD output */ +# define EXTI_RTC_ALARM (1 << 17) /* EXTI line 17 is connected to the RTC Alarm event */ +# define EXTI_OTGFS_WAKEUP (1 << 18) /* EXTI line 18 is connected to the USB OTG FS Wakeup event */ +# define EXTI_RTC_TAMPER (1 << 19) /* EXTI line 19 is connected to the RTC Tamper and TimeStamp events */ +# define EXTI_RTC_TIMESTAMP (1 << 19) /* EXTI line 19 is connected to the RTC Tamper and TimeStamp events */ +# define EXTI_RTC_WAKEUP (1 << 20) /* EXTI line 20 is connected to the RTC Wakeup event */ #endif /* Interrupt mask register */ diff --git a/arch/arm/src/stm32/chip/stm32f30xxx_memorymap.h b/arch/arm/src/stm32/chip/stm32f30xxx_memorymap.h index c8cb8f03e9..51cca40eef 100644 --- a/arch/arm/src/stm32/chip/stm32f30xxx_memorymap.h +++ b/arch/arm/src/stm32/chip/stm32f30xxx_memorymap.h @@ -139,7 +139,7 @@ #define STM32_GPIOA_BASE 0x48000000 /* 0x48000000-0x480003ff: GPIO Port A */ #define STM32_GPIOB_BASE 0x48000400 /* 0x48000400-0x480007ff: GPIO Port B */ #define STM32_GPIOC_BASE 0x48000800 /* 0x48000800-0x48000bff: GPIO Port C */ -#define STM32_GPIOD_BASE 0X40000C00 /* 0x48000c00-0x48000fff: GPIO Port D */ +#define STM32_GPIOD_BASE 0X48000C00 /* 0x48000c00-0x48000fff: GPIO Port D */ #define STM32_GPIOE_BASE 0x48001000 /* 0x48001000-0x480013ff: GPIO Port E */ #define STM32_GPIOF_BASE 0x48001400 /* 0x48001400-0x480017ff: GPIO Port F */ @@ -153,7 +153,7 @@ #define STM32_ADC34_BASE 0x50000700 /* 0x50000700-0x50000708: ADC34 Common */ /* Cortex-M4 Base Addresses *********************************************************/ -/* Other registers -- see armv7-m/nvic.h for standard Cortex-M3 registers in this +/* Other registers -- see armv7-m/nvic.h for standard Cortex-M4 registers in this * address range */ diff --git a/arch/arm/src/stm32/chip/stm32f37xxx_memorymap.h b/arch/arm/src/stm32/chip/stm32f37xxx_memorymap.h index cf01966f2d..a9116019bf 100644 --- a/arch/arm/src/stm32/chip/stm32f37xxx_memorymap.h +++ b/arch/arm/src/stm32/chip/stm32f37xxx_memorymap.h @@ -142,12 +142,12 @@ #define STM32_GPIOA_BASE 0x48000000 /* 0x48000000-0x480003ff: GPIO Port A */ #define STM32_GPIOB_BASE 0x48000400 /* 0x48000400-0x480007ff: GPIO Port B */ #define STM32_GPIOC_BASE 0x48000800 /* 0x48000800-0x48000bff: GPIO Port C */ -#define STM32_GPIOD_BASE 0X40000C00 /* 0x48000c00-0x48000fff: GPIO Port D */ +#define STM32_GPIOD_BASE 0X48000C00 /* 0x48000c00-0x48000fff: GPIO Port D */ #define STM32_GPIOE_BASE 0x48001000 /* 0x48001000-0x480013ff: GPIO Port E */ #define STM32_GPIOF_BASE 0x48001400 /* 0x48001400-0x480017ff: GPIO Port F */ /* Cortex-M4 Base Addresses *********************************************************/ -/* Other registers -- see armv7-m/nvic.h for standard Cortex-M3 registers in this +/* Other registers -- see armv7-m/nvic.h for standard Cortex-M4 registers in this * address range */ From 49fef8baccedc271dbd87bc47b2dee4a2d515c8a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 1 May 2015 07:34:54 -0600 Subject: [PATCH 5/5] Update ChangeLog --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index bed8fa44bb..39f9fde997 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10265,3 +10265,7 @@ F1/F2/F4 etc. manuals. Tested on STM32L1. PVD interrupt looks generic, at least #defines it needs are in headers for every chip variant. By Dmitry Nikolaev, submitted by Juha Niskanen (2015-04-28). + * arch/arm/src/stm32/chip/stm32_exti.h, stm32f30xxx_memorymap.h, and + stm32f37xxx_memorymap.h: Added missing EXTI definitions for the STM32 + F3; Correct an error the port D base address in the STM32 F30x and F37x + memory maps. From Greg Meiste (2015-05-01).