[coldfire-gnu-discuss] How to access FLASHBAR?

Nathan Sidwell nathan at codesourcery.com
Thu Sep 30 15:07:13 UTC 2010


On 09/30/10 16:00, m8847 wrote:
>
> Hi,
>
> I am trying to get my flash programming to work. I have copied the
> functions to RAM, but I need to clear the WP bit in FLASHBAR in order to
> program.
>
> I tried something like this from within a C function;
>      asm( "move.l   #0x21,d0" );
>      asm( "movec    %d0,0xC04" );

I think something like

    __asm__ volatile ("movec %0,FLASHBAR" : : "r"(0x21));

will do what you want.  You may need %% before FLASHBAR, I'm not sure.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery




More information about the coldfire-gnu-discuss mailing list