Keil Logo Arm Logo

Access violation at 0xFFFFFFF4

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

Details Message
Read-Only
Author
mohsen Gholami
Posted
30-Apr-2013 07:12 GMT
Toolset
ARM
New! Access violation at 0xFFFFFFF4

Hi,
I am new in ARM programming using keil.I tried to debug a sample code in the keil compiler but I have this error when i pressed f7:
Error 65: access violation at 0xFFFFFFF4.I saw the thread to solve this issue. some body said I should add following line to my ini file:
MAP 0x40000000, 0x40001FFF Read Write

I have done it but the Error 65: access violation at 0xFFFFFFF4 is appeared again.
which place i should be add above code to my ini file ?
my ini code is like this:
BREAKPOINTS]
ShowInfoWin = 1
EnableFlashBP = 2
BPDuringExecution = 0
[CFI]
CFISize = 0x00
CFIAddr = 0x00
[CPU]
OverrideMemMap = 0
AllowSimulation = 1
ScriptFile=""
MAP 0x40000000, 0x40001FFF Read Write
[FLASH]
MinNumBytesFlashDL = 0
SkipProgOnCRCMatch = 1
VerifyDownload = 1
AllowCaching = 1
EnableFlashDL = 2
Override = 0
Device="AD7160"
[GENERAL]
WorkRAMSize = 0x00
WorkRAMAddr = 0x00
[SWO]
SWOLogFile=""
[MEM]
MAP 0x40000000, 0x40001FFF Read Write EXEC
RdOverrideOrMask = 0x00
RdOverrideAndMask = 0xFFFFFFFF
RdOverrideAddr = 0xFFFFFFFF
WrOverrideOrMask = 0x00
WrOverrideAndMask = 0xFFFFFFFF
WrOverrideAddr = 0xFFFFFFFF

What should i do to solve this problem .I would like to debug lines of my code step by step.

I would be grateful if you can answer this question

thanks
Mohsen

Read-Only
Author
Martin Guenther
Posted
30-Apr-2013 07:51 GMT
Toolset
ARM
New! RE: Access violation at 0xFFFFFFF4

Hello mohsen Gholami,

I am assuming you are using uVision simulator to debug code for a Cortex-M device.
As you know do Cortex-M devices fetch the PC at address 0x0 after reset. But some of the Cortex-M devices do not have Flash at address 0x0. In this case the Flash area is remapped to address 0x0.

In Options for Target - Debug - 'Simulator section' CPU DLL you can add "-REMAP" to Parameter.
This will automatically remap the code from the specified Flash area (IROM1) to address 0x00000000.

But be aware that some devices are not simulated and also the address space for the peripherals are not mapped. To map the periperal address space you need an INI file which does this mapping.

Use command MAP.

MAP 0x40000000, 0x40001FFF Read Write // map peripherals

Best Regards,
Martin Guenther

Read-Only
Author
Dear Martinmohsen Gholami
Posted
30-Apr-2013 11:34 GMT
Toolset
ARM
New! RE: Access violation at 0xFFFFFFF4

Dear Martin,
you right,I use lpc1768 from NXP product,I did what you offerd that means I worte -REMAP in cpu DLL Parameter text box and I added following line in the first line of ini file :
MAP 0x40000000,0x40001FFF Read Write But in addition to prior error a new error occurred which name is error 10:syntax error as below:

Load "D:\\M.gholami\\ARM Projects\\Philips\\Keil\\Osciloscope(Programming whit USB bootloader)\\osciloscope.AXF"
Include "D:\\M.gholami\\ARM Projects\\Philips\\Keil\\Osciloscope(Programming whit USB bootloader)\\JLinkSettings.ini"
MAP 0x40000000, 0x40001FFF Read Write
[BREAKPOINTS]
^ *** error 10: Syntax error
*** error 65: access violation at 0xFFFFFFF4 : no 'write' permission

my ini file is:

MAP 0x40000000, 0x40001FFF Read Write
[BREAKPOINTS]
ShowInfoWin = 1
EnableFlashBP = 2
BPDuringExecution = 0
[CFI]
CFISize = 0x00
CFIAddr = 0x00
[CPU]
OverrideMemMap = 0
AllowSimulation = 1
ScriptFile=""
[FLASH]
MinNumBytesFlashDL = 0
SkipProgOnCRCMatch = 1
VerifyDownload = 1
AllowCaching = 1
EnableFlashDL = 2
Override = 0
Device="AD7160"
[GENERAL]
WorkRAMSize = 0x00
WorkRAMAddr = 0x00
[SWO]
SWOLogFile=""
[MEM]
RdOverrideOrMask = 0x00
RdOverrideAndMask = 0xFFFFFFFF
RdOverrideAddr = 0xFFFFFFFF
WrOverrideOrMask = 0x00
WrOverrideAndMask = 0xFFFFFFFF
WrOverrideAddr = 0xFFFFFFFF

