Jump to content
Sign in to follow this  
trossin

Unable To Debug Mpasm Projects In Version6.96

Recommended Posts

I wiped my disk of SourceBoost and MPLAB and did a fresh install of MPLAB v8.43 and SourceBoost v6.96 and found no way to simulate an MPASM project. The default settings in the tool selection dialog box do not work and there is no documentation to describe how to set this up. The error message I get is Can't load file 'Myproj.cod'.

 

I've previously got this to work with trial and error of settings such that MPASM is run with this command line when I press the old English font A button:

 

c:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe /pPIC18F4620 /q /aINHX32 /rDEC /t3 /x B1802_18F.asm

 

If I uninstall version 6.96 of SourceBoost and install version 6.89, I'm almost able to debug an MPASM project if I run the mp2cod utility in the MPASM directory. I'm able to simulate and look at the PIC state but I'm unable to look at symbols. The hover and watch windows do not work.

 

If I wipe my SourceBoost and MPASM and install version 7.31 of MPLAB and version 6.89 of SourceBoost everything works fine as the old version of MPASM produces a cod file in a format the this older version of SourceBoost decodes.

 

If I wipe my SourceBoost and install version 6.96, then I get the Can't load file 'Myproj.cod' error and am unable to simulate.

 

In summary:

Sourcboost MPLAB Results

------------------------------------------------------------

6.89 7.31 Perfect system that works with plugins

6.89 8.43 Requires running mp2cod tool. Works except no symbolic debugging

6.96 7.31 Can't load file 'Myproj.cod' error (Unusable)

6.96 8.43 Can't load file 'Myproj.cod' error (Unusable)

 

 

I uploaded my project here: http://forum.sourceboost.com/index.php?sho...amp;#entry16726

 

There is more info about experiments that I have tried and the results.

 

I'm plugging along on 6.89 and 7.31 for now but would like to upgrade one day. I also would like to share my work with others and turn them on to this great product but can not as if they download the latest tools my project will not work for them.

Share this post


Link to post
Share on other sites
...

Sourcboost MPLAB Results

------------------------------------------------------------

6.89 7.31 Perfect system that works with plugins

6.89 8.43 Requires running mp2cod tool. Works except no symbolic debugging

6.96 7.31 Can't load file 'Myproj.cod' error (Unusable)

6.96 8.43 Can't load file 'Myproj.cod' error (Unusable)

 

Thanks for checking into this, support for COD file was dropped in favour of COF in the SourceBoost debugger as COD had so many limitations. MPASM output passed through MPLINK can generate a COF file. But when I tried this SourceBoost debugger would not load the resulting file - I haven't found out why yet. This item is now on our todo list.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Any update on when this might get fixed? I just downloaded Version 6.97 Beta and it still is unable to load the cof file.

 

I used this command to create the common object file format file from the object file produced by MPASM:

 

"c:/program files/Microchip/MPASM Suite"/mplink /p 16f877a /o BAsm.cof BAsm.O

 

It produced a .cof and a .hex file.

Share this post


Link to post
Share on other sites
Any update on when this might get fixed? I just downloaded Version 6.97 Beta and it still is unable to load the cof file.

 

I used this command to create the common object file format file from the object file produced by MPASM:

 

"c:/program files/Microchip/MPASM Suite"/mplink /p 16f877a /o BAsm.cof BAsm.O

 

It produced a .cof and a .hex file.

This has not been forgotten (well not yet). Microchip change the magic number in their coff file as it has some changes. Need to determine what has change and see what's needed to make it work.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Is there a work-around possible such as putting my entire project in an asm section in main? I seem to recall that the boost assembler/linker has some limitations from having to deal with C code. Maybe there is a way to work around this as well.

 

One of my popular projects (a logic analyzer in a PIC) uses lots of MPASM macro loops. Another (CDP1802 microprocessor emulator) is just a bunch of code but it does require code to be placed in certain locations in memory for it to work.

 

