Menu

#292 usb registers missing for 18f4550 and variants in 1.5.0

None
closed-fixed
None
1
2016-09-22
2016-08-22
Fred
No

Hi,

I just upgraded to gputils-1.5.0. When I went to test on some code for the 18f4550 I received this error:
cd _output && /usr/bin/sdcc -o mybootloader.hex --obanksel=2 --opt-code-size --optimize-cmp --optimize-df --fomit-frame-pointer --no-crt -Wl-s../18f4550.lkr,-m -mpic16 --use-non-free -p18f4550 --extended -L /usr/share/sdcc/non-free/lib/pic16 usbmmap.o usbdrv.o usbctrltrf.o usbdsc.o usb9.o boot.o interrupt.o lcd.o main.o
error: Missing definition for symbol "_ep7Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep7Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep15Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep2Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep2Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep15Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep4Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep4Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep12Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep12Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep9Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep9Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep14Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep14Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep6Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep11Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep11Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep6Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep8Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep8Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep13Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep3Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep13Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep3Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep5Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep5Bo", required by "usbmmap.o".
error: Missing definition for symbol "_ep10Bi", required by "usbmmap.o".
error: Missing definition for symbol "_ep10Bo", required by "usbmmap.o".
make: *** [mybootloader.hex] Error 1

I then reverted to gputils-1.4.3 rev 1212 and everything works:

cd _output && /usr/bin/sdcc -o mybootloader.hex --obanksel=2 --opt-code-size --optimize-cmp --optimize-df --fomit-frame-pointer --no-crt -Wl-s../18f4550.lkr,-m -mpic16 --use-non-free -p18f4550 --extended -L /usr/share/sdcc/non-free/lib/pic16 usbmmap.o usbdrv.o usbctrltrf.o usbdsc.o usb9.o boot.o interrupt.o lcd.o main.o

I've tried to search for the offending header(s) and/or linker files but haven't been able to find anything yet. I am using gputils in conjunction with sdcc. It has been working flawlessly since your gputils-1.4.0-1 release. I also use gpasm standalone for some of my work. I haven't tried it with any USB projects yet. I don't think that I have any *.asm code for USB though. The frameworks that I have are for sdcc along with gputils

Thank you for your help!!!

Cheers,

Fred

Discussion

  • Molnár Károly

    Molnár Károly - 2016-08-23
    • assigned_to: Molnár Károly
     
  • Molnár Károly

    Molnár Károly - 2016-08-23

    --extended

    Only incidentally I ask, are you sure that this is necessary for the compilation?

    I've tried to search for the offending header(s) and/or linker files but haven't been able to find anything yet.

    The missing symbols must be in the application code. They can not be found in the standard gputils header.

    Károly

     
  • Fred

    Fred - 2016-08-23

    Yes,

    I searched as you did for the registers mentioned in the error messages. They "ARE" needed for compilation. The registers are USB enpoint registers within the 4550 and it's variants. What the usbmmmap.c code does is map structures to the internal 18f4550 registers. My question is why does it work in the previous version with a correctly working *.hex file but not in this version?

    Cheers,

    Fred

     
  • Molnár Károly

    Molnár Károly - 2016-08-24

    This is one file not enough to cause the error. I need as many source code which comes out of the problem. There are still some questions:
    1.) The sdcc version.
    2.) The sdcc installed from package from repository, or compiled on the own machine?

    Károly

     
  • Molnár Károly

    Molnár Károly - 2016-09-11

    I can not reproduce this error.

    Károly

     
  • Fred

    Fred - 2016-09-11

    Károly,

    My apologies for not following up on this sooner. I had let things slip due to personal and work issues. I have gathered up the offending code and have attached it here. Sorry for my "spaghetti" code. I am an engineer (not software engineer in any respects) and not a software person.

    To recap on this, the code works with 1.4.x but not 1.5.0

    Thank you again for looking at this.

    Regards,

    Fred

     
  • Molnár Károly

    Molnár Károly - 2016-09-12

    I found the cause of error. In the usbmmap.h header there is references to non-existent names. The new gplink manage this is strictly.

    I propose a solution based on the usbmmap.c file:

    #if(0 <= MAX_EP_NUMBER)
    volatile __far BDT ep0Bo;         //Endpoint #0 BD Out
    volatile __far BDT ep0Bi;         //Endpoint #0 BD In
    #endif
    .
    .
    .
    etc
    

    The above way, must use conditional compilation in the usbmmap.h:

    #if(0 <= MAX_EP_NUMBER)
    extern volatile __far BDT ep0Bo;          //Endpoint #0 BD Out
    extern volatile __far BDT ep0Bi;          //Endpoint #0 BD In
    #endif
    .
    .
    .
    etc
    

    Thus eliminating the problem. I appended the modified usbmmap.h file.

    Károly

     
  • Fred

    Fred - 2016-09-12

    Károly,

    Thank you very much for your assistance and patience in resolving this issue. I'm still looking at the changes that you made. I want to understand them, at least in part, for myself. I tried to build the project and it completed without errors. I am also in the process of reviewing the manual for gputils and espsecially gplink.

    I think that this issue can be closed.

    Cheers,

    Fred

     
  • Molnár Károly

    Molnár Károly - 2016-09-12

    I created a correction, that do adjustable the behavior of gplink. [r1285]

    -S [0|1|2], --strict [0|1|2]   Set the strict level of the missing symbol.
        0: This is the default. No message.
        1: Show warning message if there is missing symbol.
        2: Show error message if there is missing symbol.
    

    gputils-1.5.0-1.tar.bz2
    gputils-1.5.0-1.tar.gz
    gputils-1.5.0-1.exe

    The gplink will only warns, if the command line includes these switches:

    "-S1" or "--strict 1"
    "-S2" or "--strict 2"
    

    If these connections are not included on the command line, then the gplink operates the old way. Please try out with the original project.

    Károly

     

    Related

    Commit: [r1285]

  • Fred

    Fred - 2016-09-12

    It works with the original project. At least without the new switches. I am not sure how to pass those to sdcc.

    Thanks Again,

    Fred

     
  • Anonymous

    Anonymous - 2016-09-13

    Exactly the point is that there is no need for the new switches. These will be required only if you need the strict behavior.

    Károly

     
  • Molnár Károly

    Molnár Károly - 2016-09-22
    • status: open --> closed-fixed
     

Anonymous
Anonymous

Add attachments
Cancel