Dear Forum,
I have purchased a Kickstart development board from IAR, LPC2378-SK-01,I have written a program for toggling a pin on the board using IAR IDE.I am new to the ARM Development.My program is as follows:
#include <iolpc2378.h>
#include <inarm.h>
#include <stdio.h>
#include <intrinsics.h>
#include "io_macros.h"
void Delay(unsigned int);
/*************************************************************************
* Function Name: irq_handler
* Parameters: none
*
* Return: none
*
* Description: IRQ handler
*
*************************************************************************/
// IRQ exception handler. Calls the interrupt handlers.
__irq __arm void irq_handler(void)
{
void (*interrupt_function)();
unsigned int vector;
vector = VICADDRESS; // Get interrupt vector.
interrupt_function = (void(*)())vector;
(*interrupt_function)(); // Call vectored interrupt function.
VICADDRESS = 0; // Clear interrupt in Vector Interrut Controller.
} //IRQ end
void main()
{
while(1)
{
__disable_interrupt(); //First disable interrupts.
PINSEL4_bit.P2_0 = 0;
IO0DIR = 0x00000001;
IO0SET = 0x00000001;
Delay(2000);
IO0CLR = 0x00000001;
Delay(2000);
__enable_interrupt();
}
}
void Delay(unsigned int data)
{
unsigned int i;
for(i=0;i<data;i++);
}
I have written this program in release mode.But when I am making and debugging it using the simulator or when downloading the program using J-link to flash, there is a message on the debug log as:
***************************************************************
Wed Jun 04 11:38:39 2008: Download completed.
Wed Jun 04 11:38:39 2008: Loaded debugee: D:\DEVELOPMENT PROGRAMS\Release\Exe\test_program.hex
Wed Jun 04 11:38:39 2008: Target reset
Wed Jun 04 11:38:39 2008: Error (col 1): Unknown or ambiguous symbol. main
Wed Jun 04 11:38:39 2008: Couldn't go to 'main'.
**********************************************************
Kindly sort out my problem........
Rajesh Mahapatra
I have purchased a Kickstart development board from IAR, LPC2378-SK-01,I have written a program for toggling a pin on the board using IAR IDE.I am new to the ARM Development.My program is as follows:
#include <iolpc2378.h>
#include <inarm.h>
#include <stdio.h>
#include <intrinsics.h>
#include "io_macros.h"
void Delay(unsigned int);
/*************************************************************************
* Function Name: irq_handler
* Parameters: none
*
* Return: none
*
* Description: IRQ handler
*
*************************************************************************/
// IRQ exception handler. Calls the interrupt handlers.
__irq __arm void irq_handler(void)
{
void (*interrupt_function)();
unsigned int vector;
vector = VICADDRESS; // Get interrupt vector.
interrupt_function = (void(*)())vector;
(*interrupt_function)(); // Call vectored interrupt function.
VICADDRESS = 0; // Clear interrupt in Vector Interrut Controller.
} //IRQ end
void main()
{
while(1)
{
__disable_interrupt(); //First disable interrupts.
PINSEL4_bit.P2_0 = 0;
IO0DIR = 0x00000001;
IO0SET = 0x00000001;
Delay(2000);
IO0CLR = 0x00000001;
Delay(2000);
__enable_interrupt();
}
}
void Delay(unsigned int data)
{
unsigned int i;
for(i=0;i<data;i++);
}
I have written this program in release mode.But when I am making and debugging it using the simulator or when downloading the program using J-link to flash, there is a message on the debug log as:
***************************************************************
Wed Jun 04 11:38:39 2008: Download completed.
Wed Jun 04 11:38:39 2008: Loaded debugee: D:\DEVELOPMENT PROGRAMS\Release\Exe\test_program.hex
Wed Jun 04 11:38:39 2008: Target reset
Wed Jun 04 11:38:39 2008: Error (col 1): Unknown or ambiguous symbol. main
Wed Jun 04 11:38:39 2008: Couldn't go to 'main'.
**********************************************************
Kindly sort out my problem........
Rajesh Mahapatra