debug usb-cdc uart: disable it.
Currently unused. Change-Id: I5f39c0fe82cbfa6f2bc4b84784a7142b461b64fb
This commit is contained in:
parent
648f6309c6
commit
51b2facc66
|
@ -506,8 +506,10 @@ DWT->FUNCTION1 = (0b10 << DWT_FUNCTION_DATAVSIZE_Pos) | /* DATAVSIZE 10 - dw
|
||||||
usb_start();
|
usb_start();
|
||||||
|
|
||||||
board_init();
|
board_init();
|
||||||
command_init("sysmoOCTSIM> ");
|
|
||||||
|
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
|
command_init("sysmoOCTSIM> ");
|
||||||
|
#endif
|
||||||
/* boost uart priority by setting all other irqs to uartprio+1 */
|
/* boost uart priority by setting all other irqs to uartprio+1 */
|
||||||
for(int i = 0; i < PERIPH_COUNT_IRQn; i++)
|
for(int i = 0; i < PERIPH_COUNT_IRQn; i++)
|
||||||
NVIC_SetPriority(i, 2);
|
NVIC_SetPriority(i, 2);
|
||||||
|
|
|
@ -46,17 +46,24 @@ const struct usb_desc_collection usb_fs_descs = {
|
||||||
.bLength = sizeof(struct usb_config_desc),
|
.bLength = sizeof(struct usb_config_desc),
|
||||||
.bDescriptorType = USB_DT_CONFIG,
|
.bDescriptorType = USB_DT_CONFIG,
|
||||||
.wTotalLength = sizeof(usb_fs_descs.cfg) +
|
.wTotalLength = sizeof(usb_fs_descs.cfg) +
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
sizeof(usb_fs_descs.cdc) +
|
sizeof(usb_fs_descs.cdc) +
|
||||||
|
#endif
|
||||||
sizeof(usb_fs_descs.ccid) +
|
sizeof(usb_fs_descs.ccid) +
|
||||||
sizeof(usb_fs_descs.dfu_rt) +
|
sizeof(usb_fs_descs.dfu_rt) +
|
||||||
sizeof(usb_fs_descs.func_dfu),
|
sizeof(usb_fs_descs.func_dfu),
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
.bNumInterfaces = 4,
|
.bNumInterfaces = 4,
|
||||||
|
#else
|
||||||
|
.bNumInterfaces = 2,
|
||||||
|
#endif
|
||||||
.bConfigurationValue = CONF_USB_CDCD_ACM_BCONFIGVAL,
|
.bConfigurationValue = CONF_USB_CDCD_ACM_BCONFIGVAL,
|
||||||
.iConfiguration = STR_DESC_CONFIG,
|
.iConfiguration = STR_DESC_CONFIG,
|
||||||
.bmAttributes = CONF_USB_CDCD_ACM_BMATTRI,
|
.bmAttributes = CONF_USB_CDCD_ACM_BMATTRI,
|
||||||
/* FIXME: The device should offer at least one 100mA configuration. */
|
/* FIXME: The device should offer at least one 100mA configuration. */
|
||||||
.bMaxPower = 250, /* request 500mA */
|
.bMaxPower = 250, /* request 500mA */
|
||||||
},
|
},
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
.cdc = {
|
.cdc = {
|
||||||
.comm = {
|
.comm = {
|
||||||
.iface = {
|
.iface = {
|
||||||
|
@ -139,6 +146,7 @@ const struct usb_desc_collection usb_fs_descs = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
#endif
|
||||||
.ccid = {
|
.ccid = {
|
||||||
.iface = {
|
.iface = {
|
||||||
.bLength = sizeof(struct usb_iface_desc),
|
.bLength = sizeof(struct usb_iface_desc),
|
||||||
|
@ -208,7 +216,11 @@ const struct usb_desc_collection usb_fs_descs = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
DFURT_IF_DESCRIPTOR(3, STR_DESC_INTF_DFURT),
|
DFURT_IF_DESCRIPTOR(3, STR_DESC_INTF_DFURT),
|
||||||
|
#else
|
||||||
|
DFURT_IF_DESCRIPTOR(1, STR_DESC_INTF_DFURT),
|
||||||
|
#endif
|
||||||
.str = {
|
.str = {
|
||||||
#if 0
|
#if 0
|
||||||
CDCD_ACM_STR_DESCES
|
CDCD_ACM_STR_DESCES
|
||||||
|
|
|
@ -43,6 +43,7 @@ struct usb_desc_collection {
|
||||||
struct usb_dev_desc dev;
|
struct usb_dev_desc dev;
|
||||||
struct usb_config_desc cfg;
|
struct usb_config_desc cfg;
|
||||||
|
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
/* CDC-ACM: Two interfaces, one with IRQ EP and one with BULK IN + OUT */
|
/* CDC-ACM: Two interfaces, one with IRQ EP and one with BULK IN + OUT */
|
||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
|
@ -59,6 +60,7 @@ struct usb_desc_collection {
|
||||||
} data;
|
} data;
|
||||||
} cdc;
|
} cdc;
|
||||||
|
|
||||||
|
#endif
|
||||||
/* CCID: One interface with CCID class descriptor and three endpoints */
|
/* CCID: One interface with CCID class descriptor and three endpoints */
|
||||||
struct {
|
struct {
|
||||||
struct usb_iface_desc iface;
|
struct usb_iface_desc iface;
|
||||||
|
|
|
@ -132,14 +132,14 @@ void cdc_device_acm_init(void)
|
||||||
usbdc_init(ctrl_buffer);
|
usbdc_init(ctrl_buffer);
|
||||||
usbdc_register_handler(USBDC_HDL_REQ, &string_req_h);
|
usbdc_register_handler(USBDC_HDL_REQ, &string_req_h);
|
||||||
|
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
/* usbdc_register_funcion inside */
|
/* usbdc_register_funcion inside */
|
||||||
cdcdf_acm_init();
|
cdcdf_acm_init();
|
||||||
|
#endif
|
||||||
dfudf_init();
|
dfudf_init();
|
||||||
|
|
||||||
printf("usb_descs_size=%u\r\n", usb_descs[0].eod - usb_descs[0].sod);
|
printf("usb_descs_size=%u\r\n", usb_descs[0].eod - usb_descs[0].sod);
|
||||||
usbdc_start((struct usbd_descriptors *) usb_descs);
|
|
||||||
usbdc_attach();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,15 +147,22 @@ void cdc_device_acm_init(void)
|
||||||
*/
|
*/
|
||||||
void usb_start(void)
|
void usb_start(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef WITH_DEBUG_CDC
|
||||||
while (!cdcdf_acm_is_enabled()) {
|
while (!cdcdf_acm_is_enabled()) {
|
||||||
// wait cdc acm to be installed
|
// wait cdc acm to be installed
|
||||||
};
|
};
|
||||||
|
|
||||||
cdcdf_acm_register_callback(CDCDF_ACM_CB_STATE_C, (FUNC_PTR)usb_device_cb_state_c);
|
cdcdf_acm_register_callback(CDCDF_ACM_CB_STATE_C, (FUNC_PTR)usb_device_cb_state_c);
|
||||||
|
#endif
|
||||||
|
while (!ccid_df_is_enabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
void usb_init(void)
|
void usb_init(void)
|
||||||
{
|
{
|
||||||
cdc_device_acm_init();
|
cdc_device_acm_init();
|
||||||
ccid_df_init();
|
ccid_df_init();
|
||||||
|
usbdc_start((struct usbd_descriptors *) usb_descs);
|
||||||
|
usbdc_attach();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue