Unverified Commit d168fce7 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

stm32f446re-nucleo: declare counter freq

parent 944b0513
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@ SERIAL_PORT ?= ttyACM0

cpu_freq ?= 168000000

# counter runs at cpu_freq/2
counter_freq ?= 84000000

INCLUDES += -Iext/libopencm3/include

COMMON_FLAGS += --static -nostartfiles -g3 -Os -fno-common
@@ -118,7 +121,7 @@ arch_clean:
	${QUIET}rm -f ${OBJECTS}

cat:
	${QUIET}script/cat.py /dev/${SERIAL_PORT} 115200 ${cpu_freq} 65536
	${QUIET}script/cat.py /dev/${SERIAL_PORT} 115200 ${counter_freq} 65536 ${MAKE_CAT_TIMEOUT}

monitor:
	${QUIET}screen /dev/${SERIAL_PORT} 115200
@@ -130,9 +133,8 @@ arch_help:

arch_info:
	@echo "CPU   Freq: ${cpu_freq} Hz"
	@echo "Timer Freq: ${timer_freq} Hz -> $(shell src/arch/stm32f446re-nucleo/model.py f_timer "${cpu_freq}" "${timer_freq}")"
	@echo "I2C   Freq: ${i2c_freq} Hz"
	@echo "Counter Overflow: 4294967296/255"
	@echo "Count Freq: ${counter_freq} Hz"
	@echo "Counter Overflow: 4294967296/4294967295"
	@echo "Monitor: /dev/${SERIAL_PORT} 115200"

attributes: build/system.elf
+2 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ void Arch::setup(void)
#error Unsupported F_CPU
#endif

	// counter
#ifdef CONFIG_arch_stm32f446re_nucleo_driver_counter
	rcc_periph_clock_enable(RCC_TIM2);
	nvic_enable_irq(NVIC_TIM2_IRQ);
	rcc_periph_reset_pulse(RST_TIM2);
@@ -38,6 +38,7 @@ void Arch::setup(void)
	timer_continuous_mode(TIM2);
	timer_set_period(TIM2, 4294967295);
	timer_enable_irq(TIM2, TIM_DIER_UIE);
#endif

#ifdef CONFIG_loop
	rcc_periph_clock_enable(RCC_TIM3);