Actually, that's a piece of circuit evaluation board (ports with LEDs)
here's a program written in flowcode
compiling reports:
Code: Select all
Target folder: D:\test
Source name: D:\test\test.fcfx
Title:
Description:
Device: ARM.AT91SAM7S.AT91SAM7S256
Generated by: Flowcode v6.0.1.0
Date: Saturday, March 01, 2014 13:24:55
Users: 0
Registered to: 54177102
Licence key: PN3MUR
NOT FOR COMMERCIAL USE
http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 6\compilers\arm\batchfiles\arm7comp.bat "test" "D:\test\"
Launching compiler...
Compilation successful!
Completed compilation, return = 0
Launching the linker/assembler...
C:\Program Files (x86)\Flowcode 6\compilers\arm\batchfiles\arm7link.bat "test" at91sam7s256
D:\test>arm-elf-gcc -mcpu=arm7tdmi -O2 -Wall "C:\PROGRA~2\FLOWCO~1\COMPIL~1\arm\BATCHF~1\..\Global\Cstartup.o" "test".o -lm -aln="test".lst --output "test".elf -nostartfiles -T"C:\PROGRA~2\FLOWCO~1\COMPIL~1\arm\BATCHF~1\..\Global\at91sam7s256-ROM.ld" -L"C:\PROGRA~2\FLOWCO~1\COMPIL~1\arm\BATCHF~1\..\arm-elf\lib" -L"C:\PROGRA~2\FLOWCO~1\COMPIL~1\arm\BATCHF~1\..\lib\gcc\arm-elf\4.0.1"
D:\test>arm-elf-objcopy -O ihex "test".elf "test".hex
D:\test>arm-elf-objcopy -Osrec --srec-forceS3 "test".elf "test".s19
s19 file creation successful!
D:\test>hex2bin "test".hex
hex2bin v1.0.1, Copyright (C) 1999 Jacques Pelletier
Lowest address = 00002000
Highest address = 000059FF
BIN file creation successful!
D:\test>arm-elf-readelf -s "test".elf 1>"test".fkt
ICD file creation successful!
FINISHED
compiled C code:
Code: Select all
//************************************************************************************
//**
//** Source name: D:\test\test.fcfx
//** Title:
//** Description:
//** Device: ARM.AT91SAM7S.AT91SAM7S256
//**
//** Generated by: Flowcode v6.0.1.0
//** Date: Saturday, March 01, 2014 13:24:55
//** Users: 0
//** Registered to: 54177102
//** Licence key: PN3MUR
//**
//**
//** NOT FOR COMMERCIAL USE
//**
//** http://www.matrixmultimedia.com
//**
//************************************************************************************
#define MX_ARM
#define MX_CAL_ARM
#define MX_CLK_SPEED 47923200
//Configuration Start
//Configuration End
#define MCK MX_CLK_SPEED
#define MCKKHz (MCK/1000)
#define MCKMHz ((MCKKHz+500)/1000)
#include <Cstartup_SAM7_FCV4.c>
#include <Board_EB031.h>
#include <arm7io.c>
#include <MX_interrupts.h>
#include <stdlib.h>
#include <OSstubs.c>
int errno;
/*========================================================================*\
Use :Include the type definitions
\*========================================================================*/
#include "C:\Program Files (x86)\Flowcode 6\CAL\internals.c"
/*========================================================================*\
Use :panel
:Variable declarations
:Macro function declarations
\*========================================================================*/
#define FCV_FALSE (0)
#define FCV_TRUE (1)
MX_GLOBAL MX_BOOL FCV_A;
/*========================================================================*\
Use :Include the chip adaption layer
\*========================================================================*/
#include "C:\Program Files (x86)\Flowcode 6\CAL\includes.c"
/*========================================================================*\
Use :panel
:Macro implementations
\*========================================================================*/
/*========================================================================*\
Use :Main
\*========================================================================*/
int main()
{
AT91F_PIO_CfgInput(AT91C_BASE_PIOA, 0xffffffff);
AT91C_BASE_PIOA->PIO_IFER = 0xffffffff;
AT91C_BASE_PIOA->PIO_PPUDR = 0xffffffff;
AT91C_BASE_TCB->TCB_BMR = 0;
InterruptCfg();
// Loop
// Loop: While 1
while (1)
{
// Output
// Output: true -> D0
FCP_SET_BIT(D, 0x01, 0xFE, 0, (FCV_TRUE));
// Delay
// Delay: 500 ms
FCI_DELAYINT_MS(500);
// Output
// Output: false -> D0
FCP_SET_BIT(D, 0x01, 0xFE, 0, (FCV_FALSE));
}
mainendloop: goto mainendloop;
}
/*========================================================================*\
Use :Interrupt
\*========================================================================*/
void FC_Interrupt(unsigned int, unsigned int);
void FC_Interrupt(unsigned int periphID, unsigned int IFlags)
{
}