software breakpoints

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

software breakpoints

2,084 Views
Eric_t
Contributor III

Hi everybody

 

Currently I am using HCS12 controllers. Debugging is extremely difficult due to limitations of software breakpoints (two hardware breakpoints is not enough for a source code of 256KB). I am thinking of using another freescale controller that supports software breakpoints in flash.

Can anyone tell me which controller supports software breakpoints in flash? (S08, RS08, HCSX12, Coldfire V1, Coldfire V2, Kinetis).

Thanks

Nikos 

Labels (1)
0 Kudos
11 Replies

1,209 Views
kef
Specialist I

Software breakpoints are used when debugging in RAM using some kind of serial monitor. It is done replacing instruction at breakpoin location with SWI, TRAP, or other instruction that triggers some interrupt. Interrupt handler then doesn't allow to exit until you tell debugger to continue execution. S12 is also suitable for this.

 

Though on S12(X) you have only up 2 or 3 hardware breakpoints (I'm not sure about new families, they could have more), you are not limited on the amount of BGND instructions you can add to your code. Just add

  

asm BGND; 

 

  or

  

asm("BGND");

   

to stop execution and pass control to BDM debugger.

0 Kudos

1,209 Views
Eric_t
Contributor III

Software breakpoint "asm BGND" must be placed in compliler IDE.

This is (almost) useless.

Software breakpoints should be able to be placed in debugger IDE. 

Do you know any freescale controller able to accept software breakpoints in its debugger IDE?

 

Thanks

Nikos 

0 Kudos

1,209 Views
kef
Specialist I

As far as I know software breakpoints are possible only when debugging in RAM. This is useable only to debug small programs that fit onchip RAM. And this why hardware breakpoints appeared. Since you can't toggle flash bits to often or quickly, there's dedicated breakpoints hardware, which compares address, data and bus control pins if they match requested address. That's additional cost, so you see just 2 or 3 BPs. 3 BPs like on S12C is sufficient. For difficult cases you may add BGND's.

 

0 Kudos

1,209 Views
Eric_t
Contributor III

Placing breakpoints in compiler IDE instead of debugger IDE slows down the whole process.

I am wondering why  freescale does not solve this problem just like all ther companies.

There is no reasons to stay on freescale controllers.

Since I cannot afford to buy an emulator, I am going to switch to NEC or PIC controllers.

0 Kudos

1,209 Views
kef
Specialist I

Hm, I wonder about example of one of those all other companies that have no limits of breakpoints in flash? You mentioned PIC. It is long time I haven't used their debuggers, but ICD2 debugger user guide for PIC18F has this notice:

 

  • Note: For most devices, only one breakpoint will be set (active) at the time, although you may specify more than one breakpoint in the breakpoint dialog (i.e., one breakpoint will be active and the others will be inactive.)

 http://ww1.microchip.com/downloads/en/devicedoc/51331b.pdf

 

 

So it is even worse. Only one breakpoint. S12XE is much and much more better than this: 4 address breakpoints, 2 data breakpoints.

You may claim it all is wrong and useles without 100 breakpoints, but each breakpoints means not only extra hardware and perhaps extra costs, but also higher energy consumption. Yes, 2 BP's is quite annoying, but 3 is enough for most of debugging tasks.

Yes, they could make debugger to allow software BPs in flash. It could be done stopping target, erasing 512 or 1024 bytes sector, reflashing setor with breakpoint instruction set.  Old days, when flash was specified to survive 100 or 1000 program/erase cycles, it would be not feasible. But with 100-1000k cycles in modern flash, why not?

0 Kudos

1,209 Views
Eric_t
Contributor III

ICD2 is an old debugger that has been replaced by ICD3. ICD2 supports only hardware breakpoints and it is toooo slow on debugging. I guess that you have bad experience with ICD2.

 

Indeed the oldest PIC18 do not support software breakpoints and some of them have only one hardware breakpoint, but the newer PICs support 4 hardware breakpoints and unlimited number of software breakpoints. Also PIC32 support 8 hardware breakpoint (6 for address, 2 for data).

 

Still I cannot understand why freescale does not solve this problem.

    

 

 

0 Kudos

1,209 Views
kef
Specialist I

So how it is done on new PIC's? Are they reflashing parts of program to set or remove software breakpoints? Try making Service Request and requesting this feature to be added.

  

I think it is possible to do cmd file and set SW BPs in flash issuing cmd file from Command window. I would try do it already if I saw real need in zilion of breakpoints.

 

0 Kudos

1,209 Views
bigmac
Specialist III

Hello,

 

It would appear that some PIC devices, for ICD operation, require that a "debugger executive program" is loaded to "executive program space" by the debugger.  This is a 2KB RAM block that is accessible by the debugger interface only.

 

I have not delved into the finer detail - when the code within this space is run, in lieu of the application code.  However, I guess it may be conceivable that some of the memory could be used to "mirror" sections of application code, for the implementation of software breakpoints held by the ICD program.  Such a process would probably be significantly slower than "real time".

 

Regards,

Mac

 

0 Kudos

1,209 Views
kef
Specialist I

I googled for microchip software breakpoints and that pointed to ICD3 manual. They have following note

 

  • Using software breakpoints for debug impacts device endurance. Therefore,
  • it is recommended that devices used in this manner not be used asproduction parts.

Impact on device endurance makes me assuming that they are reflashing breakpoint locations with instructions like SWI or BGND. Makes sense for modern flash wtih >=100k erase/program cycles.

 

Remappable breakpoints RAM wouldn't allow to set unlimited number of breakpoints, also RAM is quite expensive to dedicate it for debugging purposes only. As fas as I know debuggers executive was loaded to flash since ICD v1.

0 Kudos

1,209 Views
Eric_t
Contributor III

I have made a requst to freescale support about the software breakpoints.

 

My request:

 

           Currently I am using HCS12 controllers. Debugging is extremely difficult due to limitations of software breakpoints

           (two hardware breakpoints is not enough for a source code of 256KB). 

           Software breakpoint "asm BGND" must be placed in compliler IDE.
           This is (almost) useless.
           Software breakpoints should be able to be placed in debugger IDE. 

           Is it possible to add this feature to the near future?

          Is there any freescale controller that is able to accept software breakpoints in debugger IDE instead of compiler IDE?  

freescale responce:

 

            When use P&E BDM MULTILINK the number of hardware breakpoints is limited by hardware. Depending to the       

            chip you are using, you are limited of the number of Hardware breakpoints(1, 2, 3, ...).

            You are correct so far the only workaround is to use software breakpoint (just insert BGND instruction into your code

            where you want to stop (asm {BGND} ). it has to be done in compiler IDE. 

 

           Anyway, I must thank for your propose this feature request. I will escalate it to PM. I will let you know as soon as this

           feature request is entered into DOORs.

 

 

 

0 Kudos

1,209 Views
Eric_t
Contributor III

I do not know how the new PIC implement software breakpoints.

 

I have already made a requst to freescale support for this issue.

 

I you find some kind of solution for SW BPs, please post it. I think that all freescale users will appreciate it .

0 Kudos