• AVR Freaks

Hot!MPLABX v4.15 MDB.bat Exception

Author
jm2morri
Starting Member
  • Total Posts : 62
  • Reward points : 0
  • Joined: 2006/01/05 09:42:46
  • Status: offline
2018/06/01 06:04:19 (permalink)
0

MPLABX v4.15 MDB.bat Exception

Hello everyone,
 
I'm trying to get ceedling to work with an MPLABX project.  Working through the issues but now I've hit one that I can't solve.  The process is supposed to be compiling the project (using XC32) and then loading the output into the Microchip simulator using MDB.bat.
 
However, I get an exception when I run it and the process fails out.  There a ruby script that runs the debugger and passes it a file that contains the list of commands to run in the simulator.  To help debug, I simply ran the simulator from the Windows PowerShell and then hand-entered each command.  I get the exact same error.  Here is the session details....
 
PS C:\Users\james\Downloads\Ceedling-PIC32-master\firmware\build\test\out> mdb

>device PIC32MX250F128B


>hwtool sim
Exception in thread "Thread-2" com.microchip.mplab.comm.MPLABCommException: Socket not available (already in use, lack of permissions, non-existent, etc)
        at com.microchip.mplab.comm.MPLABCommUSBMonitor.run(MPLABCommUSBMonitor.java:517)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at com.microchip.mplab.comm.MPLABCommUSBMonitor.run(MPLABCommUSBMonitor.java:502)
        ... 1 more
Jun 01, 2018 8:56:10 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.


Resetting SFRs
Resetting peripherals


>
Microchip, what does that all mean?  I'm dead in the water until I can get the command line access to the simulator working.
 
James.
#1

7 Replies Related Threads

    jm2morri
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2006/01/05 09:42:46
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2018/06/01 08:06:04 (permalink)
    0
    Seeing the "lack of permissions" in the error message, I was thinking that maybe I need to run this "as administrator"?  I'm on Windows 10, don't think I mentioned that.
     
    So I ran powershell as administrator and then ran mdb from that -- same result
     
    Then I used the following command line which _I think_ runs mdb as admistrator: "Start-Process mdb -Verb runAS" -- same result
     
    Anyone have any other thoughts about what is going on?
     
    James.
    #2
    jm2morri
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2006/01/05 09:42:46
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2018/06/01 08:43:57 (permalink)
    0
    A very similar issue being reported for other software:
     
    https://stackoverflow.com/questions/16428098/groovy-shell-warning-could-not-open-create-prefs-root-node
     
    Basically, there weren't permissions to add a registry key and that caused the problem. I manually added the keys suggested here but the issue remains.
    #3
    jm2morri
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2006/01/05 09:42:46
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2018/06/01 09:03:48 (permalink)
    0
    Just to close this off.  I added both keys in the link in the post above.  Initially it didn't change.  I then rebooted and now the simulator doesn't crash.  So on to the next step of the test-driven development setup....
     
    James.
    #4
    GeorgePauley
    Moderator
    • Total Posts : 1172
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2018/06/01 09:05:50 (permalink)
    0
    If I understand correctly, you are attempting to run mdb.bat from ruby?  "hwtool sim" should not be causing this exception, and no other mdb users are reporting this.  Can you invoke mdb.bat directly from the command line and execute the two commands ("device PIC32MX250F128B" and "hwtool sim") from the command line?  If they work then mdb and ruby are conflicting with each other in some mysterious way.  If they don't work then ... well I don't know what!  mr green: mr green
    #5
    jm2morri
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2006/01/05 09:42:46
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2018/06/01 09:17:12 (permalink)
    0
    And thanks to forum user crespum for the help he offered off-line for this issue....
    #6
    jm2morri
    Starting Member
    • Total Posts : 62
    • Reward points : 0
    • Joined: 2006/01/05 09:42:46
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2018/06/01 09:19:01 (permalink)
    0
    George, I posted followups, doing exactly what you suggested.  And it turns out the simulator was crashing because of a Java permission issue and I could reproduce it without having anything to do with ceedling or any of the automation I am trying to put together.  I've documented the solution above....
     
    #7
    SinCitiesSin
    Junior Member
    • Total Posts : 94
    • Reward points : 0
    • Joined: 2016/11/15 08:12:41
    • Location: 0
    • Status: offline
    Re: MPLABX v4.15 MDB.bat Exception 2019/10/16 11:52:19 (permalink)
    0
    jm2morri I am trying to do something similar. Can you share your sim_test_fixture.rb and sim_instructions.txt files? I can not get the ruby script to open MDB
    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5