You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by TimH <ti...@jti.uk.com.INVALID> on 2022/09/07 11:14:17 UTC

SAMA5D2 DMA

A quick dabble with DMA for the SAMA5D2 chip I'm using suggests the native
NuttX support for this is incorrect and probably applies to SAMA5D3 chips
etc. There are refences in sam_xdmac.c to PIDS that simply don't exist in
the SAMA5D2.

 

Can anyone confirm -  or correct me if I'm wrong?


RE: SAMA5D2 DMA

Posted by TimH <ti...@jti.uk.com.INVALID>.
>From: Nathan Hartman <ha...@gmail.com>
>Sent: 09 September 2022 12:50
>To: dev@nuttx.apache.org
>Subject: Re: SAMA5D2 DMA
>
>> Rather than clutter sam_xdmac.h with loads of #if defined (SAMA5D2)
>> stuff would it be better to deal with this in the same way as the
>> memory and pinmap files, etc, and have:
>>
>> _sama5d2x_xdmac.h
>> _sama5d3x_xdmac.h
>> _sama5d4x_xdmac.h
>>
>> Then change sam_xdmac.h to have the more easy to follow
>>
>> #if defined(SAMA5D2)
>> #  include "hardware/_sama5d2x_xdmac.h"
>> #elif
>> etc
>>
>> I think that's neater?
>
>
>
>I think so. The #if defined stuff makes sense when parts are mostly identical
>but if there's so much of it that it makes the file hard to read, then splitting it
>up makes more sense.
>

Thanks - once I start sorting this out I'll see how many differences there really are and choose the methodology based on that.


Re: SAMA5D2 DMA

Posted by Nathan Hartman <ha...@gmail.com>.
On Fri, Sep 9, 2022 at 7:44 AM TimH <ti...@jti.uk.com.invalid> wrote:

> >From: TimH <ti...@jti.uk.com>
> >Sent: 07 September 2022 12:14
> >
> >A quick dabble with DMA for the SAMA5D2 chip I'm using suggests the native
> >NuttX support for this is incorrect and probably applies to SAMA5D3 chips
> etc.
> >There are refences in sam_xdmac.c to PIDS that simply don't exist in the
> >SAMA5D2.
> >
> On further inspection it seems sam_xdmac.h is only describing the
> configuration of a SAMA5D4. The SAMA5D3 and SAMA5D2 have different numbers
> of channels and different channel definitions
>
> Rather than clutter sam_xdmac.h with loads of #if defined (SAMA5D2) stuff
> would it be better to deal with this in the same way as the memory and
> pinmap files, etc, and have:
>
> _sama5d2x_xdmac.h
> _sama5d3x_xdmac.h
> _sama5d4x_xdmac.h
>
> Then change sam_xdmac.h to have the more easy to follow
>
> #if defined(SAMA5D2)
> #  include "hardware/_sama5d2x_xdmac.h"
> #elif
> etc
>
> I think that's neater?



I think so. The #if defined stuff makes sense when parts are mostly
identical but if there's so much of it that it makes the file hard to read,
then splitting it up makes more sense.

Cheers
Nathan

RE: SAMA5D2 DMA

Posted by TimH <ti...@jti.uk.com.INVALID>.
>From: TimH <ti...@jti.uk.com>
>Sent: 07 September 2022 12:14
>
>A quick dabble with DMA for the SAMA5D2 chip I'm using suggests the native
>NuttX support for this is incorrect and probably applies to SAMA5D3 chips
etc.
>There are refences in sam_xdmac.c to PIDS that simply don't exist in the
>SAMA5D2.
>
On further inspection it seems sam_xdmac.h is only describing the
configuration of a SAMA5D4. The SAMA5D3 and SAMA5D2 have different numbers
of channels and different channel definitions

Rather than clutter sam_xdmac.h with loads of #if defined (SAMA5D2) stuff
would it be better to deal with this in the same way as the memory and
pinmap files, etc, and have:

_sama5d2x_xdmac.h
_sama5d3x_xdmac.h
_sama5d4x_xdmac.h

Then change sam_xdmac.h to have the more easy to follow

#if defined(SAMA5D2)
#  include "hardware/_sama5d2x_xdmac.h"
#elif
etc

I think that's neater?