Jump to content
amohr

Debugger Doesn't Support Reading Flash!

Recommended Posts

SourceBoost 6.15

Target: 16F877

 

I have code similar to the following:

 

#pragma DATA 0x1600, 1,1, 0x183,0, 36,1, 0,0x204,0

 

and a function called read_flash like so:

unsigned short read_flash(unsigned short addr) {

unsigned short value;

 

clear_bit(intcon, GIE);

 

eeadrh = addr >> 8;

eeadr = addr & 0xff;

set_bit(eecon1, EEPGD);

set_bit(eecon1, RD);

 

nop();

nop();

 

value = eedath;

value <<= 8;

value |= eedata;

 

set_bit(intcon, GIE);

 

return value;

}

 

but the data from the #pragma data section never gets read. Is there any way to fix this? It's really hindering debugging.

 

Thanks so much,

 

- Alex

Edited by amohr

Share this post


Link to post
Share on other sites
SourceBoost 6.15

Target: 16F877

 

I have code similar to the following:

 

#pragma DATA 0x1600, 1,1, 0x183,0, 36,1, 0,0x204,0

 

 

 

- Alex

 

When I put that #pragma into a program and look at the program memory the data is placed correctly at 0x1600 so you might want to check your read_flash() function, ensure you are using it's return value correclty, and also ensure you are programing that section of the program memory to the device.

 

Darren J.

Share this post


Link to post
Share on other sites

the code IS going in the memory, and I can see in the debugger that the address registers are getting set correctly, but neither eedath nor eedata are getting set by the debugger.

 

I know for a fact that my read_flash routine is correct because it's already being used in a shipping product with C2C 5.06e

Share this post


Link to post
Share on other sites

amohr,

 

the code IS going in the memory, and I can see in the debugger that the address registers are getting set correctly, but neither eedath nor eedata are getting set by the debugger.

 

The simulator does not current support access to program memory using the EEPROM access registers, also EEDATH and EEADRH are not supported :(

 

Regards

Dave

Share this post


Link to post
Share on other sites

well could you please add support? It's supported in MPLab + it's fairly crucial and causes *much* grief not having it.

 

Thanks,

 

- Alex

Share this post


Link to post
Share on other sites

do you understand the difference between debugging c source and debugging asm source?

 

apparently not. anyways, I did use it, and found my problem. It should definitely be noted somewhere that this debugger doesn't support simulating the ee registers.

Share this post


Link to post
Share on other sites
do you understand the difference between debugging c source and debugging asm source?

 

apparently not.  anyways, I did use it, and found my problem.  It should definitely be noted somewhere that this debugger doesn't support simulating the ee registers.

 

yup i do, infact i debug simple win32 c programs using the asm output of the compiler.

 

anyhow, if u did use mplab then why is this bug / non feature cause u problems. I just ran ur code with no problems.

 

No disrepect to picant guys, but the mplab enviroment is much better than the sourceboost ide for debugging. You can go from SIM to ICD without having to port the project to mplab format. I only wish you could get ICD2 to work with sourceboost ide :( lol.

Share this post


Link to post
Share on other sites

I have 1000 lines of C code, and >1K of EEprom data, I don't want to have to step through that much ASM 1) trying to figure out how the compiler guy thinks, and 2) to eventually find my bug. No mainstream developer debugs in asm by default in any standard size project.

 

small c projects are just toys, not applications you're actually trying to do work on.

Share this post


Link to post
Share on other sites

amohr,

I have 1000 lines of C code, and >1K of EEprom data, I don't want to have to step through that much ASM 1) trying to figure out how the compiler guy thinks, and 2) to eventually find my bug. No mainstream developer debugs in asm by default in any standard size project.

 

You can integrate BoostC in MPLABs.

Then you can compile you code in MPLABs, and use ICD2 with source level debugging under MPLABs.

 

Regards

Dave

Share this post


Link to post
Share on other sites
You can integrate BoostC in MPLABs.

Then you can compile you code in MPLABs, and use ICD2 with source level debugging under MPLABs.

 

Can you explain a little bit more in detail how to proceed?

This seems to be really interesting....

 

Walter

Share this post


Link to post
Share on other sites

Walter,

 

You can integrate BoostC in MPLABs.

Then you can compile you code in MPLABs, and use ICD2 with source level debugging under MPLABs.

 

Can you explain a little bit more in detail how to proceed?

This seems to be really interesting....

 

Walter

 

Have a look in the BoostC help file under "BoostC Compiler MPLAB Integration".

 

Regards

Dave

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...

×
×
  • Create New...