Jump to content
Sign in to follow this  
nomad6

Boost C & Icd2 Issue

Recommended Posts

I've got the 6.4 licensed unlimited version of BoostC and I'm trying to use my new ICD2 debugger in an existing circuit/design with a 16f628A target running at 4MHz. I've also got the icd2 header for the 628. I've created a project in MPLab and gotten all of the code to compile and libraries to link just fine.

 

I know that the code is good, (it works in the product) but I can't seem to get my variables to display correctly in MPLab. I'm including <icd2.h> in all of my C files, and putting the nops at Org 0, per the bug description I found on this forum. I'm also setting the linker options -rb 0x0001 and -rt 0x7ff, per the comments in the icd2 header.

 

I can single step my code but when I step over a simple instruction like:

 

index = 0;

 

it shows the variable's value at 0xff before the execution and after as well. The index variable (char @ 0x61). The disassemly code looks good too.

 

Can someone please let me know if there are still MPlab issues with SB? I looked in the manual and didn't see anything other than including icd2.h in my files.

 

Comments, help, guidance? Can someone post a "hello world" example showing everything that needs to be done to get the ICD to work?

 

Thanks,

 

Perry

Share this post


Link to post
Share on other sites
Hi,

 

I just got a response from Micrchip about this issue and they said that its most likely a problem with the COFF file and its a BoostC issue.

 

Perry

It is indeed a problem in Mplab but I found a workaround. It's a bit clumsy, but it works. You have to declare your variables globally then copy from one variable to another. For example:

 

char apples;

char oranges

 

void foo (char);

 

main

{

foo(apples);

}

 

 

void foo (apples)

{

oranges = apples;

Share this post


Link to post
Share on other sites
Hi,

 

I just got a response from Micrchip about this issue and they said that its most likely a problem with the COFF file and its a BoostC issue.

 

Perry

Sorry, my previous post posted too soon. Here's the code for the workaround using global variables:

 

 

 

char apples; //these byte vraiables are declared globally

char oranges;

 

void foo (char); //function prototype for foo()

 

main

{

foo (apples); //foo is called here, apples is passed by value

}

 

void foo (char apples)

{

oranges = apples; //when a watch window displays apples and oranges here

} //oranges will have the correct value passed in apples

//apples will display as garbage

Share this post


Link to post
Share on other sites

Perry and Aegis-tec,

 

Hi,

 

I just got a response from Micrchip about this issue and they said that its most likely a problem with the COFF file and its a BoostC issue.

 

Perry

Do you find that everything works OK if you use MPLABs simualtor, but fails when you use ICD2.

 

Check the addresses of the variables that appear in the watch window, you will probably find that they change when using ICD2 compare to MPLABs simulator.

 

This is my experience, and as such it tends to indicate that the coff file contents are correct and that something funny is going on in MPLABs.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Thanks to Dave and Aegis-tec, I'll give the suggestion of the global variables a try. Its just frustrating that MicroChip will not support or fix this issue. They were less than friendly when I mentioned Source Boost.

 

Thanks again. I wish I would of saved my money and not purchased the ICD 2 device, it was supposed to make life easier, not more complex.

 

Perry

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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  

×
×
  • Create New...