From: aleph Date: Tue, 5 Oct 2010 16:47:01 +0000 (+0000) Subject: sam3n port: set flash wait states before activating fast clock X-Git-Tag: 2.6.0~5^2~106 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=66af65c8ff6d1b939c1f09e063f7df17c8cbd910;p=bertos.git 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 --- 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)) {