[SOLVED] J-Link Base sets debug bit for PIC32 microcontroller

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] J-Link Base sets debug bit for PIC32 microcontroller

    Hello,

    I've programmed device via ICSP by J-Link Base.
    My application requires checking flash crc. When I program uC with J-Link there are differences in read contents of flash memory (I compare generated hex file with read one).

    When I read flash memory by MPLAB X IDE from uC programmed by J-Link, MPLAB X IDE shows warning like in attached file (j-link_debug_warning.PNG).
    I noticed that while programming via J-Link Commander it shows: "Programming data would disable ICSP debugging. Modified data to enable ICSP.".
    How can I stop setting Debug Bit while programming with J-link?

    I also attach statement from J-Link Commander.

    Best regards,
    Patryk
    Images
    • j-link_debug_warning.PNG

      9.79 kB, 757×163, viewed 401 times
    • j_link_comm.PNG

      50.26 kB, 1,226×668, viewed 668 times
  • Hello Patryk,

    Thank you for your inquiry.
    The debug bit must stay enabled otherwise the ICSP debug interface will be shut down.
    If you program the application with debug bit off without J-Link or MPLAB recovering it you can't access the target device afterwards.
    So no verify or CRC check is possible anymore as target connection is not possible.
    That is why J-Link and MPLAB save this bit so you can still access your chip after programming.
    The difference is that MPLAB offers the option to edit the debug bit with the warning message so a verify would not fail.
    However this can't be easily implemented for J-Link as this would break compatibility to all other 9000 devices we are supporting.
    As a workaround we suggest not using the J-Link internal verify option but to do it manually with an external program.
    So you would read back the application, edit the debug bit yourself and then do the CRC check.
    This can also be done using our J-Link SDK: segger.com/products/debug-prob…nk/technology/j-link-sdk/
    There you can write your own application that does this automatically.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    Thank you for your reply. I think that I not accurately describe the problem. So I write it more understandable:

    MPLABX IDE has got 2 different builds configurations:

    1st - debug - where it sets debug bit in configuration words and adds additional debug functions into the hex file.

    2nd - production - where all the debugging capabilities are disabled.

    When I use MPLABX (IDE or IPE) with Real ICE to write and read the production build, the hex file stays the same, as intended. But when I use J-Link Commander or J-Flash Light with J-Link probe to write exactly the same production build hex file, the applications sets debug bit in configuration words. So when I read content of flash memory and compare it with original hex they are not the same.

    For my device the content of flash memory must stay exactly the same as generated hex file, because the device makes flash memory CRC auto checks and compares results with value stored in flash memory, which was calculated basing on the production hex file.

    So if I correctly understood your reply:

    J-Link debug probes may not be used to write the production hex file into the flash memory of PIC32 without changing it contains?

    Best regards,

    Patryk
  • Hello Patryk,

    OK, so you are looking for a production utility for PIC32.

    Giteh wrote:

    J-Link debug probes may not be used to write the production hex file into the flash memory of PIC32 without changing it contains?

    Currently we do not offer such feature to keep the debug bit disabled. Due to low demand for these devices there are no plans to add this feature right now.
    However we could squeeze it in if your interest is high enough but in that case NREs would apply.
    Would that be an option for you?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.