Ich have some older boards with an at91samd21j18, but without xtal.
I use them with USB and like to convert the code wo NuttX.
So far I'd used the Atmel-ASF to setup the clock and for USB stack
under FreeRTOS.
However, after reinspecting I hadn't used the correct clock setup,
which would be using the DFLL with USB SOF as reference clock.
Instead I used the internal 32kHz RC and rasied it with the DFLL.
Nonetheless it worked fine.

On another board I already noticed that something is wrong with the
DFLL under NuttX.
It was a board with XTAL, on which I initially hadn't used the XTAL
and instead raised the internal 8MHz with the DFLL.
On some boards I couldn't use the UART at 115200 bps because the
clock was off.
This was unexpected, since the 8MHz is claimed to be precise.
However, what was more unexpected that I have had exactly the same
offset by using an external 16MHz xtal.
In the end I dropped the DFLL and used the DPLL instead, which worked
fine.

I modified the clock init code to support USB clock recovery and
in didn't work at first.
After modifying some other things I got my 48MHz, at least USB
came up.
Now I have another problem.
USB isn't stable.
I use ACM-TTY and my main routine only loops on printing a counter
and short sleep.
After 1-2minutes USB dies off.
Now I wonder if this is still something clock related or if there
is something else wrong with USB on the SAMD21.

I will do further tests - I have some boards with a 16MHz xtal and
USB connector.
I also never checked if the DFLL has locked or not.
But at this point I'm also open for other peoples experiences.

-- 
B.Walter <be...@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.

Reply via email to