Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by chuckj

  1. Using MPLabX ver 5.15 with SourceBoost 7.43. Working to compile an existing project with the Chameleon compiler, found these problems(which compiled OK with BoostC): 1)Got a strange error when trying to compile a switch statement using an enumeration: Attached file newmain.c failed with this error: newmain.c(28): error: missing closing curly bracket (1) Compile succeeds if the statement case SSStart: is replaced with case 0: **************************** 2)Definition of enum EN_TASK_STATUS in novo.h fails compile due to trailing comma: enum EN_TASK_STATUS { TS_NOT_STOPPED = 00000111b, TS_IN_RUN_Q = 00000001b, TS_IN_SLEEP_Q = 00000010b, // a task can be in the event queue TS_IN_EVENT_Q = 00000100b, // and wait queue at the same time TS_EVENT_TIMEOUT = 00001000b, TS_IS_WAKING = 00010000b, //***** remove this trailing comma to fix! ******* }; ******************************* 3)Novo Sys_Sleep(TICK_COUNT) compile fails because TICK_COUNT defined as unsigned int and Sysi_Sleep wants unsigned short or unsigned char arg. Strangely, I could not fix this by editing the TICK_COUNT typedef in novocfg_PICxxxxx.h file, I had to define the variable I used in Sys_Sleep call as unsigned short. FAILS COMPILE: TICK_COUNT usTicks; usTicks = 10; Sys_Sleep(usTicks); COMPILES OK: unsigned short usTicks; usTicks = 10; Sys_Sleep(usTicks); ************************************************************************************************************************** newmain.c
  2. PROBLEM SOLVED, my PC needed msvcp120.dll from the Microsoft Visual C++ Redistributable Package for Visual Studio 2013. I have a 64 bit computer, so I installed both the 64 bit and 32 bit versions as recommended by Microsoft. I discovered the need for this dll by running the Chameleon compiler via c_pic18.exe command line interface. Hope this helps someone with a similar problem...
  3. Repeated test with MPLabX v5.15 and default C program generated by MPLabX. Results are the same as detailed in previous post - compiles fine with BoostC, using Chameleon compiler fails with 'recipe for target xxx failed' error. Error refers to line 101 of nbproject/Makefile-default.mk file which I have attached to this post. Has anyone else seen this? Makefile-default.mk
  4. Using BoostC 7.43 on MPLabX 4.00 on Windows 7 with PIC18F25K22. I newly installed version 7.43, standard BoostC compile works fine. I presume that the Chameleon compiler supports the PIC18F25K22. When I add -force_chameleon to compiler additional options, I get this result: ******************************************************************************************************************************************* CLEAN SUCCESSFUL (total time: 113ms) make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory 'C:/PICProjects/GPS' make -f nbproject/Makefile-default.mk dist/default/production/GPS.production.hex make[2]: Entering directory 'C:/PICProjects/GPS' gnumkdir -p build/default/production "C:\Program Files (x86)\SourceBoost\xlaunch.exe" -t PIC18F25K22 -obj "build/default/production" -o "build/default/production/GPS.o" GPS.c -force_chameleon nbproject/Makefile-default.mk:101: recipe for target 'build/default/production/GPS.o' failed gnumkdir -p dist/default/production make[2]: [build/default/production/GPS.o] Error -1073741515 (ignored) "C:\Program Files (x86)\SourceBoost\boostlink_picmicro.exe" -t PIC18F25K22 -ld "C:\Program Files (x86)\SourceBoost"\lib -p dist/default/production/GPS.production.hex build/default/production/GPS.o libc.pic18.lib BoostLink Optimizing Linker Version 7.43 http://www.sourceboost.com Copyright(C) 2004-2018 Pavel Baranov Copyright(C) 2004-2018 David Hobday failure Error: Failed to open:GPS.o make[2]: *** [dist/default/production/GPS.production.hex] Error -2 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 nbproject/Makefile-default.mk:115: recipe for target 'dist/default/production/GPS.production.hex' failed make[2]: Leaving directory 'C:/PICProjects/GPS' nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed make[1]: Leaving directory 'C:/PICProjects/GPS' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed BUILD FAILED (exit value 2, total time: 1s) ************************************************************************************************************************************************* I cut the program down to nearly nothing, just a Main routine(see attached). Any ideas? GPS.c
  5. Running Windows XP SP3 MPLAB X ver 1.80 BoostC ver 7.20 I am getting these compilation errors that I was not getting before I updated Boostc: wallcontrol.c(751:26): error: failed to generate expression wallcontrol.c(751:26): error: invalid operand '&(lata)' wallcontrol.c(751:24): error: failed to generate expression wallcontrol.c(752:28): error: failed to generate expression wallcontrol.c(752:28): error: invalid operand '&(stEE.stVars.eWallAMode)' wallcontrol.c(752:26): error: failed to generate expression wallcontrol.c(753:31): error: failed to generate expression The errors go away if I get rid of the parentheses: &(lata) gives an error. &lata does not give an error &(stEE.stVars.eWallAMode) gives an error. &stEE.stVars.eWallAMode does not give an error. I cannot say if this is a bug with respect to ANSI C, but I suspect that it is.... Thanks, Chuck
  6. Jorge, Thanks for the reply, I was not aware about the need to add the library file to the project. I did try adding the library file to the project and yes, I did see the pathname problem in MPLAB X. I agree that it probably has to do with the space in the pathname. I have posted the path issue on the Microchip MPLAB X forum. Chuck
  7. I am running on MPLAB X ver 1.1 with SB ver 7.05.1 and ICD3. To help others, I will list stumbling blocks I had and the 1 issue I need help with(see bottom) Stumbling blocks overcome: 1)I installed MPLAB X after installing BoostC. If you want to do this, first read MplabX_Plugin.pdf in your SourceBoost root directory(C:\Program Files\Sourceboost). It tells you what you need to do. 2)To run NOVO RTOS, you need the -swsc linker option. To add linker options in MPLAB X, select File-Project Properties. Under categories, select "SourceBoost Linker for PIC...." Beside "Options categories", select the "Software Call Stack..." and check the box "Use Software Call Stack for all code" 3)When adding source or library files to your project in MPLAB X, you usually want to select "Auto" under "Store Path As" on the right side of the file chooser dialog. The issue remaining(and my solution): 4) The library file libc.pic18.lib (for me using the PIC18F25K22) was not automatically included in the link like it is in the Sourceboost IDE. This results in lots of math routines not being found. The only way I got the project to link was to copy the file from C:\Program Files\Sourceboost\lib to my project directory and then add it to my library files in the project. I know this is not right, so if anyone has a better way to get this to work, let me know! Thank you, Chuck
  8. Can someone point me to a document which gives the regular expression syntax for SouceBoost IDE search and replace? If it uses Regex, which flavor is it? Thanks, Chuck
  9. This is only a minor issue which is easily worked around. Using latest BoostC download Ver 7.04 on Windows XP SP2. Compiler gives invalid operand on: short sTest; sTest = -(20); sTest = -(20*10); In general, it looks the compiler does not like unary minus followed by a paren. Thanks, Chuck
  10. Thank you! I did not think to look in the linker options. The linker option -isrnocontext removes the extra code from the ISRs. Chuck
  11. Using BoostC compiler on a PIC18F2420. I have a very time critical application which requires an interrupt response on the order of 25 clocks. Is there any way to eliminate the saving and restoring of the PROD and FSR0 regs in the interrupt() routine? This would eliminate about 16 clocks from the routine. Or is there any way to code the entire interrupt() routine in assembly? Thanks, Chuck
  12. My apologies if this has been mentioned somewhere. For PIC 18F processors( and perhaps others) you can use CCP1 and Timer1 to get an accurate tick period without using a software counter. The key is using the CCP Compare Special Event Trigger to reload Timer 1. Here is a code snippet to illustrate setting up 1 millisecond tick on a 40 MHz processor: /**** Defines to make it easy to change clock frequency or prescaler ****/ //40 MHz clock #define FOSC 40000000 #define TIMER1_CLOCKS_PER_US ((FOSC/4)/1000000) //Prescaler value must reflect PS1:PS0 values in PRESCALER_MASK!! #define TIMER1_PRESCALER_VALUE 1 #define PS1PS0_MASK 0x00 #define MICROSECONDS_PER_TICK 1000 //Use CCP1 in compare mode with special event trigger to do timing. // This way, the timer is reloaded in hardware so timing is very accurate #define CCP1_1MS_LOAD (((TIMER1_CLOCKS_PER_US * MICROSECONDS_PER_TICK )/TIMER1_PRESCALER_VALUE)- 1) //Reset timer and interrupt on timer compare mode match. #define CCPX_COMPARE_SPECIAL_EVENT_TRIGGER 00001011b #define MSB(x) (((x)>>8)&0xFF) #define LSB(x) ((x)&0xFF) /************* START OF CODE **************************/ //Initialization int main( void ) { //Init Novo RTOS SysInit(); //Create tasks here SysCreateTask(hMyTask, 1, MyTask); ..... //Start tasks here SysStartTask(hMyTask); ..... //Load CCPR1L and CCPR1H so compare will fire at 1 millisecond(our tick period) //See #defines above for load calculations and values ccpr1l = LSB(CCP1_1MS_LOAD); ccpr1h = MSB(CCP1_1MS_LOAD); //Set up interrupt on CCP event. clear_bit(pir1, CCP1IF); clear_bit(ipr1, CCP1IP); set_bit(pie1, CCP1IE); //This causes a hardware reset of Timer1 when CCP compare hits. // CCPX_COMPARE_SPECIAL_EVENT_TRIGGER is #define above. ccp1con = CCPX_COMPARE_SPECIAL_EVENT_TRIGGER; //Set up timer 1 for 16 bit, prescaler = 1, PS1PS0_MASK is #define above t1con = (1<<RD16) | (1<<TMR1ON) | (PS1PS0_MASK); set_bit(intcon, GIE); while(1) { Sys_Yield(); } } void interrupt( void ) { if( pir1.CCP1IF == 1 ) { //Handle ticker for NOVO RTOS SysTimerUpdate(); clear_bit(pir1, CCP1IF); } } //Tasks, etc............ Note how simple the interrupt handler is. All counting and reloading is done by the CCP. Hope you find this useful! Thanks for a great product, Chuck
  13. Thanks for the replies, I will use both of the suggested methods!
  14. My apologies if this has been asked before! I have a C routine: void CalcCRC( unsigned char ucData ) { } that I would like to call from inline assembly. I found that calling the routine can be done by: asm { //This compiles fine in assembly without a leading underscore. call CalcCRC } My problem is how to access the parameter ucData to the CalcCRC procedure from inline assembly. I have tried: movwf ucData movwf _ucData movwf CalcCRC_ucData movwf _CalcCRC_ucData movwf CalcCRC_arg_ucData movwf _CalcCRC_arg_ucData I know I can declare ucData as a global and have no params on the CalcCRC procedure. Is there a way to do this having ucData as a parameter? Thanks!
  15. Thanks for the reply, I have already tried that. Putting double quotes around the entire path results in a similar error as in my first case: Unable to open input file: C:\Program Files\SourceBoost\include. My Extra compiler options line actually looks like: -O2 -I ..\..\modbus\rtu;..\..\modbus\include;port;"C:\Program Files\SourceBoost\include" It was working fine before I added the last path.
  16. I have started using NOVO RTOS and would like to keep the NOVO .h files in c:\Program Files\SourceBoost\include directory. So in SourceBoost IDE Extra compiler options I put: -I\Program Files\SourceBoost\include Because of the space in "Program Files", this makes the compiler think there is an extra file "Files\SourceBoost\include" to compile. So I try to put Program Files in double quotes like this: -I\"Program Files"\SourceBoost\include This works OK IF I use the COMPILE option. If I use the BUILD option, I get a usage error on pp which spits out all of the pp command line options. Of course I can move the NOVO .h files to my build directory or always use the COMPILE option, but I am wondering if anyone has a solution for accessing include dirs that have a space in the name. Using BoostC ver 6.95. Thanks!
  17. I get the correct result as long as the (usCRC>>8) term is not the first term in the last line. These last lines all give the correct result: usCRC = (iNum<<1) ^ (usCRC>>8) ^ pNum ^ iNum; usCRC = (iNum<<1) ) ^ pNum^ (usCRC>>8 ^ iNum; usCRC = (iNum<<1) ^ pNum ^ iNum^ (usCRC>>8); Sorry for not using code tags in my bug report!
  18. Bug description: Getting incorrect(I believe!) result from complex XOR Result should be 0x87FE, am getting 0x7AFE. Same result using -O0 option on compiler. Steps to reproduce: Run this code: #include <system.h> int main( void ) { unsigned short iNum; unsigned short pNum; unsigned short usCRC; usCRC = 0xFFFF; iNum = 0x00F4; pNum = 0xC001; usCRC = (((usCRC>>8) ^ pNum) ^ (iNum<<6)) ^ (iNum<<7); } Got same result with parens only around the '<<' terms. Expected behaviour: I expect the ending usCRC value to be 0x87FE. Here is a breakdown of the last line XOR: 0000 0000 1111 1111 //This is usCRC(0xFFFF) >> 8 1100 0000 0000 0001 //0xC001 0111 1010 0000 0000 // iNum << 7 0011 1101 0000 0000 // iNum << 6 1000 0111 1111 1110 //Result of 0x87FE from XOR of 4 16 bit values above Is the problem 100% reproduceable: Yes IDE version: 6.95 Compiler: BoostC Compiler version: 6.95 Target device: PIC18F2420 OS: Window XP SP2 Comments: Please let me know if I am doing something wrong here.
  19. Running BoostC ver 6.95 on MPLAB ver 8.3. I am compiling in MPLab using an MPLab project. If the C file is in the same directory as the workspace or project file, it compiles fine in BoostC. If the C source file is in a subdirectory of the workspace directory, the BoostC command line shows an attempt to compile the file as if it were in the workspace directory. This gives an "unable to open input file ...." error. If I double click on the file within MPLab .mcw window, the file comes up in the editor just fine. This issue is identical to the issue in Bongo's forum post of March 31st, except I am running ver 6.95. I did not see any resolution in that post, so I did a new post rather than post to that thread. Is there something I can do within MPLab to make this work - aside from putting all of my sources in the workspace dir??? Thanks.
  20. My apologies, this is covered by using the -I command line option under Extra compiler options in Settings - Options. I did not think that this was a project level setting, but it is!
  21. I am having trouble with the following code: #include <system.h> #include <boostc.h> typedef void ( *X ) ( unsigned char a ); typedef void ( *Y ) ( unsigned char b ); X pX; Y pY; Compiling this code gives error: unknown data type 'Y' If you comment out the last line, it compiles successfully. If typedef'd funciton pointers are allowed, why is this failing? Thanks!
  22. Bug description: A /* ... */ comment appears to be terminating incorrectly. Steps to reproduce: Put these 3 comment lines into a .c file and compile: /* * //This is a commented out comment with a space after the * */ You will get unexpected identifier error. If you add one more space between the '*' and the first '/' in line 2, the error goes away. Expected behaviour: I would not expect '* /'(space in the middle) to terminate a /* ... */ comment. The IDE parser correctly shows the comment continuing. Is the problem 100% reproduceable: So far! IDE version: 6.95 Compiler: BoostC Compiler version: 6.95 Target device: PICXXXXX OS: Windows XP
  23. Thank you for a great compiler! I am not sure whether this is an issue with anyone else, but I try to avoid specifying paths in #include statements. It would be nice to have a way to specify include directories at the project level, with the path being relative or absolute. This is analogous to specifying include directories in a make file. Another way to do this would to check the project file list for the include filename and if found, use the full path from the project file list.
  • Create New...