Hot!CDC source code generated using MLA USB Device Lite

Author
i4cy
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2014/03/25 05:22:23
  • Location: 0
  • Status: offline
2018/02/14 07:14:22 (permalink)
0

CDC source code generated using MLA USB Device Lite

I was unable to make the code generated using MLA USB Device Lite work as a simple CDC device. However the problem was resolved after including "fixed_address_memory.h" in usb_device_cdc.c. Clearly this is required otherwise the tx and rx buffers will not be assigned to the correct USB RAM locations.
 
/** I N C L U D E S **********************************************************/
#include "usb.h"
#include "usb_device_cdc.h"

// IMPORTANT - This file must be included manually as MCC does not include it.
#include "fixed_address_memory.h"

#ifdef USB_USE_CDC

#ifndef FIXED_ADDRESS_MEMORY
    #define IN_DATA_BUFFER_ADDRESS_TAG
    #define OUT_DATA_BUFFER_ADDRESS_TAG
    #define CONTROL_BUFFER_ADDRESS_TAG
#endif

#if !defined(IN_DATA_BUFFER_ADDRESS_TAG) || !defined(OUT_DATA_BUFFER_ADDRESS_TAG) || !defined(CONTROL_BUFFER_ADDRESS_TAG)
    #error "One of the fixed memory address definitions is not defined. Please define the required address tags for the required buffers."
#endif

/** V A R I A B L E S ********************************************************/
volatile unsigned char cdc_data_tx[CDC_DATA_IN_EP_SIZE] IN_DATA_BUFFER_ADDRESS_TAG;
volatile unsigned char cdc_data_rx[CDC_DATA_OUT_EP_SIZE] OUT_DATA_BUFFER_ADDRESS_TAG;


 
Thanks.
post edited by i4cy - 2018/02/14 07:18:03
#1

4 Replies Related Threads

    katela
    Super Member
    • Total Posts : 707
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: CDC source code generated using MLA USB Device Lite 2018/02/14 07:38:43 (permalink)
    0
    Thanks for sharing your experience.
    Maybe you can also specify the USB Device Lite version you used.
     

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    Youtube Tutorials: http://www.youtube.com/user/StudentCompanionSA/videos
    #2
    i4cy
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2014/03/25 05:22:23
    • Location: 0
    • Status: offline
    Re: CDC source code generated using MLA USB Device Lite 2018/02/14 08:10:26 (permalink)
    0
    MPLAB
    katela
    Thanks for sharing your experience.
    Maybe you can also specify the USB Device Lite version you used.
     



    Problem encountered while using Microchip Code Configurator (MCC)
    Version: 3.45.1
    #3
    beans
    Moderator
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2016/06/16 15:32:27
    • Location: 0
    • Status: offline
    Re: CDC source code generated using MLA USB Device Lite 2018/02/14 15:33:35 (permalink)
    0
    That is the version of MCC, but not the version of the USB Framework Lite. The Latest version of USB Framework Lite 1.25.5 should correct this issue. You can see which version is loaded in the lower left Versions pane of MCC.
    #4
    i4cy
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2014/03/25 05:22:23
    • Location: 0
    • Status: offline
    Re: CDC source code generated using MLA USB Device Lite 2018/02/15 01:48:49 (permalink)
    0
    Thanks @beans. I was in fact running USB Framework Lite v1.25.2, but after loading v1.25.5 the problem was fixed.
     
    MCC code generation includes the required "fixed_address_memory.h" header in "usb_hal_pic18.h".
     
    #5
    Jump to:
    © 2018 APG vNext Trial Version 4.5