Jump to content
Sign in to follow this  
rlang

Boostc18/ide Problem

Recommended Posts

Bug description:

Faulty TDF file causes linkage failure for 18F2455-18F4550 chips Compiler Version 1.7 Alpha (for PIC18 architecture)

 

Steps to reproduce:

1.) Create a new project for 18F4550

2.) Add a main.c file to the project with the following code

#include <system.h> //pic definition files required by boostc
void main()
{
//BUFFER REGISTERS
//NAMING CONVENTION bdNstatDP  where 
//N is endpoint# = 0,1,2,3
//D is direction=i,o (in,out) 
//P is pingpong=e,o  (even,odd)
char bd1statie@0x410;
bd1statie=0;
}

3.) Compile and link the project using BoostC Compiler Version 1.7 Alpha

BoostC Optimizing C Compiler Version 1.7 Alpha (for PIC18 architecture)
success
BoostLink Optimizing Linker Version 1.7 Alpha
Failed to allocate fixed var:bd1statie at address:0x00000410
Failed
Exit code was -1.  [No error.]

Expected behavior:

successful linkage, one should be able to access USB buffer descriptors and data in the range 400-7ff

 

Is the problem 100% reproducible:

Yes

SourceBoost version: 5.7

Compiler: BoostC

Compiler version: Compiler Version 1.7 Alpha (for PIC18 architecture)

OS: Windows 98

Comments:

The fix appears to be addition to the 18f2455,2550,4455,4550.tdf as follows:

//USB RAM
RegisterGP[ 100h ]
{
   // block of general purpose memory
   Description = "USB RAM","";
   Address = 400h;
}
RegisterGP[ 100h ]
{
   // block of general purpose memory
   Description = "USB RAM","";
   Address = 500h;
}
RegisterGP[ 100h ]
{
 // block of general purpose memory
   Description = "USB RAM","";
   Address = 600h;
}
RegisterGP[ 100h ]
{
   // block of general purpose memory
   Description = "USB RAM","";
   Address = 700h;
}

Share this post


Link to post
Share on other sites

rlang,

 

Unless this memory is memory that linker should use as general purpose memory, ie can be used for allocation of variables, then it needs to be declared as special function registers:

 

//USB RAM

RegisterSF[ 100h ]

{

// block of memory reserved for use with USB

Description = "USB RAM","";

Address = 400h;

}

etc

 

Regards

Dave

Share this post


Link to post
Share on other sites

Dave wrote

Unless this memory is memory that linker should use as general purpose memory, ie can be used for allocation of variables, then it needs to be declared as special function registers:

 

For the 18F4550, chip banks0-3 are defined as user data in the microchip specification. Bank 15 is defined as SPRs. Banks 4-7 are defined as USB data or User data.

The user can set up usb buffer descriptions and buffers in this area. Whatever is not needed for USB can be used for any purpose. From your note I am not clear whether banks 4-7 should be general or special function. Any guidance is appreciated.

 

Rob

Share this post


Link to post
Share on other sites

rlang,

 

For the 18F4550, chip banks0-3 are defined as user data in the microchip specification. Bank 15 is defined as SPRs. Banks 4-7 are defined as USB data or User data.

The user can set up usb buffer descriptions and buffers in this area. Whatever is not needed for USB can be used for any purpose. From your note I am not clear whether banks 4-7 should be general or special function. Any guidance is appreciated.

 

My recommendation is this:

This special memory should be declared as GPR in TDF file.

If a program uses this memory for USB data, then it should declare an array with a fixed address the covers the require memory areas eg:

 

char usbBuffer1[ 256 ] @ 0x400;

char usbBuffer2[ 256 ] @ 0x500;

char usbBuffer3[ 256 ] @ 0x600;

......

 

This will prevent linker from attempting to use these memory areas for memory allocation (as they have been done manually).

 

Sorry for such a delay in replying.

 

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...
Sign in to follow this  

×
×
  • Create New...