From 96864a4b7c25f8660412c6596da08e1eed2c1a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 6 Jul 2017 10:32:04 +0200 Subject: [PATCH 1/3] did things --- Makefile | 6 ++---- include/arm_math.h | 2 +- main.c | 1 + stm32f7-template.config | 6 ++++++ stm32f7-template.creator | 1 + stm32f7-template.files | 12 ++++++++++++ stm32f7-template.includes | 1 + 7 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 stm32f7-template.config create mode 100644 stm32f7-template.creator create mode 100644 stm32f7-template.files create mode 100644 stm32f7-template.includes diff --git a/Makefile b/Makefile index 1a6c15b..54be891 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ INCLUDEPATH = -Iinclude target = project LIBRARYPATH = -Lstartup -Ldsp -LIBRARIES = -larm_cortexM7lfsp_math +LIBRARIES = -larm_cortexM7lfsp_math -lm DEFINES = -DSTM32F746xx -DSTM32F7XX -DARM_MATH_CM7 mapfile = memmap @@ -40,15 +40,13 @@ ASOBJ = $(ASFILES:%.S=%.S.o) default: $(target).elf - - +binary: $(target).bin $(target).hex %.bin: %.elf $(OBJCOPY) -O binary $^ $@ %.hex: %.elf $(OBJCOPY) -O ihex $^ $@ - #Linking $(target).elf: $(OBJ) $(ASOBJ) $(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $^ $(LIBRARIES) diff --git a/include/arm_math.h b/include/arm_math.h index 580cbbd..9b401ab 100644 --- a/include/arm_math.h +++ b/include/arm_math.h @@ -299,7 +299,7 @@ #define __CMSIS_GENERIC /* disable NVIC and Systick functions */ #if defined(ARM_MATH_CM7) - #include "core_cm7.h" + #include #elif defined (ARM_MATH_CM4) #include "core_cm4.h" #elif defined (ARM_MATH_CM3) diff --git a/main.c b/main.c index 06c6ac0..1261905 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,6 @@ #include + unsigned int i = 0x12345678; unsigned char c = 2; diff --git a/stm32f7-template.config b/stm32f7-template.config new file mode 100644 index 0000000..03db85f --- /dev/null +++ b/stm32f7-template.config @@ -0,0 +1,6 @@ +// Add predefined macros for your project here. For example: +// #define THE_ANSWER 42 +#define STM32F746xx +#define STM32F7XX +#define ARM_MATH_CM7 + diff --git a/stm32f7-template.creator b/stm32f7-template.creator new file mode 100644 index 0000000..e94cbbd --- /dev/null +++ b/stm32f7-template.creator @@ -0,0 +1 @@ +[General] diff --git a/stm32f7-template.files b/stm32f7-template.files new file mode 100644 index 0000000..c63c2db --- /dev/null +++ b/stm32f7-template.files @@ -0,0 +1,12 @@ +include/arm_math.h +include/cmsis/cmsis_gcc.h +include/cmsis/core_cm7.h +include/cmsis/core_cmFunc.h +include/cmsis/core_cmInstr.h +include/cmsis/core_cmSimd.h +include/stm32f746xx.h +include/stm32f7xx.h +main.c +setup/system_init.c +startup/startup_stm32f746.c +syscalls/syscalls.c diff --git a/stm32f7-template.includes b/stm32f7-template.includes new file mode 100644 index 0000000..a1a869c --- /dev/null +++ b/stm32f7-template.includes @@ -0,0 +1 @@ +include From 8e25f5ddb1404b1bdffc951f60d02dbcdc9bcfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 6 Jul 2017 10:33:26 +0200 Subject: [PATCH 2/3] add diassembly listing to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 628444f..ebf1773 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ project.elf *.map *.bin *.hex +*.lss *.user *.user* *.user.* From b73f79b53f80ecbcd3b1898eaa5b887f33041f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 6 Jul 2017 10:59:06 +0200 Subject: [PATCH 3/3] Add efine in .config file for FPU (set by compiler), defined new bitfileds for clock config. --- setup/system_init.c | 14 +++++++++++--- stm32f7-template.config | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/setup/system_init.c b/setup/system_init.c index 00304f7..4e8e553 100644 --- a/setup/system_init.c +++ b/setup/system_init.c @@ -4,6 +4,7 @@ const signed char __pll_main_div_q_val[] = {-1, -1, 2, 3, 4, 5, 6, 7, 8 ,9, 10, const signed char __pll_main_div_p_val[] = {-1, -1, 0, -1, 1, -1, 2, -1, 3}; const signed char __mco_div_val[] = {-1, 0, 4, 5, 6, 7}; const signed char __apb_presc_val[] = {-1, 0, 4, -1, 5, -1, -1, -1, 6, -1, -1, -1, -1, -1, -1, -1, 7}; +const signed char *__pll_i2s_div_p_val = __pll_main_div_p_val; #define SYSINIT_MAIN_I2S_PLL_DIV_M_MIN (2) #define SYSINIT_MAIN_I2S_PLL_DIV_M_MAX (63) #define SYSINIT_MAIN_I2S_PLL_MULT_N_MIN (2) @@ -40,13 +41,14 @@ struct clock_config { uint32_t pll_main_on : 1; uint32_t css_on : 1; uint32_t hse_bypass : 1; + uint32_t lse_bypass : 1; uint32_t hsi_trim : 5; /* Main PLL Conf */ uint32_t pll_main_i2s_src : 1; uint32_t pll_main_div_q : 4; /* true value */ uint32_t pll_main_div_p : 3; /* true value */ uint32_t pll_main_mult_n : 9; - uint32_t pll_main_div_m : 6; + uint32_t pll_div_m : 6; /* MCO Outputs */ uint32_t mco2_sel : 2; uint32_t mco2_presc : 3; @@ -55,13 +57,19 @@ struct clock_config { uint32_t i2s_src : 1; /* RTC */ uint32_t rtc_hse_div_1_meg : 5; + uint32_t rtc_clock_en : 1; /* APB */ uint32_t apb1_presc : 5; uint32_t apb2_presc : 5; /* Systemclock */ uint32_t sysclk_src : 2; - - + /* PLLI2S */ + uint32_t pll_i2s_r : 3; + uint32_t pll_i2s_q : 4; + uint32_t pll_i2s_p : 4; /* true value */ + uint32_t pll_i2s_mult : 9; + /* PLLSAI */ + /* AHB */ enum sysinit_ahb_presc ahb_presc; }; diff --git a/stm32f7-template.config b/stm32f7-template.config index 03db85f..9c20b41 100644 --- a/stm32f7-template.config +++ b/stm32f7-template.config @@ -4,3 +4,5 @@ #define STM32F7XX #define ARM_MATH_CM7 +/* This is set by the compiler */ +#define __VFP_FP__ 1