Jump to content

tom 2007

EstablishedMember
  • Content Count

    57
  • Joined

  • Last visited

Posts posted by tom 2007


  1. So far i've only noticed it with one project. The major problem is that it seems to happen "at random".

    OS: Windows vista Home logged in as admin.

     

    Another problem is that sometimes the toolbar icons suddenly disappear and programming code starts displaying and flickering all over my screen :wacko: But again it rather seems to happen at random and I'm afraid it is very difficult to reproduce :( .


  2. Hello,

     

    For my project I need to be able to use large arrays (512 bytes). So i'm trying to compile it with -idx 2 option but i always get 2 unresolved external functions:

     

    "D:\program files\SourceBoost\boostlink_pic.exe"  -idx 2  /ld "D:\program files\SourceBoost\lib\large" libc.pic18.lib
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external function:'strncpy16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external symbol, function:strncpy16
    Error: Unresolved external function:'strncmp16(unsigned char*,unsigned char*,unsigned char)'
    Error: Unresolved external symbol, function:strncmp16
    1> 1> BoostLink Optimizing Linker Version 7.04

     

    I'm compiling from the IDE and have checked 'memory model: large' in settings->options menu.


  3. I can give my project but it will not work in the IDE because it needs to be able to send/receive data on the SPI port with the SD card.

    I've tried changing the project so it runs in the IDE but this requires me to change a lot of stuff then the bug doesn't happen anymore :(

     

    The hardware is very basic: PIC18F4550 + SD card holder connected to the SPI interface and 1 pin for sending debug information to the serial port of the computer...


  4. I'm trying to access an SD card using the Petit FAT File System but it's not really working properly:

     

    First there was this problem in the pf_read() function:

    				
    clst = (fs->fptr == 0) ? /* On the top of the file? */
    fs->org_clust : get_fat(fs->curr_clust);

     

    This didn't work (fs->fptr == 0) equals true but clst remains 0 and fs->org_clust was 250.

    After replacing this code with this:

    if (fs->fptr==0){
    clst = fs->org_clust;
    }else{
    clst = get_fat(fs->curr_clust);
    }

    this line of code finaly started working properly (clst became 250).

     

    Now i still have the problem of the Fat file system structure which is declared as a variable in main() getting corrupt by calling the send_cmd() function:

     

    BYTE send_cmd (BYTE cmd,DWORD arg){
    BYTE n;
    BYTE res;
    
    if (cmd & 0x80) {	/* ACMD<n> is the command sequense of CMD55-CMD<n> */
    	cmd &= 0x7F;
    	res = send_cmd(CMD55, 0);
    	if (res > 1) return res;
    }
    
    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);
    serial_send_string("fat c2:");
    serial_send_long(fs->n_fatent);
    serial_send_string("\r\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);
    
    //up to here there is no problem, nr of clusters = 15546
    return res; //after this line the number of clusters (stored in the fat file system structure in main()) is corrupted (high byte is set to 0)!
    }

     

    the function is called from (disk_readp) like this:

    //no problem with the file system structure (number of clusters is 15546)
    BYTE tmp = send_cmd(CMD17, lba);
    //here the number of clusters has changed to 186 high byte is 0

     

    Has anyone ever had the same problem? I'm not sure if this is a bug in the compiler but because it happens when the send_cmd function returns I don't know what to do anymore :(

    Is there somewhere a working example of boostc and FAT(32) / SD cards?

     

    I'm using boostc 7.03 and PIC18F4550

     

    Thanks a lot


  5. I've been busy porting TCP/IP from Microchip to boostc for quite some weeks now. Finaly it seems to be working quite well. If anyone is still interested in this i've uploaded an example project here: PIC18F27J53Ethernet.zip.

     

    This example uses the PIC18F27J53,ENC28J60 and 23K256 chips connected with a 6MHz SPI bus.

     

    Code compiles into +/- 45000 bytes (takes lot of time :rolleyes: ) most of it is based on the Microchip TCP/IP stack examples.

    Code includes:

    -ENC28J60 "driver"

    -IP

    -TCP (client & server)

    -UDP

    -ARP

    -DHCP client

    -DNS client

    -very basic http server that supports http GET method and urls with parameters

    -very basic http client that can download small http files into the sram module

    -http server example

    -UDP example

    -TCP client example

    -max 5 UDP sockets and 5 TCP sockets (1500 Bytes of RAM used)


  6. Hello all,

     

    Is there anyway to access bits in a variable (unsigned char or int) inside a struct?

    I want to use the Microchip TCP/IP stack in my project but they use bits in structs the compiler says it's not available in boostc but what whould be the best solution to replace them with?


  7. Hi

     

    I'm having some problems with the IDE V7.01 and autocompletion/prototype hits.

     

    When i type a function name and "(" the tooltip text is not always displayed it only seems to work with some system functions like delay_ms() etc.

    When i press CTRL+Space for the autocompletion window it only shows when i already typed the entire function name and the size of is is very small so it's not possible to read the text in.

     

    Anyone else with these problems?

     

    Tom


  8. Hello

     

    I found this link to a Microchip programmer: http://www.microchip.com/stellent/idcplg?I...ocName=en023805

     

    Does sourceboost support this programmer?

     

    There are like 3 versions as far as i understand they all contain the same USB programmer which should be able to program all PIC12F,16F and 18F by connecting the ICSP connector directly to the chip or the supplied PCB (depending on which version of the kit I buy).

     

    Is there anyone here that uses this programmer and is it good?

     

    Tom


  9. Hi

     

    I was wondering if there is a way to display the exact amount of clock ticks in the status bar because now when it goes over a few 10000 ticks it starts displaying in K and M ticks. This makes it impossible to view the exact time between 2 breakpoints (i don't know if there is any other solution). Also a label that show the amount of µs/ms elapsed on the status bar would be usefull.

     

    Tom


  10. Hello

     

    I'm trying to compile the picpack_2.0 usb serial example but this is what i get (target PIC18F4550):

     

    Building...
    BoostLink Optimizing Linker Version 6.95
    http://www.sourceboost.com
    Copyright(C) 2004-2009 Pavel Baranov
    Copyright(C) 2004-2009 David Hobday
    
    
    
    
    failure
    Error: .obj or .lib different clock frequencies specified
    Error: Failed to process:usb_serial.obj
    Error: .obj or .lib different clock frequencies specified
    Error: Failed to process:usb_config_serial.obj
    Error: .obj or .lib different clock frequencies specified
    Error: Failed to process:pic_usb_buffer_mgt.obj
    Error: .obj or .lib different clock frequencies specified
    Error: Failed to process:pic_serial.obj
    "D:\program files\SourceBoost\boostlink.pic.exe" /ld "D:\program files\SourceBoost\lib" libc.pic18.lib ..\..\pic_pack_lib\pic_utils.obj ..\..\pic_pack_lib\pic_tick.obj ..\..\pic_pack_lib\pic_timer.obj usb_serial.obj usb_config_serial.obj ..\..\pic_pack_lib\usb_cdc_class.obj ..\..\pic_pack_lib\pic_usb_buffer_mgt.obj ..\..\pic_pack_lib\pic_usb.obj ..\..\pic_pack_lib\pic_serial.obj /t PIC18F4550 /d C:\Users\Tom\Documents\pic\picpack_2.0\demos\usb_serial /p usb_serial
    Exit code was -2.
    Removing target: usb_serial.hex
    Failed to locate output file 'C:\Users\Tom\Documents\pic\picpack_2.0\demos\usb_serial\usb_serial.hex'
    Done
    
    Failed


  11. Hello

     

    I have a problem with the "switch":

     

    char data[4]={0};

    const char adr1=240;

    const char adr2=241;

    const char adr3=242;

    const char adr4=243;

     

     

    void main(){

    char dev=0;

     

    //some other code

    switch(data[1]){

    case adr1:

    dev=0;

    break;

    case adr2:

    dev=1;

    break;

    case adr3:

    dev=2;

    break;

    case adr4:

    dev=3;

    break;

    default:

    dev=-1;

    break;

    }

    }

     

    the compiler says "error: non-constant argument in 'case' expression" but the adr1,2,3,4 are constants!

    If i replace "const char adr1=240;" with "#define adr1 240" but then i get the error:

    error: missing colon

    error: missing right brace

    error: missing right paren

    error: failure

     

    The code works fine if i replace the adr1,2,... with the numbers but why is it not working with constants?

     

    Tom

×
×
  • Create New...