Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About chuckj

  • Rank

Profile Information

  • Gender
  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.
  • Create New...