This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ROM startup on EP7212


Hi Fano,

>checked in the ROM startup, set the EP7212 processor variant,
>ticked the box "Hardware serial device drivers".
>Then I've build the .bin  using "arm-elf-objcopy -O binary..."
>and downloaded it on the board using "dl_edb7.exe".

Does the DIAG LED come on when you hit the wakeup button?

If so, try to compile this little example (just paste it over hello.c). 
Connect a loudspeaker to position LS2 on the board. If you hear a beep out 
of it, then the code is running and getting to main() OK.

I think the most likely problem is that console output isn't going anywhere 
(it's being sent to a nonexistent debugger).

#include <cyg/kernel/kapi.h>
#include <cyg/hal/hal_edb7xxx.h>

/*
         Wiggle the buzzer output bit with specified period and duration
         Both period and duration are in arbitrary units based on processor
         speed and Icache enabled/disabled state.
         For the EP7212 at 74MHz, a typical value for a system beep would be
         period = 100, duration = 500. Duration for such a system is 
calibrated to
         be VERY ROUGHLY 1u=0.5ms.
*/
void BUZZ_SimpleBeep(int period, int duration)
{
         volatile cyg_uint32 *p = (volatile cyg_uint32 *) SYSCON1;
         volatile int i;

         // This just makes the input values of period and duration more 
reasonable
         duration = duration * 1000;
         period = period * 10;

         while (duration) {
                 *p |= SYSCON1_BZTOG;
                 for (i=0;i<period;i++) { }
                 *p &= ~SYSCON1_BZTOG;
                 for (i=0;i<period;i++) { }

                 if (duration < period)
                         duration = 0;
                 else
                         duration -= period;
         }
}

int main(void) {
BUZZ_SimpleBeep(100,500);
}
=== Lewin A.R.W. Edwards (Embedded Engineer)
Work: http://www.digi-frame.com/
Personal: http://www.zws.com/ and http://www.larwe.com/

"Und setzet ihr nicht das Leben ein,
Nie wird euch das Leben gewonnen sein."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]