• AVR Freaks

Hot!Programming dual partition device with ipecmd

Author
vjasinski
Super Member
  • Total Posts : 159
  • Reward points : 0
  • Joined: 2013/04/30 11:48:06
  • Location: Michigan, USA
  • Status: offline
2019/08/14 05:03:12 (permalink)
0

Programming dual partition device with ipecmd

Device: dsPIC33EP64GS504
MPLABX IDE V5.25
MPLABX IPE V5.25
SNAP in circuit debugger / programmer (or PICKit3 or PICKit4)
Windows 7 Pro
I am trying to program this device in dual partition mode using the ipecmd program. I am able to program correctly using the MPLABX IPE GUI, where I must select Dual Partition mode in the Memory Model section. I have tried using PICKit3, PICKit4, and the SNAP, with similar results, i.e. works in the GUI and not using the command line program ipecmd.
The arguments I am using are: "/TPSNAP /P33EP64GS504 /Fhexfilename /M /OL"
I have also tried using earlier version of the IPE and ipecmd, V5.15 for example.
The ipecmd program will program the device if it is configured for Single Partition mode, however I need to use the Dual Partition mode for the boot loader.
The ipecmd program will eventually be invoked during the startup Auto Tester, but I am testing using a batch file to invoke and pause so I can view the output of the program.
Anyone have any thoughts or help?
Thanks,
Vince
 
#1

9 Replies Related Threads

    NorthGuy
    Super Member
    • Total Posts : 5737
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: Programming dual partition device with ipecmd 2019/08/14 05:51:39 (permalink)
    0
    Does your hex file includes FBOOT? The lines for FBOOT would look like this:
     
    :020000040100f9
    :04200000fdff0000e0

     
    If you search your HEX file for ":020000040100f9" and find something, then FBOOT is there and the next line must have its value.
     
    #2
    vjasinski
    Super Member
    • Total Posts : 159
    • Reward points : 0
    • Joined: 2013/04/30 11:48:06
    • Location: Michigan, USA
    • Status: offline
    Re: Programming dual partition device with ipecmd 2019/08/14 07:00:17 (permalink)
    0
    Thanks for the response NorthGuy,
    Yes, the hex file does contain the settings for BTMODE (FBOOT). Here is the configuration bit settings as generated by the IDE configuration bit view.
    // FBOOT
    #pragma config BTMODE = DUAL // Boot Mode Configuration Bits (Device is in Dual Partition mode)

    // FBTSEQ
    #pragma config BSEQ = 0xfff // Relative value defining which partition will be active after device Reset; the partition containing a lower boot number will be active (Enter Hexadecimal value)
    #pragma config IBSEQ = 0x000 // The one's complement of BSEQ; must be calculated by the user and written during device programming. (Enter Hexadecimal value)

    Here is the relevant section of the hex file:
    :020000040100f9
    :04200000feffff00e0
    :00000001FF

    I'm thinking that there should be a command line switch that is equivalent to the Memory Model setting in the GUI.
    When I run ipecmd via a batch file, the output looks like the photo attached. 
    Note that the report does not include any memory areas programmed except "configuration memory".
    If I try to read back what was programmed using the GUI, I must select Memory Mode "Single Partition" or I get an error, which indicates to me that the BTMODE setting was not programmed.

    Attached Image(s)

    #3
    vjasinski
    Super Member
    • Total Posts : 159
    • Reward points : 0
    • Joined: 2013/04/30 11:48:06
    • Location: Michigan, USA
    • Status: offline
    Re: Programming dual partition device with ipecmd 2019/08/14 07:09:26 (permalink)
    0
    In addition, MPLABX V5.25 is able to program the device. Here is a screen shot of the SNAP output:

    Attached Image(s)

    #4
    NorthGuy
    Super Member
    • Total Posts : 5737
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: Programming dual partition device with ipecmd 2019/08/14 07:09:56 (permalink)
    0
    The programmer cannot just program the HEX file. It has to perform special actions to partition the device. Therefore the programmer must be aware of the fact that the chip is to be configured as dual partition. The presence of FBOOT is enough. If the HEX file contains FBOOT set to DUAL, the chip must be partitioned and the HEX file cannot be used in any other way. Therefore, the command line switch would be redundant.
     
    When I was working on dual boot support (which was several years ago), Microchip tools couldn't program the dual boot at all. May be Microchip added the support to GUI but not to CMD interface yet. I would suggest contacting their support to find out.
    #5
    vjasinski
    Super Member
    • Total Posts : 159
    • Reward points : 0
    • Joined: 2013/04/30 11:48:06
    • Location: Michigan, USA
    • Status: offline
    Re: Programming dual partition device with ipecmd 2019/08/14 09:36:44 (permalink)
    0
    Thanks again NorthGuy,
    I will open a ticket on this issue.
    Vince
    #6
    vkalyan
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2016/02/15 22:26:47
    • Location: 0
    • Status: offline
    Re: Programming dual partition device with ipecmd 2019/08/19 09:55:12 (permalink)
    0
    Hi vjasinski,
     
    Can you try the switch /OT and see if it works?
    #7
    vjasinski
    Super Member
    • Total Posts : 159
    • Reward points : 0
    • Joined: 2013/04/30 11:48:06
    • Location: Michigan, USA
    • Status: offline
    Re: Programming dual partition device with ipecmd 2019/08/20 04:33:56 (permalink)
    0
    I had tried the /OT switch, but get the error that it is only available for read/verify, as per the documentation:
    "Applicable for read and verification operations only. To be used only if the device is configured to work in dual-partition mode."
    I have opened a ticket, no action yet.
    #8
    dpjoshi
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2019/09/09 21:14:29
    • Location: 0
    • Status: offline
    Re: Programming dual partition device with ipecmd 2019/09/18 03:48:52 (permalink)
    0
    I am also facing the same issue while downloading the dual partition hex file through IPE CMD. Haven't found any solution yet!
    The hex file contains the FBOOT which looks as below. The hex file gets programmed but the controller fails to start.
    Can someone help?
    :020000040100f9
    :04200000feffff00e0
    :00000001FF

    #9
    NorthGuy
    Super Member
    • Total Posts : 5737
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: Programming dual partition device with ipecmd 2019/09/18 08:23:56 (permalink)
    0
    dpjoshi
    I am also facing the same issue while downloading the dual partition hex file through IPE CMD. Haven't found any solution yet!
    The hex file contains the FBOOT which looks as below. The hex file gets programmed but the controller fails to start.
    Can someone help?
    :020000040100f9
    :04200000feffff00e0
    :00000001FF





    I suggest you enter a Microchip support ticket as the OP did. If they have more tickets on the same issue, they're more likely to fix it.
     
    You can use one of our programmers - https://www.northernsoftware.com/nsdsp/
     
    It'll also save you some time because it programs faster.
     
    Here's the explanation on how we handle dual partitions:
     
    https://www.northernsoftw...p/dspic33ep64gs504.htm
    #10
    Jump to:
    © 2019 APG vNext Commercial Version 4.5