Hello all,
i try to execute the Exercise 9 from the Book: "The Insider's Guide to the PHILIPS ARM7-Based Micro-controllers". It is about the External Bus Interface. I followed all the steps that described in Exercise9. This example uses the simulator to demonstrate the external bus interface. The Compiling works, But when the simulator (debugger) starts then it reports:*** error 65: access violation at 0x00000000 : no 'execute/read' permission. i solved the problem (error 65) via the menu Debug/Memory Map. Nevertheless the Micro controller does not start running code from the external Flash device.
could you help me please? Knows anybody where can i find the new version of the exercises source codes i.e for the RealView Compiler version 4?
Thank you.
the Source code is: =====================================================
/*****************************/ /*BLINKY.C: LED /*****************************
#include <stdio.h> #include <LPC22xx.H>
extern void init_serial (void);
void sendhex (int hex) {
if (hex > 9) putchar('A' + (hex - 10));
else putchar('0' + hex); }
void sendstr (char *p) {
while (*p) {
putchar (*p++);
}
void delay (void) {
unsigned int cnt;
unsigned int val;
ADCR |= 0x01000000;
do {
val = ADDR;
} while ((val & 0x80000000) == 0);
ADCR &= ~0x01000000;
val = (val >> 6) & 0x03FF;
sendstr ("\nAIN0 Result = 0x");
sendhex((val >> 8) & 0x0F);
sendhex((val >> 4) & 0x0F);
sendhex (val & 0x0F);
val = (val >> 2) << 12;
for (cnt = 0; cnt < val; cnt++);
int main (void) { unsigned int n;
IODIR1 = 0x00FF0000;
ADCR = 0x002E0401;
init_serial();
while (1) {
for (n = 0x00010000; n <= 0x00800000; n <<= 1) {
/* Blink LED 0, 1, 2, 3, 4, 5, 6, 7 */
IOSET1 = n;
delay();
IOCLR1 = 0x00FF0000;
====== Serial.c ===================================
/************************************************ /* */ /* */ /* SERIAL.C: Low Level Serial Routines */ /**********************************************/ #include <LPC22xx.H>
#define CR 0x0D
void init_serial (void){
PINSEL0 = 0x00050000;
U1LCR = 0x83;
U1DLL = 97;
U1LCR = 0x03;
int putchar (int ch) {
if (ch == '\n') {
while (!(U1LSR & 0x20));
U1THR = CR;
} while (!(U1LSR & 0x20));
return (U1THR = ch);
int getchar (void) {
while (!(U1LSR & 0x01));
return (U1RBR);
} ===================================================
Thanks.