Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
Hardware Breakpoints using ICD16Z and USB Multilink Universal FX for HC16
Zaphod B. Oct 27, 2016 at 09:14 AM (09:14 hours)
Staff: Johnny N.

  • We are trying to use the USB Multilink Universal FX for HC16 and ICD16Z to set breakpoints. However, we always get one of two error messages when using either the br command or right clicking and selecting "Toggle breakpoint at cursor" :

    Could not write breakpoint to hardware.

    OR

    Could not write software breakpoint to memory (Address=$000XXXXX)

    For now, all we want to do is set a hardware breakpoint. How do we set a hardware breakpoint? Does the ICD16Z with the Multilink use the single hardware breakpoint for stepping?

    Thanks!




    Comments

    • Hello Zaphod,

      When using our ICD16Z debugger, the ability to set hardware breakpoints is only possible if the MCU is equipped with an onchip hardware breakpoint module. My understanding is that many HC16 MCus are not.

      1) What device are you trying to debug?

      2) have you confirmed the existence of a hardware breakpoint in the reference manual and/or datasheet?

      If hardware breakpoints are not possible, you can load debug your code out of RAM and use software breakpoints.

      Regards,
      Johnny
      PEmicro Engineering Support

      • Hi Johnny, Thanks for the response. I just realized I didn't reply to your comment so I'm replying again.

        1. We are using the MC68HC16Z1.
        2. I have confirmed from the datasheet that it does have one hardware breakpoint.

        How can we use this HW breakpoint?

        Also, in ICD16Z how can we see memory regions (configured with chip selects) that are beyond $FFFFF? For example if we have a device at $F80000?

        Thanks for your help.

        • Zaphod,

          The MC68HC16Z1 doesn't have any hardware breakpoint registers but it does have a BKPT pin that can halt the processor and enter debug mode. If you run your application in our ICD16Z and then hit any key to stop the program, what the debugger is actually doing is toggling this pin. The problem with this method is you are not stopping exactly where you want.

          You have a few options to debug:

          1) Insert the BKPT instructions before the code where you want the MCU to be halted, recompile the program, and then reprogram it. Then go into ICD, run the code, and eventually it will stop once it hits where the BKPTs are inserted. This will allow you to debug out of flash.

          2) You can move your application to RAM and then ICD can set software breakpoints anywhere in your code.

          Regards,
          Johnny
          P&E Engineering Support

          • In ICD16Z, how can we see memory regions (configured with chip selects) that are beyond $FFFFF? For example if we have a memory device at $F80000?

            Thanks!

            • Zaphod,

              You have to set up the chip select registers so the memory region becomes accessible to ICD16Z. Are you able to read or program your memory in our PROG16Z software already? If you can then we need to translate the algorithm that you used in PROG16Z to a script that ICD can understand and execute to setup the registers in the same way.

              Since we will likely need to start attaching some files and this forum doesn't provide a simple way to do that, can you file a ticket through our Support Requests System. Go to Support tab - > Support Requests - > Report a product bug or problem.

              Regards,
              Johnny
              P&E

              • Johnny,
                The memory is a RAM device so I am not using PROG16Z. If the chip select registers are set in ICD16Z for a base address of $F80000 how do I view this memory space?

                If I run ">dump F80000" then ICD16Z reports "First parameter unrecognizable or invalid." All I want to do is read this memory in ICD16Z. Are there certain steps I need to do when debugging to shut off chip selects or tell ICD16Z that I have devices mapped outside the first 1MB?

                Thanks for any suggestions.

                Zaphod

                • Zaphod

                  Please right click on one of the Memory Windows and change the address to F80000. Is the memory region viewable there? If you don't see your data there or it is all XX"s, then you didn't set it up correctly yet.

                  Can you send us your code that initializes this memory?

                  -Johnny
                  PEmicro

                  • Johnny,
                    When I right click in the Disassembly window, choose "Set Base Address", and enter F80000 then the window displays memory at 80000. If I try it in a memory window, I get "Memory Window: Parameter out of range".

                    Is this something that I have to fix in code?

                    Zaphod

  • Johnny,
    When I right click in the Disassembly window, choose "Set Base Address", and enter F80000 then the window displays memory at 80000. If I try it in a memory window, I get "Memory Window: Parameter out of range".

    Is this something that I have to fix in code?

    Zaphod

    • Can you send us the section of your code that initializes this external RAM device?

Add comment


   Want to comment? Please login or create a new PEMicro account.







© 2017 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement