From 66af65c8ff6d1b939c1f09e063f7df17c8cbd910 Mon Sep 17 00:00:00 2001 From: aleph Date: Tue, 5 Oct 2010 16:47:01 +0000 Subject: [PATCH] sam3n port: set flash wait states before activating fast clock git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4414 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/drv/clock_sam3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bertos/cpu/cortex-m3/drv/clock_sam3.c b/bertos/cpu/cortex-m3/drv/clock_sam3.c index b0486c51..fef0f125 100644 --- a/bertos/cpu/cortex-m3/drv/clock_sam3.c +++ b/bertos/cpu/cortex-m3/drv/clock_sam3.c @@ -38,6 +38,7 @@ #include "clock_sam3.h" #include #include +#include #include #include @@ -90,6 +91,9 @@ void clock_init(void) { uint32_t timeout; + /* Set 4 wait states for flash access, needed for higher CPU clock rates */ + EEFC_FMR_R = EEFC_FMR_FWS(3); + // Select external slow clock if (!(SUPC_SR_R & SUPC_SR_OSCSEL)) { -- 2.25.1