Jump to content

Dave

Administrators
  • Content Count

    2,046
  • Joined

  • Last visited

Everything posted by Dave

  1. tom 2007, This one had me scratching my head for a while. The problem is in the string.h header file, size_type was not used in a few places it should have been. Attached is a corrected version of this file. Regards Dave string.zip
  2. djace, This header doesn't exist for the BoostC compiler.You could make you own with the following contents: #define _ASSERT( assertArg ) Regards Dave
  3. gurday, Looks like you are mixing versions of compiler and linker, generally this is not recommended and is no doubt the cause of your problems. Regards Dave
  4. Have you tried running pp.exe from a command line prompt?It maybe your anti-virus software has quarantined this file? I'm running Win 7 64bit and don't see any problems. Regards Dave
  5. Boostfede, I have just tried your code with BoostC V7.04 and MPLAB V8.76, all works OK.I have just tried your code with BoostC V6.97 and MPLAB V8.76, all works OK. So I'm not sure why its not working for you, and more perplexing is that fact that it is dependent on the set_bit macro. Regards Dave
  6. Remember to add #include <system.h> to your source code for the set_bit macro to work.Even if this is missing I would still expect to get an error generated, so maybe something else is wrong. Regards Dave
  7. You are correct, accepted syntax doesn't appear to be as one would expect, I've added it to our bug list to get fixed. You can ignore this warning. It just means that the debug file (coff file) can't represent the function pointer data type. All this means is that you won't be able to watch the pointer values in the debugger. The way function pointers are implemented in BoostC is that the function pointer has a simple value, that value is an index into a jump table where the function arguments are patched, then the actual function is called. On return the return value is patched up and then the code returns to the caller. So what you see for each function pointer being a number that start at 1 and increases is what would you should get. Regards Dave
  8. Tony, Drop the brackets when using the function pointer, see below: #define CMD_STR_MAX_LEN 10 #define CMD_NUM 10 #define NULL 0 typedef struct cmd_S { char cmdStr[ CMD_STR_MAX_LEN ]; void ( *cmdFunc )( char * cmdLinePt ); } cmdStruct; void cmdLoad( char* cmdLine ) { } void cmdRun( char* cmdLine ) { } void cmdStop( char* cmdLine ) { } cmdStruct commands[ CMD_NUM ] = { { "\1load", cmdLoad }, { "\1run", cmdRun }, { "\1stop", cmdStop }, }; void ( *cmdFunc )(); //----------- char* str = "1234567890"; cmdStruct* getCmd( char ** cmdLinePtPt ) { //-------- int i = 1; *cmdLinePtPt = str; return &commands[ i ]; } void main( void ) { cmdStruct* command; char* cmdBuffPt = NULL; //--------- command = getCmd( &cmdBuffPt ); if ( command != NULL ) { command->cmdFunc( cmdBuffPt ); } while(1); } Regards Dave
  9. Tony, You have probably done made the same mistake I did when trying to compile your code: #define CMD_STR_MAX_LEN 1; typedef struct cmd_S { void ( *cmdFunc )( char * cmdLinePt ); char cmdStr[ CMD_STR_MAX_LEN ]; } cmdStruct; void main() { } Notice the mistake? There is a semi colon where it shouldn't be, at the end of "#define CMD_STR_MAX_LEN 1;". Removing that allows successful compilation for me. Regards Dave
  10. Sparky1039, In you code make sure you use #include<system.h> in your source files, this will then include the appropriate header file for the device you select. You can conditionally compile code for each target using the following: void foo() { #ifdef _PIC18F67J11 // code and register use specific to PIC18F67J11 ..... #else // code and register use specific to the other device ..... #endif } or void foo() { #ifdef _PIC18F67J11 // code and register use specific to PIC18F67J11 ..... #endif #ifdef _PIC18F67K22 // code and register use specific to PIC18F67K22 ..... #endif } or #ifdef _PIC18F67J11 // function when using PIC18F67J11 void foo() { ... } #endif #ifdef _PIC18F67K22 // function when using PIC18F67J11 void foo() { ... } #endif I hope that helps. Regards Dave
  11. trossin, Very dissappointing I'm not seeing quite the same issue as you. The different maybe the way you are specifying the path to the MPASM. I browsed using the "." button on the tools dialog box so my path is a shortened version eg "C:\PROGRA~2\MICROC~1\MPASMS~1\MPASMWIN.exe" and contains no spaces. Please try setting the path using the "." button and let us know what happens. Irrespective of that I still could not link the code because the target type is not specified in the mplink command line. Looks like Microchip have changes there command line arguments to MPLINK so that it needs to know the target device, and we have not kept up. Work Around As a work around i created a batch file to do the assembly, linking and conversion to hex file. The batch file I placed in the project folder. This batch file can't be invoked by placing it in the assembler command line because this some other stuff other than just assembling, ie it also invokes mplink and mp2hex. BTW I tried this with MPLAB V8.66. I invoke this batch file by placing the command line to it in used this in the Setting->Options->Tools-> Programmer. So to initiate an assembly I have to push the "P" button on the tool bar instead of the "A" button. After the assembly is complete you can enter the debugger as normal. Attached is my batch file. I hope that helps. Regards Dave assemble.zip
  12. tom 2007, The problems you see seems to be that the software stack used for variables does handle recursion as intended, that is as you found other variables on the software stack can become corrupted. This is not meant to happen. But even if that did work recursion as intended there is still a problem, that is a recursive function call will over right its arguments and local variables. With a correctly crafted function this isn't necessarily an issue. The answer will be to separate out the code in send_cmd into two funtions, something along the lines of: unsigned char send_cmd (BYTE cmd,DWORD arg){ unsigned char res; FATFS * fs = pf_fatfs(); if (cmd & 0x80) { /* ACMD<n> is the command sequense of CMD55-CMD<n> */ cmd &= 0x7F; res = send_cmdxxx(CMD55, 0); if (res > 1) return res; } return send_cmdxxx( cmd ); } unsigned char send_cmdxxx (BYTE cmd,DWORD arg){ BYTE n; unsigned char res; FATFS * fs = pf_fatfs(); pff_select(); /* Send a command packet */ xmit_spi(cmd); /* Start + Command index */ xmit_spi((BYTE)(arg >> 24)); /* Argument[31..24] */ xmit_spi((BYTE)(arg >> 16)); /* Argument[23..16] */ xmit_spi((BYTE)(arg >> 8)); /* Argument[15..8] */ xmit_spi((BYTE)arg); /* Argument[7..0] */ n = 0x01; /* Dummy CRC + Stop */ if (cmd == CMD0) n = 0x95; /* Valid CRC for CMD0(0) */ if (cmd == CMD8) n = 0x87; /* Valid CRC for CMD8(0x1AA) */ xmit_spi(n); /* Receive a command response */ n = 10; /* Wait for a valid response in timeout of 10 attempts */ do { res = rcv_spi(); } while ((res & 0x80) && --n); serial_send_string("fatent in send_cmd:"); serial_send_long(fs->n_fatent); serial_send_string("\r\n"); return res; /* Return with the response value */ } I hope that helps. Regards Dave
  13. tom 2007, Send us the bad project and we can take a look, send project to support@sourceboost.com. Regards Dave
  14. tom 2007, These do sound like compiler bugs.Please try BoostC V7.04. If you still have the same issues it would be good if you can provide a simple project that demonstrates the issues and can be run under the SourceBoost IDE debugger/simulator, then we should be able to help. Regards Dave
  15. HP-65, I have tried this and don't see a problem. Please check that you have exactly the same goodies.exe file I have: File Size: 757,760 bytes Date modified: 08 July 2011, 08:39:24 Regards Dave
  16. Missing library - Add Libc.pic16.lib to the mplab project. Regards Dave
  17. Dave

    Log10

    sdx, I agree this is not good.This subject is one that comes up from time to time, but its not one that is easily to do hence its still on the todo list. Regards Dave
  18. 'JMoore' Sadly this is a current limitation with MPLAB integration. Function overloading, function template and Novo RTOS are two unique features that are worth looking at. The BoostC compiler/linker handles bank switching for you. Regards Dave
  19. TCroft4, Are you building a custom version of the library or linking in a supplied version? Ether way this error means that linked can't find this function. Regards Dave
  20. Mike Webb, I just tried MPLAB V8.73a (appears as V8.73.00.00 under menu Help -> About MPLAB IDE) on a totally clean installation on Windows XP.1) Installed MPLAB V8.73a 2) Installed SourceBoost package V7.04. 3) Setup tool suite locations in MPLAB. 4) Created a new project in MPLAB. 5) Added a source file to the project. 6) Compiled project with success. 7) Single stepped project in MPLAB running MPLAB SIM, watching variables change value. So it all worked for me with SB V7.04. Regards Dave
  21. JMoore, What are setjmp/longjmp used for ? Regards Dave
  22. Hi All, SourceBoost V7.04 (now released) should fix these issues. Regards Dave
  23. bruno-hv, You need to provide more detail as to the PIC you are using and what RF module before anyone can try to help. Regards Dave
  24. dion, If there is no target device code is produce for a give line of program the break point will be removed when the debugger is entered.For example if a function is not called anywhere in a program no code is generated for it, and so if you try to set a break point on a line in the function that is not called then the breakpoint will be removed when the debugger is entered as there is no actual opcodes and therefore code address to put a breakpoint at. The "Can't locate source line for..." message is generated if the program execution is paused and the address of the program counter (PC register) points at an address for which the debugger does not have source code, for example if you stop the code execution while it is in the delay_us() function, then you will get this message as no source code actuall exists for this function as it is a special one generated by the linker program when you code is linked. I hope that helps. Regards Dave
×
×
  • Create New...