USB application library - #pragma unknown to XC8

Post
Jorgen
New Member
2013/01/29 09:38:24
I want to use the USB library with the XC8 compiler and linker. I have copied files to a new project such that I do not modify the original files. When I run the XC8 compiler I get error messages saying the following pragmas are not known:
#pragma udata
#pragma romdata
#pragma code
#pragma USB_VARIABLES = 0x260
I have read the XC8 Users's Guide, in particular the information on #pragma psect, but I can't find the equivalent to udata, romdata and code. Nor can I find anything on a linker script as for the C18. The USB library assumes that some tables and buffers are loaded into certain locations in the memory.
My question is: What should I write in the code in place of these #pragmas?
 
User2009
Super Member
Re:USB application library - #pragma unknown to XC8 2013/01/29 23:46:06
Hello Jorgen,
 
referring to this thread[1] I think it may be a better solution to use a different compiler such as the C18.
 
[1] http://www.microchip.com/forums/tm.aspx?m=679588
Jorgen
New Member
Re:USB application library - #pragma unknown to XC8 2013/01/30 01:54:11
Hi User2000,
 
You are right. Use the C18 until the XC8 works properly and has become user friendly.
Regards,
NKurzman
A Guy on the Net
Re:USB application library - #pragma unknown to XC8 2013/01/30 07:53:59
 but I can't find the equivalent to udata, romdata and code
 
Becuse the XC8 does not use them. 
const puts a vatiable in flash.
C18 is end of life.  If it works use it.  I am not sure how musch work is need to port the stack
Jorgen
New Member
Re:USB application library - #pragma unknown to XC8 2013/01/30 08:08:56
Dear Kurzman,
 
I appreciate your reply which confirms that one should use the XC8 for new projects.
Moreover, I am trying to have an easy life in programming PIC controllers, so I want to use the new tools such as XC8, but it is annoying that there is no direct way of doing the conversion.
I am ploughing through the part of the USB library I use.  As far as I can see the conversion is a matter of getting a table and some buffers into the right part of the ram, since the USB engine can access only a part of the ram (from 0x400 to 0x7FF in case of the 18F4550).
When I remove the #pragmas I have no control over where the tables and variables go, so I have to find out which tables and buffers are supposed to be accessible by the USB engine, and then assign absolute addresses to them. It takes time to go through the code, but I am underway.
 
Regards,
Jorgen