Discussion Forum

error 65:

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Darren Venables
Posted
22-Oct-2008 10:57 GMT
Toolset
ARM
New! error 65:

My background is primarily Windows development and I know very little about embedded development so I hope someone can explain what is causing my problem.

I am using the Keil compiler in uVision3 and am trying to simulate an NXP LPC2468.

My program is very basic :P ...

int main()
{
        return 0;
}

But when the simulator starts I receive this in the output window:

*** error 65: access violation at 0xA0033000 : no 'read' permission

This happens in LPC2400.s at the LDR instruction on line 1308...

  LDR     R4, =NORMAL_CMD           ; Write NORMAL Command
  STR     R4, [R0, #EMC_DYN_CTRL_OFS]

I could map this region using the instruction's here
http://www.keil.com/support/docs/814.htm

but, shouldn't the code work anyway straight out of the box?

Read-Only
Author
Christoph Franck
Posted
22-Oct-2008 11:18 GMT
Toolset
ARM
New! RE: error 65:
int main()
{
        return 0;
}

Ok, think about this: If this was a Windows program, what happens at the "return 0;" line? The program returns to ... Windows.

Now, on a microcontroller, there is no Windows to return to. Generally, there is no operating system for main() to return to. The processor "returns "to "somewhere" in the address space and happily starts executing whatever "instructions" it finds there. These are completely undefined and will, of course, lead to undefined behavior.

Read-Only
Author
Darren Venables
Posted
22-Oct-2008 11:28 GMT
Toolset
ARM
New! RE: error 65:

The problem is the access violation occurs on startup in the assembler code provided by Keil a significant time before reaching this rather useless main function. :(

Read-Only
Author
Tamir Michael
Posted
22-Oct-2008 11:24 GMT
Toolset
ARM
New! RE: error 65:

the outcome of your code is compiler specific; some compiler will generate code that behaves like Christoph said; others will reset your controller.

try this:

void main(void)
{
  while (1) ;
}
Read-Only
Author
Darren Venables
Posted
22-Oct-2008 11:36 GMT
Toolset
ARM
New! RE: error 65:

Your code is closer to what I will need Tamir so have tried your suggestions (since that's more like the main I need) but it's still stops in the assembler code before getting to the main function.

I thought I could simply select a chip and be on my way, have I missed out a crucial step somewhere?

Read-Only
Author
Per Westermark
Posted
22-Oct-2008 12:21 GMT
Toolset
ARM
New! RE: error 65:

Do you have the latest version of the development tools, since the processor is quite new - maybe your version can't simulate all peripherials.

Read-Only
Author
Darren Venables
Posted
22-Oct-2008 12:29 GMT
Toolset
ARM
New! RE: error 65:

Yes, I think I am fully up to date.

uVision3 - v3.63
Toolchain - Realview MDK-ARM V3.24

Compiler and linker version (armcc.exe etc) is V3.1.0.939

Read-Only
Author
Darren Venables
Posted
22-Oct-2008 12:48 GMT
Toolset
ARM
New! RE: error 65:

My program now works as intended. Yay!

In the configuration settings tree I expanded "External Memory Controller Setup (EMC)" and unchecked "Dynamic Memory Interface Setup"

Thanks for your help folks, I can now start fleshing out my main function. :)

Next Thread | Thread List | Previous Thread Start a Thread | Settings