Hello,
I just upgraded to uv 4.21 and after doing this I can't seem to use breakpoints on my project.
(I'm using an LPC1788 development board - Cortex-M3) (I'm using ULINK Pro)
with version 4.20 and the same code I had no problems with breakpoints but now if I have even 1 before I try and run the code I get the following error:
"This target device does not support all the defined breakpoints! Please reduce the number of breakpoints and start again."
If I try and add a breakpoint while the application is running I get:
"Operation not possible while the target device is executing. Please stop the target to perform the operation."
I can stop the execution and step through code but no breakpoints.
Does anyone have any ideas?
Thanks.
M
Ok so I think I see what has changed. While the code has not changed I did move part of the application to external NOR flash and I am running from this flash directly.
I seem to be able to add breakpoints to the code that resides in internal flash but not to the code that resides in the external NOR.
Is this normal operation?
Why would you be able to add breakpoints to the external NOR code?
Thanks
So, lesson learned: don't make two unrelated changes as massive as those (a toolset change, and a memory layout change) in a single fell swoop. Particularly not if you're going to publicly blame the tool maker for the problem ;-P
Do you know what setting a breakpoint actually means, on your target architecture? That's a pretty invasive procedure usually. It's quite possible that the technique involved doesn't extend to memory outside the CPU, e.g. because of a limitation on the address range it can cover, or because it's built into the internal memory bus, and has no access to external memory reads.
Ok I guess. Anyway, I'll disregard your apparent tone and politely let you know that the two changes did not occur at the same time.
Still under version 4.20 we moved to the NOR and we tested fairly extensively all the functionality we have developed running from the NOR but we never used any break points in this time.
I upgraded to 4.21 and again it ran fine. I began continuing development and my breakpoints weren't working. (And I didn't blame the tool I was just stating what I had done to encounter my problem)
So back to the question. I disagree breakpoints shouldn't really be a very invasive addition, particularly with Cortex-M devices. Also from what I thought of Cortex-M3 devices I can't recall any reason why a breakpoint couldn't be at any location in the memory range (after all it does execute from this range).
Do you know that this is the case? Do you know of any links that might shed some light on this?
Thank you for your time.
Regards,
Marc
Which device are you using for your product?
Let's assume it is something like this device:
http://www.keil.com/dd/chip/5722.htm
The LPC1810 accesses external NOR flash via the External Memory Controller (EMC). I assume upon reset your device's EMC is at its default values and not set to talk to NOR flash.
I assume that when the debugger tries to load the breakpoint register with the NOR flash address, it cannot yet access NOR flash, and yields an error.
you could write a debug command
BS 0xAAAA
, where 0xAAAA is the memory location where you NOR flash resides. That way after your EMC is configured by your project, you could quickly set a breakpoint.
Hi Ron,
Thanks for your reply and suggestion.
I'm using an LPC1788 so yes it access the NOR via the EMC.
I initialize the EMC at startup before the call to main as follows:
Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT emc_setup_asm IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =emc_setup_asm BLX R0 LDR R0, =__main BX R0 ENDP
I also (redundantly) configure the EMC via a debug/flash program INI file. In any case even if I wait until after the EMC is properly configured I still can not add a breakpoint. (Note I can see the disassembly of the NOR)
I tried the 'BS 0x800000' command as you suggested but I get the same error messages.
Have you ever encountered this? Am I correct in thinking that I should be able to add breakpoints to the code in external NOR?