Hi,
I am merging the multilink example and the CDC ACM example in SDK15.
However, if you merge and run it, it will continue to fail.
Here is the source.
#define CDC_Code 1 #define Multi_Code 0 int main(void) { // CDC Code Start #if CDC_Code ret_code_t ret; static const app_usbd_config_t usbd_config = { .ev_state_proc = usbd_user_ev_handler }; ret = NRF_LOG_INIT(NULL); APP_ERROR_CHECK(ret); ret = nrf_drv_clock_init(); APP_ERROR_CHECK(ret); nrf_drv_clock_lfclk_request(NULL); while(!nrf_drv_clock_lfclk_is_running()) { /* Just waiting */ } ret = app_timer_init(); APP_ERROR_CHECK(ret); init_bsp(); init_cli(); app_usbd_serial_num_generate(); ret = app_usbd_init(&usbd_config); APP_ERROR_CHECK(ret); NRF_LOG_INFO("USBD CDC ACM example started."); app_usbd_class_inst_t const * class_cdc_acm = app_usbd_cdc_acm_class_inst_get(&m_app_cdc_acm); ret = app_usbd_class_append(class_cdc_acm); APP_ERROR_CHECK(ret); if (USBD_POWER_DETECTION) { ret = app_usbd_power_events_enable(); APP_ERROR_CHECK(ret); } else { NRF_LOG_INFO("No USB power detection enabled\r\nStarting USB now"); app_usbd_enable(); app_usbd_start(); } #endif // CDC Code End #if Multi_Code // Initialize. log_init(); timer_init(); leds_init(); buttons_init(); power_management_init(); ble_stack_init(); gatt_init(); db_discovery_init(); lbs_c_init(); ble_conn_state_init(); // Start execution. NRF_LOG_INFO("Multilink example started."); scan_start(); #endif for (;;) { #if CDC_Code while (app_usbd_event_queue_process()) { /* Nothing to do */ } if(m_send_flag) { static int frame_counter; size_t size = sprintf(m_tx_buffer, "Hello USB CDC FA demo: %u\r\n", frame_counter); ret = app_usbd_cdc_acm_write(&m_app_cdc_acm, m_tx_buffer, size); if (ret == NRF_SUCCESS) { ++frame_counter; } } nrf_cli_process(&m_cli_uart); UNUSED_RETURN_VALUE(NRF_LOG_PROCESS()); /* Sleep CPU only if there was no interrupt since last loop processing */ __WFE(); #endif #if Multi_Code idle_state_handle(); #endif } }
I have set the CDC and Multilink flags in this way, and each runs separately when run separately. However, if I turn on two flags, an error occurs.
When debugging with kale, the part where the error occurs
init_cli();
Here, an error is seen to occur.
What parts can I fix? Please help me.