Today 17:12
Forum: Proton Plus Compiler v3
Starter: johngb
Views: 0
Replies: 13
Today 17:08
Forum: Proton Plus Compiler v3
Starter: joesaliba
Views: 0
Replies: 7
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Junior Member mitch's Avatar
    Join Date
    Oct 2014
    Posts
    6
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    225.29 MB

    0 Not allowed!

    Default USB HID Bootloader compile error with 18F47J53

    I am delighted that the 18F47J53 has been added to the list of supported devices. I have previously been using the 18F46J50 without problems but run out of code space.

    I am trying to compile a HID boot-loader for this device and keep getting the error message: ERROR: Not enough user RAM for all the variables. Reduce the amount, or switch to a larger device.

    Exactly the same code (with different processor declare and appropriate config. settings) has previously compiled and worked fine on the 18F46J50.

    The 18F47J53 has slightly more RAM than the 18F46J50 so there must be a setting or definition somewhere which is wrong.

    The latest .def file includes: &Define _RAM 3840 ' Amount of RAM. The 18F46J50 has 3774 so cannot see why I am getting the error message.

    I have also compiled a much larger programme for the 18F47J53 with most of the available RAM used and that compiled fine so it looks like something in the USB/HID routines.

    Any thoughts on this gratefully received.
    -------------------
    Malcolm Mitchell

  2. #2
    Junior Member mitch's Avatar
    Join Date
    Oct 2014
    Posts
    6
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    225.29 MB

    0 Not allowed!

    Default Re: USB HID Bootloader compile error with 18F47J53

    With help from Tim Box I have identified the cause of one of my problems following a comparison of the 18F46J50 and 18F47J53 .def files.

    The USB memory definition appeared to be missing so I added it to the 'Device Information' section:

    $define _usb_ram 1024 ' Start of the USB dual Port RAM (define only available for USB devices)

    This at least got rid of the previous error message and allowed the code to compile.

    While reviewing the .def file I noticed that the ADC resolution is defined as: $define _adcres 10 ' Resolution of ADC (in bits).

    In fact the 18F47J53 can perform both 10 and 12 bit resolution. I would like to use the higher resolution in my application so (if) once I have it working will post an update.
    -------------------
    Malcolm Mitchell

  3. #3
    Junior Member mitch's Avatar
    Join Date
    Oct 2014
    Posts
    6
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    225.29 MB

    0 Not allowed!

    Default Re: USB HID Bootloader compile error with 18F47J53

    I have now made progress in getting the USB Boot-loader to work with this device.

    For some reason with this device the Buffer Descriptors and USB Buffers are located higher in the memory bank than similar devices. Bank 13 (D00h through DFFh) is used specifically for endpoint buffer control. (This is 400h for the similar 18f46j50).

    In the 'Device Information Definitions' section of the .def file I added:

    $Define _usb_ram 3228 ' Start of USB Dual port RAM

    In the 'Device Information Definitions' section of the .ppi file I changed the USB Ram statement to:

    USBRAM=0xD00 ; Start Address of Dual Port USB RAM.

    In addition, the code for using the HID routines needs it address pointers changed to DWord to accommodate the increased address space.

    Also unless declared elsewhere the code should include:

    Declare Available_RAM = _ram ' Adjust the amount of RAM the device contains

    otherwise the compiler is likely to advise that it has insufficient RAM to compile the program.

    There are still a number of things I am sorting out with my code for this chip but at least I have now got the boot-loader working.
    -------------------
    Malcolm Mitchell

  4. #4
    Junior Member mitch's Avatar
    Join Date
    Oct 2014
    Posts
    6
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    225.29 MB

    0 Not allowed!

    Default Re: USB HID Bootloader compile error with 18F47J53

    There is an error in my previous post.

    In the 'Device Information Definitions' section of the .def file it should read:

    $Define _usb_ram 3328 ' Start of USB Dual port RAM (0xD00 = 3328)

    Complete update for the .def file is:

    ' Modified by Malcolm Mitchell 16/10/2017 ###
    '
    $ifndef _18F47J53_
    $define _18F47J53_
    ' Device Information
    $define _device _18F47J53
    $define _core 16
    $define _ram 3840 ' Amount of RAM
    $define _code 131072 ' Amount of Flash Memory
    $define _eeprom 0 ' Amount of Eeprom Memory
    $define _ports 5 ' Amount of Ports
    $define _debug 1 ' Whether the device has Debug capabilities
    $define _block 64 ' Size of the Code Memory Write Segment (in Bytes)
    $define _mssp 2 ' 0 = None, 1 = Single MSSP, 2 = Dual MSSP, 3 = SSP Only ### (was _mssp 1)
    $define _flash 1 ' Whether the device has Self Modifying support. 0 = No, 1 = Read and Write, 2 = Read no Write
    $define _usb 1 ' Amount of USBs
    $define _uart 2 ' Amount of UARTs
    $define _adcres 12 ' Resolution of ADC (in bits) ### (was _adcres 10)
    $define _adc 13 ' Amount of ADC channels
    $define _usb_ram 3328 ' Start of the USB dual Port RAM (define only available for USB devices) ###

    Complete update for the .ppi file is:

    Edited by Malcolm Mitchell 16/10/2017 ###
    Device Information Definitions
    [INFOSTART]
    CORE=16 ; Core Type: 12, 14, or 16
    MAXRAM=3840 ; Amount of RAM
    MAXCODE=131072 ; Amount of Code Memory (in Bytes)
    PORTS=5 ; Amount of Ports
    ADC=13 ; Amount of ADCs
    ADRES=12 ; Resolution of the ADC ### (was ADRES=10)
    EEPROM=0 ; Amount of On-Board Eeprom (in Bytes)
    RAM_BANKS=15 ; Amount of RAM Banks
    BANKA_END=0x5F ; Address of the End of Access RAM
    UART=2 ; Amount of UARTs. 0, 1, or 2
    USB=1 ; Whether the device has USB capabilities
    USBRAM=0xD00 ; Start address of Dual Port USB RAM ### (was USBRAM=0x400)
    FLASH_WRITE=1 ; Whether the device has Self Modifying support. 0 = No, 1 = Read and Write, 2 = Read, but no Write
    MSSP=2 ; 0 = None, 1 = Single MSSP, 2 = Dual MSSP, 3 = SSP Only ### (was MSSP=1)
    HPWM=2 ; Amount of PWM channels (supported by the compiler)
    BLOCK=64 ; Size of the Code Memory Write Segment (in Bytes)
    ERASE=1024 ; Size of the Code Memory Erase Segment (in Bytes)
    DEBUG=1 ; Whether the Device has Debug Capabilities (1 or 0)
    [INFOEND]
    -------------------
    Malcolm Mitchell

  5. #5
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,329
    Thumbs Up
    Received: 49
    Given: 123
    Total Downloaded
    2.37 GB

    1 Not allowed!

    Default Re: USB HID Bootloader compile error with 18F47J53

    Do you now have a working USB bootloader?

    If so, could you post code?
    George

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 8
    Last Post: 7th May 2014, 00:45
  2. Error during Compile
    By deaskew in forum Absolute Beginners Section
    Replies: 4
    Last Post: 18th March 2013, 01:02
  3. Compile error
    By SimonGie in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 23rd November 2009, 19:04
  4. Error On compile
    By Tim in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 29th December 2006, 14:42
  5. Compile Error
    By rbihler in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 8th December 2004, 14:53

Members who have read this thread since 2nd November 2017, 02:57 : 1

Actions :  (Set Date)  (Clear Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts