It seems that when using the USB-Stack (CDC-Device) the interrupt enable routines in the generated usb1.c are using the wrong NVIC-Registers:
------------------------------ snip ----------------------------------
/* ###################################################################
** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : USB1.c
** Project : ProcessorExpert
** Processor : MK20DN512ZVMD10
** Component : FSL_USB_Stack
** Version : Component 01.024, Driver 01.00, CPU db: 3.00.003
** Compiler : IAR ARM C Compiler
** Date/Time : 2014-03-07, 15:21, # CodeGen: 1
** Abstract :
** This component implements a wrapper to the FSL USB Stack.
** Settings :
** Component name : USB1
** Freescale USB Stack Version : v4.1.1
** USB : Init_USB_OTG_VAR0
** Device Class : CDC Device
** CDC Device : Enabled
** CDCDevice : FSL_USB_CDC_Device
** HID Keyboard Device : Disabled
** MSD Host : Disabled
** Call Init Method : yes
** Contents :
** Init - byte USB1_Init(void);
**
** (c) Copyright Freescale, all rights reserved, 2013.
** Ported as Processor Expert component: Erich Styger
** http: www.mcuoneclipse.com
** ###################################################################*/
/*!
** @file USB1.c
** @version 01.00
** @brief
** This component implements a wrapper to the FSL USB Stack.
*/
/*!
** @addtogroup USB1_module USB1 module documentation
** @{
*/
/* MODULE USB1. */
#include "USB1.h"
#include "derivative.h" /* include peripheral declarations */
#include "types.h" /* Contains User Defined Data Types */
/*
** ===================================================================
** Method : USB1_usb_int_dis (component FSL_USB_Stack)
**
** Description :
** Disables USB interrupts (if supported)
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void USB1_usb_int_dis(void)
{
/* Kinetis K20D50 */
NVICISER1 = (1<<3); /* Enable interrupts from USB module (Interrupt Set-Enable Register) */
}
/*
** ===================================================================
** Method : USB1_usb_int_en (component FSL_USB_Stack)
**
** Description :
** Enables USB interrupts (if supported).
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void USB1_usb_int_en(void)
{
/* Kinetis K20D50 */
NVICICPR1 = (1<<3); /* Clear any pending interrupts on USB (Interrupt Clear-Pending Register) */
NVICISER1 = (1<<3); /* Enable interrupts from USB module (Interrupt Set-Enable Register) */
}
------------------------------ snip ----------------------------------
correct is
void USB1_usb_int_en(void)
{
/* Kinetis K20D50 */
NVICICPR2 = (1<<9); /* Clear any pending interrupts on USB (Interrupt Clear-Pending Register) */
NVICISER2 = (1<<9); /* Enable interrupts from USB module (Interrupt Set-Enable Register) */
}
Best regards
Martin
Hello,
There is released a new solution of USB components (fsl_usb_device_hid_class, fsl_usb_device_msd_class, fsl_usb_framework, fsl_usb_descriptors) that is available in KDS 2.0.0 (with installed Kinetis SDK 1.1.0 Eclipse Update).
If you want to start a development of an application based on fsl_usb_.... components, you can use the Processor Expert Kinetis SDK USB Stack Integration User Guide that is available as a part of the help.
You can open the guide by the following way in KDS 2.0.0 (you must have KSDK 1.1.0 Eclipse Update installed):
- Open Component Library window and find fsl_usb_descriptors component.
- Open the context menu of this component (click by right button of the mouse) and select Help on Component item.
- In the Help window, open the fsl_usb_descriptions page
- The fsl_usb_descriptors help page (General Info tab) contains link to the user guide "USB stack Processor Expert integration documentation" at the bottom of the page.
Best Regards,
Marek Neuzil