Can't add USB CDC in start tool, "not enough resources"

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

Hi All,

 

I'm just starting with SAMD21 Xplained Pro kit and 'Start' online tool, but have plenty of experience with mcu's in general and other tools.

 

I've tried to load some USB CDC examples but the start tool complains that it can't load some components, so I've tried to build an example from scratch, however when I try to add the USB CDC middleware, I get message "not enough resources".

 

- start new project

- configure pins required

- add USB driver

- configure clocks, 48MHz from PLL going through clk generator to USB device

- try to add USB CDC middleware -> message "not enough resources" at bottom of add components dialog, and doesn't allow ,me to add component.

 

I just want to get a basic USB serial echo going as an example so I can build my app from there. I don't really want to use ASF as I'm trying to use minimal resources and have read lots of posts suggesting this uses significant amounts of memory.

 

I've gone through the user guide and tutorials, as well as quick search of forums but to no avail. Is anyone able to help?

 

Thanks in advance

Andrew

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

You might be able to use Arduino zero code to grt you going. It uses a sam d21

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

Kartman wrote:
You might be able to use Arduino zero code to grt you going. It uses a sam d21

 

Hopefully - you may know where I can look for help?

 

I am trying implement a simple USB CDC host using Atmel Studio and ASF targeting an Arduino Zero pro card.

But I cannot find a single example to get the application going. I have used the ASF Wizard and read the AT09331: ASF USB Stack Manual.

If I follow the steps outlined in chapter 9.2.1.2 Usage Steps, the result are loads of errors.

If I do not modify the  conf_usb_host.h file, all compiles and links fine but nothing happens because I do not know how to code my first tests!

I do not know where to interface my application to the ASF code - and how to test.

 

Please help..

 

 

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

Try adding the USB middleware FIRST.  In a classic dependency-based scheme, if you were to configure the UART pins first (for example- probably a bad example), the CDC stack would have no way of knowing that you had in mind using those uart pins for the CDC instance, and might decide that it couldn't be done.)

 

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

Thanks for your reply!

 

Yes, I have added the required ASF modules and followed the Setup Steps in this document

http://asf.atmel.com/docs/latest...

which I believe is the correct one (there are a few, but this is for samd21).

 

If I try to add my callback function 

bool my_callback_cdc_change(uhc_device_t* dev, bool b_plug)

as described in this document, a load of errors are generated.

 

Something is wrong. I guess I have to read the code and figure out myself as I cannot find any workable way in the documents available.

My main() function looks like this for the time beeing, uhc_start() returns OK.

 

int main (void)
{
    system_init();
    irq_initialize_vectors();
    cpu_irq_enable();
    system_interrupt_enable_global();
    uhc_start();

 

But how to tap into its callbacks?

Any ideas apart from re-engineering the ASF code?