I read keil documents but i couldn't solve the issue.Can you give me more help.
Thanks
Mohsen

Read-Only
Author
Martin Guenther
Posted
30-Apr-2013 12:08 GMT
Toolset
ARM
New! RE: Access violation at 0xFFFFFFF4

Hello mohsen Gholami,

it is not so clear to me what you want to do.
Trying to run your application in uVision simulator or trying to debug your application with JLink on a real HW.

I am assuming that you want to run your application in uVision debugger.
You can not use a JLink INI file as an INI file for uVision debugger. uVision expects uVision commands in the INI file and not 'JLink syntax/commands'.

If you are using a LPC1768 and you configured yor uVision project correct than no '-REMAP' is required. LPC1768 and most of its peripherals are simulated.

Please tak a look at Blinky project in folder .\Keil\ARM\Boards\Keil\MCB1700\Blinky.
Target 'Simulator' shows what needs to be done to run this application in uVision simulator.

Best Regards,
Martin Guenther

Read-Only
Author
Dear Martinmohsen Gholami
Posted
30-Apr-2013 13:15 GMT
Toolset
ARM
New! RE: Access violation at 0xFFFFFFF4

Dear Martin,
I found out the mistake.I had changed IROM1 to 0x2000 -0x8000 in order to prevent from deleting my usb boot loader code in flash boot loader segment.So when i was going to debug ,Error 65 was appeared on command window.therefore i changed the IROM1 to 0x0-0x8000 and now every thing is ok and i can debug the code in simulator mode.
Thank you for your all kindly reply.

Read-Only
Author
Dear Martinmohsen Gholami
Posted
30-Apr-2013 12:19 GMT
Toolset
ARM
New! RE: Access violation at 0xFFFFFFF4

I use lpc1768 from NXP product and in simulator mode ,I did what you offered that means I wrote -REMAP in cpu DLL Parameter text box and I added following line in the first line of ini file :

MAP 0x40000000,0x40001FFF Read Write


But in addition to prior error a new error occurred which name is error 10:syntax error as below:


Load "D:\\M.gholami\\ARM Projects\\Philips\\Keil\\Osciloscope(Programming whit USB bootloader)\\osciloscope.AXF"
Include "D:\\M.gholami\\ARM Projects\\Philips\\Keil\\Osciloscope(Programming whit USB bootloader)\\JLinkSettings.ini"
MAP 0x40000000, 0x40001FFF Read Write
[BREAKPOINTS]
^ *** error 10: Syntax error
*** error 65: access violation at 0xFFFFFFF4 : no 'write' permission
my ini file is:

MAP 0x40000000, 0x40001FFF Read Write
[BREAKPOINTS]
ShowInfoWin = 1
EnableFlashBP = 2
BPDuringExecution = 0
[CFI]
CFISize = 0x00
CFIAddr = 0x00
[CPU]
OverrideMemMap = 0
AllowSimulation = 1
ScriptFile=""
[FLASH]
MinNumBytesFlashDL = 0
SkipProgOnCRCMatch = 1
VerifyDownload = 1
AllowCaching = 1
EnableFlashDL = 2
Override = 0
Device="AD7160"
[GENERAL]
WorkRAMSize = 0x00
WorkRAMAddr = 0x00
[SWO]
SWOLogFile=""
[MEM]
RdOverrideOrMask = 0x00
RdOverrideAndMask = 0xFFFFFFFF
RdOverrideAddr = 0xFFFFFFFF
WrOverrideOrMask = 0x00
WrOverrideAndMask = 0xFFFFFFFF
WrOverrideAddr = 0xFFFFFFFF

I can debug my codes simply with jlink but in simulator mode i have errors which i talked about.Please help me more.

Read-Only
Author
Dear Martinmohsen Gholami
Posted
30-Apr-2013 11:58 GMT
Toolset
ARM
New! RE: some body said I should add following line to my ini file

Thanks a lot for your help.wish it will be able to help me

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

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.