public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Davies, Greg" <Greg.Davies@Ultra-UEMS.com>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Changing flash wait state on SAM7
Date: Mon, 07 Apr 2008 17:13:00 -0000	[thread overview]
Message-ID: <20080407171019.GC3552@lunn.ch> (raw)
In-Reply-To: <A25DBA3B0717824BAFD61F81242D5DBD011B906D@exchange.Ultra-UEMS.ca>

On Mon, Apr 07, 2008 at 01:34:58PM -0300, Davies, Greg wrote:
> I've been having some strange memory issues that I've been talking about
> in the "eCos causing something.. Maybe?" thread. Basically I was seeing
> random values when I did a dump of any section of memory. The BDI folks
> suggested I change the flash wait state. I did this and the problem went
> away. 
> 
> I now have an issue similar to this while trying to debug. I can see
> that the first 3 instructions set the flash wait state to 1 (by writing
> 0x100 to 0xffffff60), but I need it to be 3. This seems to be in a
> function called reset_vector (or at least that's what gdb calls it). I
> tried changing what looked like the same code (but called
> __flash_init__) in
> packages\hal\arm\at91\at91sam7s\current\include\hal_platform_setup.h,
> and I rebuilt everything, but when I loaded on the new code, it still
> wrote the same value. Am I changing the flash wait state in the right
> spot?

Yes, but the dependencies don't always work for this. Delete
install/lib/vectors.o and recompile.

What how fast are you clocking your device? 

// Macro to initialise the Memory Controller
        .macro _flash_init
__flash_init__:
#if CYGNUM_HAL_ARM_AT91_CLOCK_SPEED > 30000000
        // When the clock is running faster than 30MHz we need a wait state
        ldr     r0,=AT91_MC
        ldr     r1,=(AT91_MC_FMR_1FWS)
        str     r1,[r0,#AT91_MC_FMR]
#endif
#if CYGNUM_HAL_ARM_AT91_CLOCK_SPEED > 60000000
        ldr     r1,=(AT91_MC_FMR_2FWS)
        str     r1,[r0,#AT91_MC_FMR]
#endif
        .endm


       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2008-04-07 17:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 16:43 Davies, Greg
2008-04-07 17:13 ` Andrew Lunn [this message]
2008-04-07 23:14 ` Andrew Lunn
2008-04-08  7:03   ` Tom Deconinck
2008-04-08  7:54     ` Andrew Lunn
2008-04-08  8:16       ` Jürgen Lambrecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080407171019.GC3552@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Greg.Davies@Ultra-UEMS.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).