Jump to content

Recommended Posts

Arrigo

 

Thanks! Are you planning to put this feature into the include file icd2.h?
I'm not sure how this would work, can you explain?

 

Regards

Dave

Link to post
Share on other sites

When sourceboost compile with the file icd2.h included, it doesn't use the flash memory reserved for the specific processor (i.e. 16f913 form 0xf00 to 0xfff).

Arrigo

 

Arrigo

 

Thanks! Are you planning to put this feature into the include file icd2.h?
I'm not sure how this would work, can you explain?

 

Regards

Dave

Link to post
Share on other sites

Arrigo,

 

When sourceboost compile with the file icd2.h included, it doesn't use the flash memory reserved for the specific processor (i.e. 16f913 form 0xf00 to 0xfff).

 

You are correct with this statement.

 

To reserve the ROM you would need to use the linker -rt ( ROM Top address) command line option to set the max ROM address that can be used.

Linker allocate memory from the bottom up, so this is the last memory it will try and use, even if -rt is not specified.

 

There is no mechanism (at the moment) to allow this imformation to be passed from a source file through to linker.

 

An alternative method might be to add:

    #pragma DATA 0xF00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
   #pragma DATA 0xF08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
   ....
   #pragma DATA 0xFF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
   #pragma DATA 0xFF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF

 

This would then generate a memory overlap warning if code memory overwrites this area. I'm not sure what will happen when you come to program the device, it maybe that programming will fail as this area can't be written to.

 

Let me know if this helps, as this could easily be easily be added to the icd2.h header file.

 

Regards

Dave

Link to post
Share on other sites

Hi,

 

I'm having a similar problem. When I include the ICD2.h file it compiles fine and seems to program ok, however when the ICD2 resets and attempts to enter the debug executive it throws an error indicating it couldn't write to memory.

 

I'm guessing this has to do with the ROM top mentioned above. How do you calculate what the ROM top value should be?

 

Thanks,

Matt.

Link to post
Share on other sites

It works but it was better if the icd2.h includes this features!

Arrigo

 

Arrigo,

 

When sourceboost compile with the file icd2.h included, it doesn't use the flash memory reserved for the specific processor (i.e. 16f913 form 0xf00 to 0xfff).

 

You are correct with this statement.

 

To reserve the ROM you would need to use the linker -rt ( ROM Top address) command line option to set the max ROM address that can be used.

Linker allocate memory from the bottom up, so this is the last memory it will try and use, even if -rt is not specified.

 

There is no mechanism (at the moment) to allow this imformation to be passed from a source file through to linker.

 

An alternative method might be to add:

    #pragma DATA 0xF00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
   #pragma DATA 0xF08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
   ....
   #pragma DATA 0xFF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
   #pragma DATA 0xFF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF

 

This would then generate a memory overlap warning if code memory overwrites this area. I'm not sure what will happen when you come to program the device, it maybe that programming will fail as this area can't be written to.

 

Let me know if this helps, as this could easily be easily be added to the icd2.h header file.

 

Regards

Dave

Link to post
Share on other sites

When I try this, it compiles and links, but after programming I get the following errors (i'm using a 16F876A):

 

MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0xFFF)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
Verifying...
...Program Memory
...Debug Executive
...Debug Vector
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
Connecting to debug executive
...Programming succeeded
MPLAB ICD 2 Ready
Resetting Target
MPLAB ICD 2 Ready
Setting Breakpoint
ICD0098: Unable to allocate memory.
ICD0082: Failed MPLAB ICD 2 operation
ICD0069: Unable to run target
ICD0082: Failed MPLAB ICD 2 operation
ICD0082: Failed MPLAB ICD 2 operation
ICD0082: Failed MPLAB ICD 2 operation
ICD0082: Failed MPLAB ICD 2 operation
MPLAB ICD 2 Ready

 

I've included icd2.h and reserved 0xf00 - 0xfff. Any thoughts on what else I should add?

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