Jump to content

gurday

EstablishedMember
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About gurday

  • Rank
    Newbrie
  1. Hello: When using SourceBoost integrated with MPLAB...I get the following error...the same code standalone builds just fine...has anyone else experienced somthing similar? Regards G ===================================== Clean: Deleting intermediary and output files. Clean: Deleted file "SCANNER.OBJ". Clean: Deleted file "D:\BACKUP\scanner.HEX". Clean: Deleted file "D:\BACKUP\scanner.mcs". Clean: Done. Executing: "C:\Program Files\SourceBoost\boostc_pic18.exe" SCANNER.c -O1 -W1 -t 18F4685 BoostC Optimizing C Compiler Version 6.97 (for PIC18 architecture) http://www.sourceboost.com Copyright© 2004-2010 Pavel Baranov Copyright© 2004-2010 David Hobday Licensed to XXX under Single user Full License for 1 node(s) Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only SCANNER.c success Executing: "C:\Program Files\SourceBoost\boostlink.pic.exe" "D:\BACKUP\SCANNER.obj" "C:\Program Files\SourceBoost\Lib\float.pic18.lib" "C:\Program Files\SourceBoost\Lib\libc.pic18.lib" -O1 -v -p "scanner" -t 18F4685 -rb 0x4000 BoostLink Optimizing Linker Version 6.80 http://www.sourceboost.com Copyright© 2004-2007 Pavel Baranov Copyright© 2004-2007 David Hobday Optimisation level:1 Error: TDF parsing error, Line no:2845 Reading:C:/Program Files/SourceBoost/config/PIC18F4685.TDF failed failure BUILD SUCCEEDED: Fri Sep 16 09:33:44 2011
  2. Hello: I am having a problem with a USB bootloader I wrote...the bootloader works all the time if the file upload is small...if the file is large...it only accepts it the first time...the bootloader code works as it writes correctly to the pic. Here is birds view of the bootload code if button pressed and new code available { erase all flash loop until the end of file write flash (64bytes at a time starting at address == 0x4000) read and verify flash} if flash OK reset pic and restart if button not pressed jump to 0x4000 the source file is compiled with the -rb 0x4000 directive...as I said the problem shows up only when a large file is uploaded...any clues or suggestions are greatly appreciated... Rgds Gonzalo
  3. Found the problem... 1) asm{goto 0x2000} does not work, compiler somehow barfs at it 2) when I was burnign the pic the second time the programmer was erasing whatever I burned first..using picstart plus there is the option of "Erase all first" unchecked that and everything worked. G
  4. Hello..sorry replaced call 0x2000 with goto 0x2000 Gonzalo
  5. Hello all...I was reading the tread about bootloader and I am confused...why doesnot this procedure work: Compile program code with linker option -rb 0x2000 Burn pic...(I see the programmer start and verify from address 0x2000) Compile bootloader program with no rb option burn same pic with bootloader code. the bootloader code has the following line asm{ call 0x2000 } which basically goes to the main program if there is no new boot code to load...can someone point what is wrong with this approach??? Rgds Gonzalo PS: Tangential question...is there a way to call 0x2000 in C using Sourceboost???
  6. I understand...this makes things a lot more complex now cause the previous version (2.5Klines of code) use the rom char * type and I would read directly from rom.without table reads...is there a way to fix the address of the rom char* to a particular known location in memory if I could do that I would not have to modify my program much... Rgds Gonzalo You can't create a pointer to this memory, you need to write a function to access the data. If you are using a PIC18, then using table reads would do the trick. Regards Dave
  7. I guess I stand incorrect... why isn't this working...I have tried several variants, which you will see as comments.none of it work...the pointer points to the right location but doesnot copy the contents of it to the array #pragma DATA 0x00B000,'M','a','s','t','e','r','D','a','s','h',' ','R','e','v',' ',' ',' ',' ',' ',' ' char *ROWPTR; char row0[20]; int i = 0; //char temp@0x00B000; void main() { // ROWPTR = &temp; for (i=0;i<=19;i++) { ROWPTR = 0x00B000+i; row0 = *ROWPTR; row0 = ROWPTR; row0 = ROWPTR; } } Don't use rom char*.Your best bet is to use the uppermost rom area of the device you are using to store the strings. You can put initial data there using #pragam DATA. You will need to write a routine that copies the data from external EEPROM. You will need to write a routine that can read characters from this rom, your pointers now are string numbers (thats actually how the built in rom code works). Use the new function to replace [ ]. char MyRomGet( int stringNumb, char offset ) { ... } void printf_string( int stringNumb ) { char i = 0, c; while( c = MyRomGet( stringNumb, i ) ) // repeat until we hit the null terminator. { puts( c ); // some function that outputs our characters i++; } } I hope that helps. Regards Dave
  8. The #pragma DATA is what I needed....the rest I should be able to figure out... Thanks Gonzalo Don't use rom char*.Your best bet is to use the uppermost rom area of the device you are using to store the strings. You can put initial data there using #pragam DATA. You will need to write a routine that copies the data from external EEPROM. You will need to write a routine that can read characters from this rom, your pointers now are string numbers (thats actually how the built in rom code works). Use the new function to replace [ ]. char MyRomGet( int stringNumb, char offset ) { ... } void printf_string( int stringNumb ) { char i = 0, c; while( c = MyRomGet( stringNumb, i ) ) // repeat until we hit the null terminator. { puts( c ); // some function that outputs our characters i++; } } I hope that helps. Regards Dave
  9. Hello all: I have a program that writes a bunch of LCD messages in the following form: rom char *HELLO = {'Hello '}; all of them are 20 chars long(LCD is 4x20)...later on in the program I read this messages and displayed them on the LCD...here is the problem...we want now the user to select a particular language to be displayed in...we will store the diferent messages in different languages in external eeprom, everything works but the ability of writing this messages to a known address in ROM. In order for me to update all this messages to the user selected language I need to know how to fix the address of these messages so that I can update them as required...I have tried the following; rom char *HELLOPTR; charHELLO[20]@0x16600 = {'H','e','l','l','o',' ',' ',(blank 13 more times)}; HELLOPTR = &HELLO; I thought that the array was the problem so I tried: rom char *HELLOPTR; charHELLO@0x16600 = {'H'}; HELLOPTR = &HELLO; and some variants (ie {"H"}, other addresses etc), of the same idea but nothing seems to work...does anybody have a suggestion??? Rgds Gonzalo
  10. Hello Chris: I also use MPLAB...but when I set the project as you mention then command line changes to -0o which is no optimization, there is also a field for "data" but is blackedout..so no data can be added...I tried to add the -Oa to the command line in the additional command line options...does not seem to work either since the output is of the same size... I must be missing something simple... G Hi, if you are using MPLAB you can set optimisation level in the project settings, Project->Build options->Project then select BoostC compiler tag. In Sourceboost I am not sure, try Settings->Options
  11. How is the aggresive optimization set??? I added the following pragma at the beginning of my code #pragma OPTIMIZE "a" but when I build the files, the command line shows the -O1 directive??? Is there a way to globally set the optimization to aggresive??? Rgds Gonzalo
×
×
  • Create New...