Jump to content

John S

EstablishedMember
  • Content count

    34
  • Joined

  • Last visited

Community Reputation

0 Neutral

About John S

  • Rank
    Regular

Profile Information

  • Gender
    Male
  • Location
    UK
  • Interests
    Money, Peace
  1. Thanks Jorge, I have read the manual but it I can't find the explanation for using the -lib in command line mode. Page 24 gives only this info Switches for making libraries: -lib make library file from supplied .obj and .lib files -p name project (library output file) name Can I make lib file from the *.obj file that has been already created in my project? BTW I have never used Sorceboost IDE, anyway I will give it a try. Thanks John For example in GCC for ARM linux gcc -c FlashMem.c (to create obj file) ar rvs FlashmemLib.a FlashMem.o (to create library file)
  2. Hi, Can someone show me how to make *.lib file from my C file. I need to know this to increase the compile time. Cheers John
  3. Thanks Reynard, I forgot to mention that calling the same function works in another project but causes problem in this. I'm sure commenting out that line solved the problem. btw, declaration for the function is bit Read_BlockOfData(unsigned long ulAddr, unsigned char cBlockSize, char *buff) PIC -> 18F67K22 Compiler -> Sourceboost 7.21 IDE -> MPLAB 8.87 OS -> Windows 7, 64bit Thanks John
  4. Hi Reynard, I narrowed down to the line of code which is causing this error. As you can see from the attached code, commenting the following line solves the problem // Commenting the below line fixes the issue. Read_BlockOfData(un.lData, (unsigned char)uWorkVal, Ptr); union temp { unsigned char byte[4]; unsigned long lData; }un; un.byte[0] = rx_data_buf_Ftdi[1]; // LSbyte un.byte[1] = rx_data_buf_Ftdi[2]; un.byte[2] = rx_data_buf_Ftdi[3]; un.byte[3] = 0; uWorkVal = rx_data_buf_Ftdi[4]; // Commenting the below line fixes the issue. Read_BlockOfData(un.lData, (unsigned char)uWorkVal, Ptr); thanks John
  5. Hi, I get the following error, What is this? 'Internal Error: Data Type not found id:0x1000253A:0x006:0x00000883' Any solution? Thanks John
  6. Thanks Pavel, But what is the difference between CALL and GOTO ? I use GOTO instruction to jump to bootloader to main and vice versa.. Many Thanks
  7. Thanks Jorge, But still I'm not able to get it working. Here is an example of what I'm trying to achieve. I want to call a function in my Main code which is declared in my bootloader at an specific address. in my BOOTLOADER the function is mapped to address 0x070 void Message(char *str) @0x070 { do{ while(!txsta1.TRMT); // Wait till Tx Reg is free txreg1 = *str; // Load the data into the TxReg str++; }while(*str != '\0'); // Loop till end of String } In my MAIN application I use function pointer void (*foo)(char*); void main() { while(1) { if(recByte == 'T') { foo = 0x70; // address of the function foo("Test Message"); recByte = ' '; } } } Everything compiles ok but I get a warning Warning: function never returns: '__fptr' Then I tried foo = ((*)(char*))0x070; foo("Test Message"); Still I get error. Then I tried using typedef typedef void (*FnPtr)(char*); FnPtr foo; foo = (FnPtr)0x70; Still I get same warning. But if I move the function void Message(char *str) @0x070 to main application, and use foo = Message; the code works. I'm I doing something really stupid or is there anyother way to point to an address of a function? Many Thanks John
  8. Jorge, i tried as you said but no luck, In fact this is what microchip recommended. I managed to solve the issue with a power cycle circuit(pic attached) but it may be not 100% correct way of doing. By setting the BOR to above 3V the circuit worked for me. Thanks for all your input John
  9. Thanks Reynard for your reply. Yes I read about the issues with I2C on PIC18F4550. The PIC I use is 18F67K22. I tried toggling SPEN, still same. When I tried to initiate a START condition, bus collision pir2.BCL1IF is set. (no slaves on the bus, just a master). Reset is occurred by watchdog timer cause code blocks at while (!pir1.SSPIF); Thanks John
  10. Hi, Apologies first, cause this question is more about hardware I guess. I have my PIC micro board working. But when I took it to EMC test, it failed on ESD. On 8KV ESD the PIC freezes, but Watch timer RESETS the pic, which is good. BUT after the reset the I2C won't work. There is no activity on clk or data line. If I power cycle the board then I2C works again. The two I2C slaves connected to PIC is held in reset for a while once PIC is reset, so it can't be the slave device. Any solution? Thanks John
  11. Great! Thank you, Running preg as administrator solve the issue. John
  12. Hi, I have a Pro License for BoostC V6.xx & V7.xx. I successfully activated on preg. But when I compile it still says Lite License (unregistered) max RAM banks 2 How do I solve this? Thanks John
  13. Hi, I need certain functions (which writes to LCD) to be accessible from the bootloader as well as my main application. Can I put these function at fixed address in my bootloader? And call them in the main code as well? If the above approach is correct how do I declare the same function in my main code? Is there any other better approach? Thank you John
  14. Hi Can some please explain me the logic behind these functions. I know it uses the CLOCK_FREQ value, but what is the code behind it? void delay_us( unsigned char t ) void delay_ms( unsigned char t ) void delay_s( unsigned char t ) many thanks John
×