tobik 0 Posted September 13, 2004 Report Share Posted September 13, 2004 Is #pragma DATA not supported in boostc? Tobias Quote Link to post Share on other sites
Pavel 0 Posted September 13, 2004 Report Share Posted September 13, 2004 Not yet. Regards, Pavel Quote Link to post Share on other sites
Pavel 0 Posted September 16, 2004 Report Share Posted September 16, 2004 Implemented and will be available in the next release. Regards, Pavel Quote Link to post Share on other sites
tobik 0 Posted September 17, 2004 Author Report Share Posted September 17, 2004 Good news! Thank you, Pavel. BTW - is it possible to define the address of the EEPROM data inside the #pragma DATA? Example #define EEPROM_ADDR_NAME_1 0x00 #pragma DATA 0x2100_de_"Name 1 " would be more comfortable and failsave as #pragma DATA EEPROM_ADDR_NAME_1@0x2100_de_"Name 1 " Regards, Tobias Quote Link to post Share on other sites
Pavel 0 Posted September 17, 2004 Report Share Posted September 17, 2004 Yes it will be possible to use DATA pragma for both configuration word, eeprom data and data in code memory. Regards, Pavel Quote Link to post Share on other sites
tobik 0 Posted September 17, 2004 Author Report Share Posted September 17, 2004 Sorry my post was misleading. What I want to talk about is a LABEL inside the data pragma which can be further used as reference to the address of this data. Example #pragma DATA EEPROM_ADDR_NAME_1@0x2100_de_"Name 1" ... char ch = eeprom_load (DATA EEPROM_ADDR_NAME_1); Of course a label for eeprom data at 0x2100 must be reference address 0x00. Regards, Tobias Quote Link to post Share on other sites
tobik 0 Posted September 21, 2004 Author Report Share Posted September 21, 2004 Pavel Just tried new #pragma DATA in boostc 1.2 alpha. #pragma DATA _CONFIG _PWRTE_ON & _WDT_OFF & _XT_OSC & _BODEN_ON & _LVP_OFF #pragma DATA 0x2100, 0x12, 0x34, 0x56, 0x78, "ABCD" DATA _CONFIG ... unknown pragma - no code DATA 0x2100 ... overlapping user data - but correct code BoostC Optimizing C Compiler Version 1.2 Alpha (for PIC16 architecture) http://www.picant.com/c2c/c.html Copyright© 2004 Pavel Baranov Copyright© 2004 David Hobday flightlog.c(72): warning: unknown or invalid pragma (ignored) success BoostLink Optimizing Linker Version 1.2 Alpha http://www.picant.com/c2c/c.html Copyright© 2004 Pavel Baranov Copyright© 2004 David Hobday Warning: Overlapping user DATA at address:0x00002100 Warning: Overlapping user DATA at address:0x00002101 Warning: Overlapping user DATA at address:0x00002102 Warning: Overlapping user DATA at address:0x00002103 Warning: Overlapping user DATA at address:0x00002104 Warning: Overlapping user DATA at address:0x00002105 Warning: Overlapping user DATA at address:0x00002106 Warning: Overlapping user DATA at address:0x00002107 Warning: Overlapping user DATA at address:0x00002108 Warning: Overlapping user DATA at address:0x00002100 Warning: Overlapping user DATA at address:0x00002101 Warning: Overlapping user DATA at address:0x00002102 Warning: Overlapping user DATA at address:0x00002103 Warning: Overlapping user DATA at address:0x00002104 Warning: Overlapping user DATA at address:0x00002105 Warning: Overlapping user DATA at address:0x00002106 Warning: Overlapping user DATA at address:0x00002107 Warning: Overlapping user DATA at address:0x00002108 Warning: Overlapping user DATA at address:0x00002100 Warning: Overlapping user DATA at address:0x00002101 Warning: Overlapping user DATA at address:0x00002102 Warning: Overlapping user DATA at address:0x00002103 Warning: Overlapping user DATA at address:0x00002104 Warning: Overlapping user DATA at address:0x00002105 Warning: Overlapping user DATA at address:0x00002106 Warning: Overlapping user DATA at address:0x00002107 Warning: Overlapping user DATA at address:0x00002108 Tobias Quote Link to post Share on other sites
Guest Dave Posted September 21, 2004 Report Share Posted September 21, 2004 Tobias, _CONFIG does not appear in the header files, so it needs to be manually defined I guess you are getting the overlapping user code warning because you include the #pragma DATA in a header file that is included in more than one source file. So either put the #pragma DATA in a header file that is include only once, or put it in a single source file (.c). This code works work for me: #include <system.h> #define _CONFIG 0x2007 #pragma DATA _CONFIG _PWRTE_ON & _WDT_OFF & _XT_OSC & _BODEN_ON & _LVP_OFF #pragma DATA 0x2100, 0x12, 0x34, 0x56, 0x78, "ABCD" void main() { } Regards Dave Quote Link to post Share on other sites
tobik 0 Posted September 21, 2004 Author Report Share Posted September 21, 2004 Dave, you are right about _CONFIG is undefined. I did copy and paste it from the boostc.html documentation file. That should be updated. Note the missing "," behind _CONFIG too. The defines are in my main C file. Not in a header. It is not included twice. I double checked that. And variables from this file are not reported as redefined too. Please can you check that again? Regards, Tobias Quote Link to post Share on other sites
Pavel 0 Posted September 21, 2004 Report Share Posted September 21, 2004 You need to use comma after adress. The fromat is: #pragma DATA <addr>, <data>, <data>,... where: <addr> address on dec or hex form <data> data in hex or dec or string form (BoostC 1.2 update includes this info in BoostC help file) Regards, Pavel Quote Link to post Share on other sites
tobik 0 Posted September 21, 2004 Author Report Share Posted September 21, 2004 Pavel, BoostC 1.2 help: //Set PIC16 configuration word #pragma DATA _CONFIG _HS_OSC & _WDT_OFF & _LVP_OFF ... //Put some data into eeprom #pragma DATA 0x2100, 0x12, 0x34, 0x56, 0x78, "ABCD" 1. _CONFIG must be user defined - so better avoid it in the example. 2. The comma after _CONFIG is missing. 3. The linker generates "Overlapping user DATA at address:0x00002100" warnings. But beside the warnings the data make it into to LST file. Regards, Tobias Quote Link to post Share on other sites
Guest Dave Posted September 21, 2004 Report Share Posted September 21, 2004 Tobias, The defines are in my main C file. Not in a header. It is not included twice. I double checked that. And variables from this file are not reported as redefined too. Please can you check that again? If you still have the overlapping user data problem, please email the complete project to me: dave@picchip.com Regards Dave Quote Link to post Share on other sites
Pavel 0 Posted September 21, 2004 Report Share Posted September 21, 2004 1. _CONFIG must be user defined - so better avoid it in the example.2. The comma after _CONFIG is missing. You are right. I fixed the error in documentation and updated BoostC 1.2 update file. Regards, Pavel Quote Link to post Share on other sites
Recommended Posts
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.