From 0bda5533de55ecd50c5a061bd63f39c54d88010d Mon Sep 17 00:00:00 2001 From: jsphuebner Date: Thu, 6 May 2021 22:16:52 +0200 Subject: [PATCH] Another attempt to adopt to varying flash size and geometry --- Makefile | 2 -- include/hwdefs.h | 3 +++ libopencm3 | 2 +- libopeninv | 2 +- src/hwinit.cpp | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1237d8f..0c3ace6 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,6 @@ ## OUT_DIR = obj -space := -space += PREFIX ?= arm-none-eabi CONTROL ?= SINE CONTROLLC := $(shell echo $(CONTROL) | tr A-Z a-z) diff --git a/include/hwdefs.h b/include/hwdefs.h index 62d0bd1..95f4917 100644 --- a/include/hwdefs.h +++ b/include/hwdefs.h @@ -25,6 +25,9 @@ //Address of parameter block in flash #define PARAM_BLKSIZE 1024 +#define PARAM_BLKNUM 1 //last block of 1k +#define CAN_BLKSIZE 1024 +#define CAN_BLKNUM 2 //second to last block of 1k #define REV_CNT_IC hwRev == HW_REV1 ? TIM_IC3 : TIM_IC1 #define REV_CNT_OC hwRev == HW_REV1 ? TIM_OC3 : TIM_OC1 diff --git a/libopencm3 b/libopencm3 index 54631b9..5ba1bb5 160000 --- a/libopencm3 +++ b/libopencm3 @@ -1 +1 @@ -Subproject commit 54631b91ad15417e8a2dba98d4c564f0937643de +Subproject commit 5ba1bb5f8b0287a0ccec9def20f3a6185c3a2a8e diff --git a/libopeninv b/libopeninv index f089afe..de5b53a 160000 --- a/libopeninv +++ b/libopeninv @@ -1 +1 @@ -Subproject commit f089afee699612993410acb4b2e161837bdccf1c +Subproject commit de5b53a65d32ad74d1bfc189ce164855d687edbb diff --git a/src/hwinit.cpp b/src/hwinit.cpp index 5a1c10f..23a8137 100644 --- a/src/hwinit.cpp +++ b/src/hwinit.cpp @@ -43,10 +43,10 @@ */ void clock_setup(void) { - rcc_clock_setup_in_hse_8mhz_out_72mhz(); + rcc_clock_setup_pll(&rcc_hse_configs[RCC_CLOCK_HSE8_72MHZ]); //Run ADC at 12 MHz - rcc_set_adcpre(RCC_CFGR_ADCPRE_PCLK2_DIV6); + rcc_set_adcpre(RCC_CFGR_ADCPRE_PCLK2_DIV6); //The reset value for PRIGROUP (=0) is not actually a defined //value. Explicitly set 16 preemtion priorities