[SOLVED] undefined reference to cdc_cli_output

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm running the SAMG55 demo board and I'm trying to use the CDC CLI instead of the USART CLI. In conf_example.h, I uncommented confINCLUDE_CDC_CLI and now there are two build errors:

undefined reference to 'cdc_cli_output'
undefined reference to 'create_usb_cdc_cli_task'

 

I searched for both functions and I was able to confirm they aren't included in the project. In the ASF wizard, I included everything I can find that mentions UART, USART, and USB and it still can't find the functions. I found the create function in the online documentation (albeit for the SAM4S...) here.

 

As an aside, there's also a warning that says SAMG55 is not defined. Is this warning significant?

 

Why does it seem like every time I try to use an Atmel ASF example it doesn't work and/or isn't complete?

 

=-=-=-=-=-=-=-=-=

 

Edit: See my response below for a workaround. Here's a link to the bug.

This topic has a solution.
Last Edited: Sun. Jul 5, 2015 - 07:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm never sure if this is the "official" respository or someone's copy of it but there appears to be ASF online here:

 

https://github.com/avrxml/asf/tr...

 

When I search for your function I find these search results:

 

https://github.com/avrxml/asf/se...

 

The actual implementation seems to be here:

 

https://github.com/avrxml/asf/bl...

 

But that just seems to be part of a FreeRTOS demo, not the main library?!?

 

i do wish Atmel would put a clean copy of their git repository for ASF online somewhere so it would be possible to search for missing functions/symbols to get an idea of which module(s) it is you need to include when something is undefined.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for those links. Unfortunately, I've included everything related to FreeRTOS in my project and I still don't have those files in my project folders. The documentation in main.c doesn't say anything helpful either:

 

 * ************* USB/CDC Command Console using FreeRTOS+CLI ********************
 *
 * - Functionality -
 *
 * The functionality is exactly as that described for the USART command console
 * above.  Only the communication interface is different.  The standard ASF USB
 * CDC driver is used as a virtual com port.
 *
 * - Software Configuration -
 *
 * The USB/CDC command console example is created if the confINCLUDE_CDC_CLI
 * constant is defined.  confINCLUDE_CDC_CLI can be defined in conf_example.h.
 *
 * You may be asked to install a USB driver the first time the host computer is
 * plugged into the target.  The file atmel_devices_cdc.inf is provided with
 * this demo for this purpose.  Select the provided atmel_devices_cdc.inf file
 * if the install new hardware wizard executes on the host computer when the USB
 * cable is inserted.
 *
 * - Hardware Setup -
 *
 * The virtual com port was tested with the following settings:  115200 baud, 8
 * data bits, no parity, one stop bit, and no flow control.  The settings might
 * not be critical.
 *

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is Atmel's response:

 

Hello, 

We are able to reproduce the issue at our end and we have reported this to the concerned team. 

In the meanwhile, as a workaround you can add the USB-CDC-CLI-task.c file manually, which is available under thirdparty\freertos\demo\peripheral_control\demo-tasks in ASF Standalone package (http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx) 

Sorry for the inconvenience caused.

 

I was able to get it to work after adding the file manually. I hope this helps someone and thanks Clawson (and Atmel) for the workaround.

Last Edited: Mon. May 18, 2015 - 03:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well that's the same file I linked to above - did you not try it when I suggested it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Well that's the same file I linked to above - did you not try it when I suggested it?

 

Yes and it worked, but I forgot to post until I got a response from Atmel. Thanks for your help. I updated my previous post to give you credit for the workaround as you came up with it first. I just wanted to post Atmel's response as confirmation that it's really broken.

Last Edited: Mon. May 18, 2015 - 03:23 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I gave up on this until this morning. It occurred to me while I was eating a grilled cheese sandwich I should double check that the CDC CLI task was actually processing characters. Well, it wasn't. After I searched for cdc_new_data_semaphore and found it in cli_cdc_rx_notify (a function in USB-CDC-CLI-task.c), I couldn't find it anywhere else in the project. I googled that function name and found this:

 

#define  UDI_CDC_ENABLE_EXT(port)               cli_cdc_enable(port)
#define  UDI_CDC_DISABLE_EXT(port)              cli_cdc_disable(port)
#define  UDI_CDC_RX_NOTIFY(port)                cli_cdc_rx_notify(port)

Ah ha! The file that comes with ASF 3.24.x looks like this:

 

#define  UDI_CDC_ENABLE_EXT(port)       true
#define  UDI_CDC_DISABLE_EXT(port)
#define  UDI_CDC_RX_NOTIFY(port)

 

After I added the definitions from the first code snippet to my project, the CLI worked. A working project is attached in case someone else is having issues with this.

Attachment(s): 

Last Edited: Sun. Jul 5, 2015 - 07:37 PM