We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi!
First I have to say everything worked fine till now!
Now I get the error: "cannot access memory"
When debugging a sample project like "Blinky" I get the error when starting, but debugging seems to work fine.
When debugging my own project it depends on the CPU Speed (PLL Multiplier) if debugging works or not. But everytime I get the error "cannot access memory"!!
So my question is if the ulink2 or the mcbstm32 causes the problem?
best regards Mathias
To isolate the error I did following:
* Tried different projects => same error * Changed the developement board => same error * Tried it on a different pc => same error
So my conclusion is that the uLink2 must be the problem!
Strangely enough the uLink2 gets correctly detected in uVison 4 (ULINK Cortex Debugger Settings)! Additional the firmware update to V1.4 finished without errors!
I have tried to connect with all posibilities (JTAG, SW, different connect & reset options) but everytime I get the same error!
The only thing which seems to be strange is that the uLink2 is installed under Human Interface Devices with following 2 entries: *HID-compliant device *USB Human Interface Device
=> Reinstalling the driver results in the same entries!
My Toolchain is up to date:
IDE-Version: µVision V4.00u Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2009
Tool Version Numbers: Toolchain: RealView MDK-ARM Version: 4.03a Middleware: RL-ARM Real-Time Library Version V4.05 Toolchain Path: BIN40\ C Compiler: Armcc.Exe V4.0.0.524 Assembler: Armasm.Exe V4.0.0.524 Linker/Locator: ArmLink.Exe V4.0.0.524 Librarian: ArmAr.Exe V4.0.0.524 Hex Converter: FromElf.Exe V4.0.0.524 CPU DLL: SARMCM3.DLL V4.03a Dialog DLL: DARMSTM.DLL V1.45b Target DLL: BIN\UL2CM3.DLL V1.62 Dialog DLL: TARMSTM.DLL V1.43
Best regards Mathias
Dear Mathias,
which address is displayed in the output window together with the error: "cannot access memory"? Please check "uVision -> Options for Target -> Debug -> Settings" if "Download to Flash" is enabled. If this is the case, disable it and try again.
Regards Alex
There is now address displayed together with the error!
This is posted in my output window when starting debugging Blinky:
Load "C:\\APPL\\Keil\\ARM\\Boards\\Keil\\MCBSTM32\\Blinky\\Obj\\Blinky.AXF" BS \Blinky\86 BS Write USART2_DR == 0x5a, 1 BS \Blinky\107 Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory Cannot access Memory
Download to flash is disabled!
Is it the uLink2 correct installed under Human Interface Devices with following 2 entries: *HID-compliant device *USB Human Interface Device
??
the ULINK2 is installed correctly as HID device. So no worries because it seems debugging works in general, right?
The problem is that we have in the project setting configured memory window 2 which should display address 0x10000000. Despite that Memory window 2 is not enabled (shown in this example) uVision will still read it contents.
To rectify just open the Memory window 2 and clear the address filed (and close the memory window 2) and close the project so that the settings are saved.
Once the project is reopened the problem will go away.
Hope this will help!
Dear Alexander!
Thx for your help!
You were right memory window 2 was opened with the address 0x10000000, but clearing the address field and closing the memory window 2 didn't help.
Additionally debugging this or all other projects worked fine in the past, so I don't think this can be the failure!
Well it seems debugging works, but as I said not with every xtal Speed and in some projects not correctly...
I just ordered another uLink2 and will report you here if it solved the problem!
I think I will send my uLink2 back to Keil!
Regards Mathias
have you closed uVision and reopened it again after removing the address in the memory window 2?? This is required! I don't know which MDK-ARM Tool Chain version you are using but maybe this could be a problem in uVision itself...
Regarding the other problem with your ULINK2 please contact support.intl@keil.com before sending your ULINK2 back to Keil!
Dear Alexander,
yes I have restarted uVision4!
I updated MDK-ARM from 4.02 to 4.03a:
Thx I will get in contact with support!
Try the following:
- go to the Blinky example for MCBSTM32 in folder \Keil\ARM\Boards\Keil\MCBSTM32\Blinky and open the Blinky.Opt file with a text editor
- remove lines with text "OPTMM 2,8,(0x10000000)" (should exist 3 times) and save the file
- open the Blinky project in uVision and start the debug session and check if you still get the error message "Cannot access Memory"
@ Robert: OPTMM Lines didn't exist, I think this is a result of deactivating Memory Window 2?
Today I got a second ulink2 but surprisingly I got the same error! So it was clear that there must be an error in the project settings!
After checking I saw that memory window 1 was also initialised with 0x10000000! After deactivating or changing it to 0x8000000 it seemed to work because there were no Error messages left!
But there was another problem, which I described above: The debugger failed when initialising the PLL with a multiplier of 9 to get 72MHz but worked with a multiplier of 3!
I compared my project with Blinky and found out that in my project I didn't enable "Embedded Flash Configuration" in STM32_Init.c!
After enabling everything works fine!
But why do I have to enable this for a higher PLL multiplier?
So the solutions for my problem is following:
* disable memory windows or initialise them with correct values (0x8000000 instead of 0x10000000)
* enable "Embedded Flash Configuration" in STM32_Init.c
Thanks for your help!