Is it possible to add an option to SourceBoost to deal with direct assembly so that it does not need to be tied to Microchip?

Share this post


Link to post
Share on other sites

It has been 7 months since I submitted this basic functionality bug and there is still no work-around. Is this feature dead? If so, you should remove it from your web site feature list:

Compilers/Assemblers supported:

 

 

Also, if this will not be fixed it is a deal breaker for upgrading to version 7.0 for me. I would like to send money when 7.0 is available but I just can't live without simulating assembler projects.

Share this post


Link to post
Share on other sites

I posted on this subject a while back on the Microchip forum [here]:

. . . .grab MPASMWIN V5.20 from [here], unzip it into the new sub-directory MPASM inside the Sourceboost IDE program directory and set the Sourceboost IDE assembler command line (select assembler as the toolsuite then you will find it in options) to: MPASM\MPASMWIN.EXE /aINHX8M /p%target% /rHEX /w2 /q which I am currently using successfully with the V6.95 IDE.

 

Try it. The work-around should be acceptable until It can be fixed in an early V7.x.

 

While we are on the subject the Hitech PICC toolsuite is also broken for similar reasons. It passes obsolete options to the compiler that currently available versions do not understand. As a result, I cannot even build PICC programs under the SourceBoost IDE, let alone debug them. :-(

Share this post


Link to post
Share on other sites

I broke down and tried the version 5.2 MPASM with SourceBoost version 6.97 but this does not solve the problem for me. I still get the can't load cof file message.

 

This is a deal breaker for me in sending money for Version 7.0 as well as porting my plugins to 7.0.

 

It has been overy 10 months since I reported this basic functionality bug. I have not tried the free version of 7.0 because I don't want my license to get messed up but I would guess that it still does not work. Has anyone tried to assemble and debug an MPASM project this is using 7.0 and a recent version of MPLAB's MPASM?

 

It sure would be nice to get this working.

Share this post


Link to post
Share on other sites

trossin,

I broke down and tried the version 5.2 MPASM with SourceBoost version 6.97 but this does not solve the problem for me. I still get the can't load cof file message.

 

This is a deal breaker for me in sending money for Version 7.0 as well as porting my plugins to 7.0.

 

It has been overy 10 months since I reported this basic functionality bug. I have not tried the free version of 7.0 because I don't want my license to get messed up but I would guess that it still does not work. Has anyone tried to assemble and debug an MPASM project this is using 7.0 and a recent version of MPLAB's MPASM?

 

It sure would be nice to get this working.

You are right it would be nice to get it working, in fact my apologies that we haven't already. Microchip changed the format of their cof files, the change is not a trivial one.

Eventually this will work, but not many people complain so this is lower on our list of priorities.

 

Regards

Dave

Share this post


Link to post
Share on other sites

While debugging is this badly broken I find it difficult to reccomend SourceBoost to others. In fact I also regard it as a 'dealbreaker'.

 

Getting MPASM and 3rd party toolsuites working again under the SourceBoost IDE and also sorting out the GPIO plugin problem (maybe by aliaiasing GPIO to PORTA?) should be given a MUCH higher priority as your IDE's interoperability with Microchip's language suites and the quality of the MPLAB integration of your Boost.... language suits has been a major factor in me recommending SourceBoost over other third party development enviroments that lock you in to therir software and even hardware to a far greater extent.

 

While you are looking at that, we desperately need a cleaner way of mixing MPASM assembler and Boost.... code. Its probably not worth chasing the 'export to MPLINK compatible format' goal, but surely you can devise some way of translating MPASM output automatically for linking with a Boost..... project. If the formats are truely completely incompatible, please look at adding a 'tweaked' version of GPASM to your 'stable' of toolsuites so we can write MPASM compatible code and link it with other Boost.... languages.

 

Regards

Ian

Share this post


Link to post
Share on other sites

Hello,

 

I own a source boost V6.97 Professional version.

I was satisfied till source boost became un-compatible with MPlab IDE.

 

I wait a little time to get this solved, before a good solution I will not buy V7.

If it takes to long I will look for another compiler.

 

I have spend money on Microchip tools like ICD2 and Pickit 3, and also want to use MP Sim.

My programming skills are not that good so I can't work without good De-bugging tools.

 

It is sad that such a good product as source boost, becomes unusable so fast.

Also sad that the support is not as expected.

If it is such a minor problem, why is it not fixed yet?

And will there be a fix for V6, or only for V7, or not at all?

 

well so far my complains, before this problem it was a good compiler for a reasonable price.

 

Good luck solving this problem!

Share this post


Link to post
Share on other sites

Thanks for all the feedback. I have a feeling that either I miss something or some posters greatly exaggerated the problem. Let me state the problem as I understand it and correct me if I'm wrong:

 

SourceBoost IDE can not debug code built with recent MPASM. Other than this SourceBoost IDE has same functionality as it has before + a number new features introduced in version 7.

 

If that's the case I don't understand statements like "becomes unusable so fast" and "it was a good compiler". What exactly becomes unusable and how MPASM code debugging is related to compilers?

 

We do work on this issue and hopefully will have a fix. Based on the feedback from this thread we also should re-arrange our priorities a bit. Meanwhile please use a well known workaround: use MPLAB to debug your assembly code.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Thanks for all the feedback. I have a feeling that either I miss something or some posters greatly exaggerated the problem. Let me state the problem as I understand it and correct me if I'm wrong:

 

SourceBoost IDE can not debug code built with recent MPASM. Other than this SourceBoost IDE has same functionality as it has before + a number new features introduced in version 7.

 

If that's the case I don't understand statements like "becomes unusable so fast" and "it was a good compiler". What exactly becomes unusable and how MPASM code debugging is related to compilers?

 

We do work on this issue and hopefully will have a fix. Based on the feedback from this thread we also should re-arrange our priorities a bit. Meanwhile please use a well known workaround: use MPLAB to debug your assembly code.

 

Regards,

Pavel

Any chance of a 'quick fix' for the V6.97 and V7 IDEs based on installing the MPASM V5.20 I linked to in post#8? At least I could then reccomend your IDE again to people struggling with MPASM code and the MPLAB simulator. Your graphical plugin based debugger, although not as capable 'out the box' as the MPLAB one with scripting in SCL, is far easier for a novice or occasional user (or who cant afford the other graphical alternative - Proteus) to get to grips with and is far more stable. Once they are using the SourceBoost IDE it is obviously going to be easier to persuade them to try the Boost... languages, and hopefully get their wallets out.

 

I'm also begging for an update on the PICC Lite toolsuite interface (or has that been fixed since V6.95?) I would really like to be able to program baseline PICS in C *WITHOUT* having to suffer with MPLAB!

 

Meanwhile, my development enviroment is 'frozen' at V6.95 so I dont break the MPASM debugging, :( My participation in the forums here is down by an order of magnitude inspite of this forum's ease of use and the many problems with the Microchip forum and I am strangely silent about the advantages of BoostC in my many posts over there. :huh:

Edited by IanM

Share this post


Link to post
Share on other sites

Sorry,

 

I have to say sorry that I complained.

My mistake was a lack of knowledge how to use the MPLAB IDE (not the Source boost IDE).

 

Software: Mplab sim used in MPLAB IDE 8.60, in combination with Source boost V6.97 Compiler and Linker.

The Source boost Compiler and linker work without problems in the MPLAB IDE.

My problem was with MPLAB IDE, I made some mistakes in the configuration of MPLAB IDE.

 

In short, lack of knowledge, too emotional, too fast with complaining on the forum.

Next time I sleep a night before I post a commend.

 

Sorry for my posting, it had nothing to do with the Source boost IDE problems mentioned by other people in this post.

 

Lieuwe

Share this post


Link to post
Share on other sites

Pavel said: "SourceBoost IDE can not debug code built with recent MPASM"

 

I claim that the V6.97 does not work with any version of MPASM. I had no luck with the MPASM 5.2. From the previous reply, I'm pretty sure that is the case since the debugger now uses a different COFF version or slightly tweaked non-standard format.

 

For me, the value of the SourceBoost IDE is the ability to use custom plugins that I can create specific to the problem I'm trying to solve. Sometimes, microcontroller projects require lots of hand tuned assembly or blocks of it. Since the SourceBoost C compilier support for assembly is limited, I and others have to resort to full assembly projects. Going to MPLAB does not give me all the SourceBoost nor my own tools that I have been hooked on.

 

Thanks for others chiming in on this as I thought I was the only one in need of this support.

Share this post


Link to post
Share on other sites

Ok. It is nearly a year since I posted this bug and I don't expect it to get fixed so I started playing around with the Microchip C18 compiler. I'll be honest. It is a piece of crap. I ported a project from SourceBoost C and it took twice the memory and generated bad code. You have to make all your variables globals to get reasonable code and then you have to use unions to convert bytes to ints unless you want to do a bunch of type casting which then creates horrible code.

 

Tmp = (a<<8) | b; // Tmp is an unsigned short, a and b are unsigned char will not generate valid code.

Tmp = ((unsigned short)a<<8) | b; // produces 20 bytes of code (10 instructions) countless more if locals

 

Your product is superior but I can't upgrade due to the cod file problem.

 

I'm to the point where I'm thinking of trying to write a converter that converts MPASM output to the file format that SourceBoost wants. The MPASM coff file is documented and I have written an assembler that generates COFF before so I think I can figure it out with a bit of trial and error. The file expected by SourceBoost is mystery to me and would require a good deal reverse engineering. If the file spec was available to me it might motivate me more to work on this task.

Share this post


Link to post
Share on other sites

Sorry for delay, we didn't realise the desperation of some users for this to be fixed.

 

This problem has now been fixed and will be available in SourceBoost V7.02 package, soon to be released.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Alright. I have not purchashed 7.x yet as I was not able to debug an assembler project on 7.02. So I broke down and tried 7.04 today with a fresh tiny assembler project. I've included how things went below. The bottom line is that I have v8.60 of the MPLAB suite installed on my machine and I am unable to build an assembler project so I can't try to debug it.

 

It seems to me that the default settings in the SourceBoost IDE should be updated to point to the current default install path for MPLAB. Also, it seems that the build flow does not pick up the path to MPASMWIN.EXE and use it for finding the linker and other tools including the link control file. I am unable to find a way to change the path to the linker and other tools. They seem to just expect them to be in c:\.

 

Does anyone have any hints on how to get this to work? I would like to move forward but I'm stuck with V6.89 and an old version of Microchip's assembler tucked away in a special location.

 

Thanks for any help.

Ted.

 

1st Assembly: Settings->Options then Tools tab to see default Assembler is: C:\PROGRA~1\MPLABI~1\MCHIP_~1\MPASMWIN.EXE /aINHX8M /p%target% /rHEX /w2 /q

 

Assembling...

 

C:\PROGRA~1\MPLABI~1\MCHIP_~1\MPASMWIN.EXE /aINHX8M /pPIC16F628 /rHEX /w2 /q /pPIC16F628 /q /eDebug\asmsimp3.err /lDebug\asmsimp3.lst /oDebug\asmsimp3.O /xDebug\asmsimp3.ref AsmSimp.asm && C:\PROGRA~1\MPLABI~1\MCHIP_~1\MPLINK.EXE /oDebug\asmsimp3.cof Debug\asmsimp3.O 16F628_g.lkr && C:\PROGRA~1\MPLABI~1\MCHIP_~1\MP2HEX.EXE Debug\asmsimp3.cof

 

Failed to spawn (C:\PROGRA~1\MPLABI~1\MCHIP_~1\MPASMWIN.EXE /aINHX8M /pPIC16F628 /rHEX /w2 /q /pPIC16F628 /q /eDebug\asmsimp3.err /lDebug\asmsimp3.lst /oDebug\asmsimp3.O /xDebug\asmsimp3.ref AsmSimp.asm). Check if path to this external application is correct.

Failed to locate output file 'C:\PicProjects\AsmSimp3\Debug\asmsimp3.hex'

Done

 

Failed

 

 

2nd try: Change Settings->Options then Tools tab to set Assembler: to "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.EXE /aINHX8M /p%target% /rHEX /w2 /q"

 

Assembling...

 

c:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe /aINHX8M /pPIC16F628 /rHEX /w2 /q /pPIC16F628 /q /eDebug\asmsmp2.err /lDebug\asmsmp2.lst /oDebug\asmsmp2.O /xDebug\asmsmp2.ref AsmSimp.asm && c:\MPLINK.EXE /oDebug\asmsmp2.cof Debug\asmsmp2.O 16F628_g.lkr && c:\MP2HEX.EXE Debug\asmsmp2.cof

 

Failed to spawn (c:\MPLINK.EXE /oDebug\asmsmp2.cof Debug\asmsmp2.O 16F628_g.lkr). Check if path to this external application is correct.

Failed to locate output file 'C:\PicProjects\AsmSimp2\Debug\asmsmp2.hex'

Done

 

 

Copy C:\Program Files\Microchip\MPASM Suite\mplink.exe and mp2hex.exe to c:\

Assembling...

 

C:\Program Files\Microchip\MPASM Suite\MPASMWIN.EXE /aINHX8M /pPIC16F628 /rHEX /w2 /q /pPIC16F628 /q /eDebug\asmsimp3.err /lDebug\asmsimp3.lst /oDebug\asmsimp3.O /xDebug\asmsimp3.ref AsmSimp.asm && C:\MPLINK.EXE /oDebug\asmsimp3.cof Debug\asmsimp3.O 16F628_g.lkr && C:\MP2HEX.EXE Debug\asmsimp3.cof

 

Error spawning _mplink.exe

MP2HEX 4.37, COFF to HEX File Converter

Copyright © 1998-2010 Microchip Technology Inc.

Error - Could not open Coff file 'Debug\asmsimp3.cof' for reading.

Errors : 1

 

Failed to locate output file 'C:\PicProjects\AsmSimp3\Debug\asmsimp3.hex'

Done

 

Copy C:\Program Files\Microchip\MPASM Suite\_mplink.exe to c:\

Assembling...

 

C:\Program Files\Microchip\MPASM Suite\MPASMWIN.EXE /aINHX8M /pPIC16F628 /rHEX /w2 /q /pPIC16F628 /q /eDebug\asmsimp3.err /lDebug\asmsimp3.lst /oDebug\asmsimp3.O /xDebug\asmsimp3.ref AsmSimp.asm && C:\MPLINK.EXE /oDebug\asmsimp3.cof Debug\asmsimp3.O 16F628_g.lkr && C:\MP2HEX.EXE Debug\asmsimp3.cof

 

MPLINK 4.37, Linker

Copyright © 1998-2010 Microchip Technology Inc.

Error - Could not find linker command file'16F628_g.lkr'.

Errors : 1

 

MP2HEX 4.37, COFF to HEX File Converter

Copyright © 1998-2010 Microchip Technology Inc.

Error - Could not open Coff file 'Debug\asmsimp3.cof' for reading.

Errors : 1

 

Failed to locate output file 'C:\PicProjects\AsmSimp3\Debug\asmsimp3.hex'

Done

 

Copy C:\Program Files\Microchip\MPASM Suite\LKR\16f628_g.lkr to c:\

Assembling...

 

C:\Program Files\Microchip\MPASM Suite\MPASMWIN.EXE /aINHX8M /pPIC16F628 /rHEX /w2 /q /pPIC16F628 /q /eDebug\asmsimp3.err /lDebug\asmsimp3.lst /oDebug\asmsimp3.O /xDebug\asmsimp3.ref AsmSimp.asm && C:\MPLINK.EXE /oDebug\asmsimp3.cof Debug\asmsimp3.O 16F628_g.lkr && C:\MP2HEX.EXE Debug\asmsimp3.cof

 

MPLINK 4.37, Linker

Copyright © 1998-2010 Microchip Technology Inc.

Error - Error reading object file 'Debug\asmsimp3.O'

Errors : 1

 

MP2HEX 4.37, COFF to HEX File Converter

Copyright © 1998-2010 Microchip Technology Inc.

Error - Could not open Coff file 'Debug\asmsimp3.cof' for reading.

Errors : 1

 

Failed to locate output file 'C:\PicProjects\AsmSimp3\Debug\asmsimp3.hex'

Error[121] C:\PICPROJECTS\ASMSIMP3\ASMSIMP.ASM 1 : Illegal label (iCop)

Done

 

Failed

Share this post


Link to post
Share on other sites

trossin,

Alright. I have not purchashed 7.x yet as I was not able to debug an assembler project on 7.02. So I broke down and tried 7.04 today with a fresh tiny assembler project. I've included how things went below. The bottom line is that I have v8.60 of the MPLAB suite installed on my machine and I am unable to build an assembler project so I can't try to debug it.
Very dissappointing :(

 

I'm not seeing quite the same issue as you. The different maybe the way you are specifying the path to the MPASM. I browsed using the "." button on the tools dialog box so my path is a shortened version eg "C:\PROGRA~2\MICROC~1\MPASMS~1\MPASMWIN.exe" and contains no spaces. Please try setting the path using the "." button and let us know what happens.

 

Irrespective of that I still could not link the code because the target type is not specified in the mplink command line. Looks like Microchip have changes there command line arguments to MPLINK so that it needs to know the target device, and we have not kept up.

 

Work Around

As a work around i created a batch file to do the assembly, linking and conversion to hex file. The batch file I placed in the project folder. This batch file can't be invoked by placing it in the assembler command line because this some other stuff other than just assembling, ie it also invokes mplink and mp2hex. BTW I tried this with MPLAB V8.66.

 

I invoke this batch file by placing the command line to it in used this in the Setting->Options->Tools-> Programmer.

So to initiate an assembly I have to push the "P" button on the tool bar instead of the "A" button. After the assembly is complete you can enter the debugger as normal.

 

Attached is my batch file.

I hope that helps.

 

Regards

Dave

assemble.zip

Share this post


Link to post
Share on other sites

Thanks Dave. I'll admit that I did not try your script but instead just used the ... button to the right of the Assembler path and just navigated to MPASMWIN and gave it a go without adding all my icky flags. It all worked fine!

 

I was able to assemble my little test program and I was able to use the debugger. I've only done a little bit of testing but it seems to work except that when I hold the mouse over a variable in the souce window it always says the current value is zero. If I add the symbol to the watch window, it has the correct value. This seems to be a minor problem.

 

For example:

movlw 2

movwf Count

clrf TMR0

 

When the execution pointer is on clrf TMR0 I put the mouse pointer over Count and it will say that Count is 0x0. If I add Count to the watch window it will say 2.

 

This seems to work fine for a 16F628. I also tried an 18F project and it seems to work like a charm. I just need to see if I can program a part with the hex file produced and port my plugins and I'm set.

 

Sorry to be a dummy user and setting the flags manually. I think that is where I blew it. I needed to do that in version 6 but now that is a no no.

 

Thanks for getting this fixed. I really appreciate it!

 

Ted.

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×