You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Adam Feuer <ad...@starcat.io> on 2019/12/27 00:10:27 UTC

Booting NuttX on SAMA5D27-XULT

Hi,

I can compile and boot NuttX on the SAMA5D27-XULT if I disable the DBGU.
There is no DBGU serial port on this chip. On the SAMA5D27-XULT this
appears to be connected to UART2 via a factory programmed AT32UC3A4256HHB.

In the menuconfig system I looked for a way to get an NSH prompt on UART2,
but didn't find it. Is there a way to do that? If so, how? Or can I put an
NSH prompt on a USB interface?

cheers
adam

-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Gregory Nutt <sp...@gmail.com>.
> Does NSH wait for an interrupt from the UART to read data? If so, maybe the
> SAMA5D27 isn't interrupting. I tried to enable PIOD interrupts, since UART2
> is on PIOD, but got some compilation errors. I'll look at it more tomorrow.

Yes, if you don't have RX interrupts, nothing will be read.  If you 
don't have interrupts there is probably an error in either the pin 
configuration or IRQ number used.



Re: Booting NuttX on SAMA5D27-XULT

Posted by Gregory Nutt <sp...@gmail.com>.
> Looks like the SAMA5D2x PIO controller differs from the SAMA5D3x and D4x
> PIO controllers. So the PIO/ISR configuration probably needs to be updated.
> I'm giving this a shot, but not sure how best to tackle this. Should I look
> at the Linux4SAM code? Or is reading the datasheet the best way to go?
> Deciphering that is pretty slow going.

I would not recommend looking at Linux code at all.  First, Linux is to 
complex to follow the logic and second, it is GPL so you are permitted 
to leverage anything from there due to the license:  I would look at the 
IRQ number and the RX pin configuation.




Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Greg,

This Microchip Atmel Github repo atmel-software-package
<https://github.com/atmelcorp/atmel-software-package> has a bunch of
example code for configuring the PIOs and interrupts for SAMA5D2 and
SAMA5D3. It's seems different from the NuttX SAMA5 D2 and D3/D4 code.

From looking at this repo, D2, D3, and D4 chips seem to use an AIC5
interrupt controller unit, just with different offsets. So the interrupt
code could follow the Atmel aic5.c
<https://github.com/atmelcorp/atmel-software-package/blob/master/drivers/irq/aic5.c>
driver file. I tried to compile the code but am getting link errors about
my elf executables not using VFP while the other files are. I'll try to
track that down.

The USART example
<https://github.com/atmelcorp/atmel-software-package/blob/master/examples/usart/main.c>shows
that interrupts need to be enabled, so it does seem that this is probably
the problem with the serial port not getting any input data– its USART
interrupts are probably not initialized.

Do you have any ideas, comments, or thoughts? Am I going in the right
direction?

cheers
adam

On Fri, Dec 27, 2019 at 11:42 AM Adam Feuer <ad...@starcat.io> wrote:

> Looks like the SAMA5D2x PIO controller differs from the SAMA5D3x and D4x
> PIO controllers. So the PIO/ISR configuration probably needs to be updated.
> I'm giving this a shot, but not sure how best to tackle this. Should I look
> at the Linux4SAM code? Or is reading the datasheet the best way to go?
> Deciphering that is pretty slow going.
>
> cheers
> adam
>
> On Fri, Dec 27, 2019 at 1:04 AM Adam Feuer <ad...@starcat.io> wrote:
>
>> Does NSH wait for an interrupt from the UART to read data? If so, maybe
>> the SAMA5D27 isn't interrupting. I tried to enable PIOD interrupts, since
>> UART2 is on PIOD, but got some compilation errors. I'll look at it more
>> tomorrow.
>>
>> cheers
>> adam
>>
>> On Thu, Dec 26, 2019 at 11:46 PM Adam Feuer <ad...@starcat.io> wrote:
>>
>>> I got this to appear on UART2:
>>>
>>> NuttShell (NSH)
>>>> Welcome to NuttX on the SAMA5D27-XULT :)
>>>> nsh>
>>>>
>>>
>>> But it doesn't accept any input.
>>>
>>> Here's the changes I had to do to make it get this far:
>>>
>>>
>>> https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements
>>>
>>> So NSH seems to be able to send output, but not read input. Any ideas
>>> about this...?
>>>
>>> I guess to prepare for the GiantBoard I should try to get the NSH
>>> console onto one of the FlexComs...
>>>
>>> cheers
>>> adam
>>>
>>> On Thu, Dec 26, 2019 at 6:42 PM Adam Feuer <ad...@starcat.io> wrote:
>>>
>>>> Greg,
>>>>
>>>> Ok, I wired up an FTDI USB converter to UART0... PB27 (UTXD0) and PB26
>>>> (UTXR0). That also didn't work. Hmmmm.
>>>>
>>>> I'll think about it some more. Thanks again for the help.
>>>>
>>>> cheers
>>>> adam
>>>>
>>>> On Thu, Dec 26, 2019 at 6:30 PM Gregory Nutt <sp...@gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>> > Ok, I used the menuconfig system to set the serial console to UART1,
>>>>> 57600
>>>>> > baud rate.
>>>>> >
>>>>> > The system boots, hits the nsh_main breakpoint, I can continue to
>>>>> fputs,
>>>>> > and then if I continue, then break, the system stops in the idle
>>>>> loop. So
>>>>> > it seems like it's running, but the serial console isn't working, at
>>>>> least
>>>>> > on the DEBUG port. If I boot into Linux, I can get a console login
>>>>> on the
>>>>> > DEBUG port at 115200 baud.
>>>>> >
>>>>> > When I boot NuttX, I don't get any response from the serial
>>>>> terminal. I can
>>>>> > see I'm transmitting because the lights on my FTDI console blink.
>>>>> >
>>>>> > The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's
>>>>> what
>>>>> > the embedded debugger is connected to... so I'm confused.
>>>>> >
>>>>> > Any more ideas?
>>>>>
>>>>> Not really.
>>>>>
>>>>> It is in the IDLE loop because there is nothing to do.  This is a
>>>>> symptom of UART1 no working as it is supposed to.  There are a few
>>>>> things to check.  Usually the problem is with pin configuration or
>>>>> with
>>>>> jumper settings
>>>>>
>>>>> First, check the jumpers.  In 5.4.14 it looks like you would need:
>>>>>
>>>>> Pin J9 *NOT* tied to ground
>>>>> Jumper JP1 *NOT* installed
>>>>> Jumper JP2 DEBUG_DIS ON
>>>>>
>>>>> Then double check the pin configurations.
>>>>>
>>>>> In the schematic, I see that the connection to the CDC/ACM VCOM is via
>>>>> DBGU_UXTD1_PD3 and
>>>>> DBGU_URXD1_PD2.
>>>>>
>>>>> The UART1 pins must defined in the board.h file.  I see
>>>>>
>>>>> #define PIO_UART1_RXD  PIO_UART1_RXD_1
>>>>> #define PIO_UART1_TXD  PIO_UART1_TXD_1
>>>>>
>>>>> And if I look in arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h, I see
>>>>>
>>>>> PIO_UART1_RXD_1 is pin PD2
>>>>> PIO_UART1_TXD_1 is pin PD3
>>>>>
>>>>> So that looks okay.
>>>>>
>>>>> You can try UART2 if you like.  Sometimes EDGB VCOM interfaces are
>>>>> mysterious.  On UART2 you could at least look at what is the TX pin to
>>>>> see if anything is coming out.  Careful with pin configurations!
>>>>>
>>>>> Greg
>>>>>
>>>>>
>>>>
>>>> --
>>>> Adam Feuer <ad...@starcat.io>
>>>>
>>>
>>>
>>> --
>>> Adam Feuer <ad...@starcat.io>
>>>
>>
>>
>> --
>> Adam Feuer <ad...@starcat.io>
>>
>
>
> --
> Adam Feuer <ad...@starcat.io>
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Looks like the SAMA5D2x PIO controller differs from the SAMA5D3x and D4x
PIO controllers. So the PIO/ISR configuration probably needs to be updated.
I'm giving this a shot, but not sure how best to tackle this. Should I look
at the Linux4SAM code? Or is reading the datasheet the best way to go?
Deciphering that is pretty slow going.

cheers
adam

On Fri, Dec 27, 2019 at 1:04 AM Adam Feuer <ad...@starcat.io> wrote:

> Does NSH wait for an interrupt from the UART to read data? If so, maybe
> the SAMA5D27 isn't interrupting. I tried to enable PIOD interrupts, since
> UART2 is on PIOD, but got some compilation errors. I'll look at it more
> tomorrow.
>
> cheers
> adam
>
> On Thu, Dec 26, 2019 at 11:46 PM Adam Feuer <ad...@starcat.io> wrote:
>
>> I got this to appear on UART2:
>>
>> NuttShell (NSH)
>>> Welcome to NuttX on the SAMA5D27-XULT :)
>>> nsh>
>>>
>>
>> But it doesn't accept any input.
>>
>> Here's the changes I had to do to make it get this far:
>>
>>
>> https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements
>>
>> So NSH seems to be able to send output, but not read input. Any ideas
>> about this...?
>>
>> I guess to prepare for the GiantBoard I should try to get the NSH console
>> onto one of the FlexComs...
>>
>> cheers
>> adam
>>
>> On Thu, Dec 26, 2019 at 6:42 PM Adam Feuer <ad...@starcat.io> wrote:
>>
>>> Greg,
>>>
>>> Ok, I wired up an FTDI USB converter to UART0... PB27 (UTXD0) and PB26
>>> (UTXR0). That also didn't work. Hmmmm.
>>>
>>> I'll think about it some more. Thanks again for the help.
>>>
>>> cheers
>>> adam
>>>
>>> On Thu, Dec 26, 2019 at 6:30 PM Gregory Nutt <sp...@gmail.com>
>>> wrote:
>>>
>>>>
>>>> > Ok, I used the menuconfig system to set the serial console to UART1,
>>>> 57600
>>>> > baud rate.
>>>> >
>>>> > The system boots, hits the nsh_main breakpoint, I can continue to
>>>> fputs,
>>>> > and then if I continue, then break, the system stops in the idle
>>>> loop. So
>>>> > it seems like it's running, but the serial console isn't working, at
>>>> least
>>>> > on the DEBUG port. If I boot into Linux, I can get a console login on
>>>> the
>>>> > DEBUG port at 115200 baud.
>>>> >
>>>> > When I boot NuttX, I don't get any response from the serial terminal.
>>>> I can
>>>> > see I'm transmitting because the lights on my FTDI console blink.
>>>> >
>>>> > The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's
>>>> what
>>>> > the embedded debugger is connected to... so I'm confused.
>>>> >
>>>> > Any more ideas?
>>>>
>>>> Not really.
>>>>
>>>> It is in the IDLE loop because there is nothing to do.  This is a
>>>> symptom of UART1 no working as it is supposed to.  There are a few
>>>> things to check.  Usually the problem is with pin configuration or with
>>>> jumper settings
>>>>
>>>> First, check the jumpers.  In 5.4.14 it looks like you would need:
>>>>
>>>> Pin J9 *NOT* tied to ground
>>>> Jumper JP1 *NOT* installed
>>>> Jumper JP2 DEBUG_DIS ON
>>>>
>>>> Then double check the pin configurations.
>>>>
>>>> In the schematic, I see that the connection to the CDC/ACM VCOM is via
>>>> DBGU_UXTD1_PD3 and
>>>> DBGU_URXD1_PD2.
>>>>
>>>> The UART1 pins must defined in the board.h file.  I see
>>>>
>>>> #define PIO_UART1_RXD  PIO_UART1_RXD_1
>>>> #define PIO_UART1_TXD  PIO_UART1_TXD_1
>>>>
>>>> And if I look in arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h, I see
>>>>
>>>> PIO_UART1_RXD_1 is pin PD2
>>>> PIO_UART1_TXD_1 is pin PD3
>>>>
>>>> So that looks okay.
>>>>
>>>> You can try UART2 if you like.  Sometimes EDGB VCOM interfaces are
>>>> mysterious.  On UART2 you could at least look at what is the TX pin to
>>>> see if anything is coming out.  Careful with pin configurations!
>>>>
>>>> Greg
>>>>
>>>>
>>>
>>> --
>>> Adam Feuer <ad...@starcat.io>
>>>
>>
>>
>> --
>> Adam Feuer <ad...@starcat.io>
>>
>
>
> --
> Adam Feuer <ad...@starcat.io>
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Does NSH wait for an interrupt from the UART to read data? If so, maybe the
SAMA5D27 isn't interrupting. I tried to enable PIOD interrupts, since UART2
is on PIOD, but got some compilation errors. I'll look at it more tomorrow.

cheers
adam

On Thu, Dec 26, 2019 at 11:46 PM Adam Feuer <ad...@starcat.io> wrote:

> I got this to appear on UART2:
>
> NuttShell (NSH)
>> Welcome to NuttX on the SAMA5D27-XULT :)
>> nsh>
>>
>
> But it doesn't accept any input.
>
> Here's the changes I had to do to make it get this far:
>
>
> https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements
>
> So NSH seems to be able to send output, but not read input. Any ideas
> about this...?
>
> I guess to prepare for the GiantBoard I should try to get the NSH console
> onto one of the FlexComs...
>
> cheers
> adam
>
> On Thu, Dec 26, 2019 at 6:42 PM Adam Feuer <ad...@starcat.io> wrote:
>
>> Greg,
>>
>> Ok, I wired up an FTDI USB converter to UART0... PB27 (UTXD0) and PB26
>> (UTXR0). That also didn't work. Hmmmm.
>>
>> I'll think about it some more. Thanks again for the help.
>>
>> cheers
>> adam
>>
>> On Thu, Dec 26, 2019 at 6:30 PM Gregory Nutt <sp...@gmail.com> wrote:
>>
>>>
>>> > Ok, I used the menuconfig system to set the serial console to UART1,
>>> 57600
>>> > baud rate.
>>> >
>>> > The system boots, hits the nsh_main breakpoint, I can continue to
>>> fputs,
>>> > and then if I continue, then break, the system stops in the idle loop.
>>> So
>>> > it seems like it's running, but the serial console isn't working, at
>>> least
>>> > on the DEBUG port. If I boot into Linux, I can get a console login on
>>> the
>>> > DEBUG port at 115200 baud.
>>> >
>>> > When I boot NuttX, I don't get any response from the serial terminal.
>>> I can
>>> > see I'm transmitting because the lights on my FTDI console blink.
>>> >
>>> > The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's
>>> what
>>> > the embedded debugger is connected to... so I'm confused.
>>> >
>>> > Any more ideas?
>>>
>>> Not really.
>>>
>>> It is in the IDLE loop because there is nothing to do.  This is a
>>> symptom of UART1 no working as it is supposed to.  There are a few
>>> things to check.  Usually the problem is with pin configuration or with
>>> jumper settings
>>>
>>> First, check the jumpers.  In 5.4.14 it looks like you would need:
>>>
>>> Pin J9 *NOT* tied to ground
>>> Jumper JP1 *NOT* installed
>>> Jumper JP2 DEBUG_DIS ON
>>>
>>> Then double check the pin configurations.
>>>
>>> In the schematic, I see that the connection to the CDC/ACM VCOM is via
>>> DBGU_UXTD1_PD3 and
>>> DBGU_URXD1_PD2.
>>>
>>> The UART1 pins must defined in the board.h file.  I see
>>>
>>> #define PIO_UART1_RXD  PIO_UART1_RXD_1
>>> #define PIO_UART1_TXD  PIO_UART1_TXD_1
>>>
>>> And if I look in arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h, I see
>>>
>>> PIO_UART1_RXD_1 is pin PD2
>>> PIO_UART1_TXD_1 is pin PD3
>>>
>>> So that looks okay.
>>>
>>> You can try UART2 if you like.  Sometimes EDGB VCOM interfaces are
>>> mysterious.  On UART2 you could at least look at what is the TX pin to
>>> see if anything is coming out.  Careful with pin configurations!
>>>
>>> Greg
>>>
>>>
>>
>> --
>> Adam Feuer <ad...@starcat.io>
>>
>
>
> --
> Adam Feuer <ad...@starcat.io>
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Greg,

Ok, here's the SAMA5 UART selection and typo fix PR:

https://github.com/apache/incubator-nuttx/pull/13

I fixed the rest of the UARTs too. Will you let me know if you have
improvements? I am happy to update the PR.

cheers
adam

On Fri, Dec 27, 2019 at 3:58 PM Adam Feuer <ad...@starcat.io> wrote:

> On Fri, Dec 27, 2019 at 3:39 PM Gregory Nutt <sp...@gmail.com> wrote:
>
>> #define PIO_UART2_RXD PIO_UART2_RXD_3
>> #define PIO_UART2_TXD PIO_UART2_TXD_3
>>
>
> I'll try that and revert the pinmap.h files.
>
>
>> Certainly you need to remove the '1' form '# undef
>> SAMA5_HAVE_DBGU_CONSOLE 1' in any case.
>>
>
> Thank for catching that, it's a typo.
>
>
>> The changes to arch/arm/src/sama5/sam_serial.c
>> are certainly important bug fixes.  Can you send those (plus the typo
>> fixes) as patches to dev@apache.org -- or submit a PR against
>> github.com/apache/incubator-nuttx?
>>
>
> Yes, I will certainly do that. Do you want them as-is now in a small PR,
> or would you rather have them as part of a larger PR when (hopefully!) get
> the D27 board working?
>
> Re: the Linux code, thanks for the tips especially about the license. I
> will stay out of that. :) What about the Atmel example code? It has an MIT
> license.
>
> cheers
> adam
> --
> Adam Feuer <ad...@starcat.io>
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
On Fri, Dec 27, 2019 at 3:39 PM Gregory Nutt <sp...@gmail.com> wrote:

> #define PIO_UART2_RXD PIO_UART2_RXD_3
> #define PIO_UART2_TXD PIO_UART2_TXD_3
>

I'll try that and revert the pinmap.h files.


> Certainly you need to remove the '1' form '# undef SAMA5_HAVE_DBGU_CONSOLE
> 1' in any case.
>

Thank for catching that, it's a typo.


> The changes to arch/arm/src/sama5/sam_serial.c
> are certainly important bug fixes.  Can you send those (plus the typo
> fixes) as patches to dev@apache.org -- or submit a PR against
> github.com/apache/incubator-nuttx?
>

Yes, I will certainly do that. Do you want them as-is now in a small PR, or
would you rather have them as part of a larger PR when (hopefully!) get the
D27 board working?

Re: the Linux code, thanks for the tips especially about the license. I
will stay out of that. :) What about the Atmel example code? It has an MIT
license.

cheers
adam
-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Gregory Nutt <sp...@gmail.com>.
> I got this to appear on UART2:
>
> NuttShell (NSH)
>> Welcome to NuttX on the SAMA5D27-XULT :)
>> nsh>
>>
> But it doesn't accept any input.
>
> Here's the changes I had to do to make it get this far:
>
> https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements

The change to arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h 
<https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements#diff-2481bd3e43bf9821ba88eb9df03c2776> 
is incorrect.  Instead, you need to add this to the 
sama4d2-xplained/include/board.h file:

#define PIO_UART2_RXD PIO_UART2_RXD_3
#define PIO_UART2_TXD PIO_UART2_TXD_3

The pinmap.h should not be modified.

I don't understand the lines you changed to 
arch/arm/src/sama5/sam_config.h 
<https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements#diff-0e1b0fb25a7552129e616cd07e59afee> 
so I am suspicious of that.  I don't really know what you are doing 
there.  Certainly you need to remove the '1' form '# undef 
SAMA5_HAVE_DBGU_CONSOLE 1' in any case.

The changes to arch/arm/src/sama5/sam_serial.c 
<https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements#diff-f7bf8fc9319f3ed08819926c8334ce8f> 
are certainly important bug fixes.  Can you send those (plus the typo 
fixes) as patches to dev@apache.org -- or submit a PR against 
github.com/apache/incubator-nuttx?


Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
I got this to appear on UART2:

NuttShell (NSH)
> Welcome to NuttX on the SAMA5D27-XULT :)
> nsh>
>

But it doesn't accept any input.

Here's the changes I had to do to make it get this far:

https://github.com/apache/incubator-nuttx/compare/master...adamfeuer:feature/sama5d27-xult-improvements

So NSH seems to be able to send output, but not read input. Any ideas about
this...?

I guess to prepare for the GiantBoard I should try to get the NSH console
onto one of the FlexComs...

cheers
adam

On Thu, Dec 26, 2019 at 6:42 PM Adam Feuer <ad...@starcat.io> wrote:

> Greg,
>
> Ok, I wired up an FTDI USB converter to UART0... PB27 (UTXD0) and PB26
> (UTXR0). That also didn't work. Hmmmm.
>
> I'll think about it some more. Thanks again for the help.
>
> cheers
> adam
>
> On Thu, Dec 26, 2019 at 6:30 PM Gregory Nutt <sp...@gmail.com> wrote:
>
>>
>> > Ok, I used the menuconfig system to set the serial console to UART1,
>> 57600
>> > baud rate.
>> >
>> > The system boots, hits the nsh_main breakpoint, I can continue to fputs,
>> > and then if I continue, then break, the system stops in the idle loop.
>> So
>> > it seems like it's running, but the serial console isn't working, at
>> least
>> > on the DEBUG port. If I boot into Linux, I can get a console login on
>> the
>> > DEBUG port at 115200 baud.
>> >
>> > When I boot NuttX, I don't get any response from the serial terminal. I
>> can
>> > see I'm transmitting because the lights on my FTDI console blink.
>> >
>> > The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's what
>> > the embedded debugger is connected to... so I'm confused.
>> >
>> > Any more ideas?
>>
>> Not really.
>>
>> It is in the IDLE loop because there is nothing to do.  This is a
>> symptom of UART1 no working as it is supposed to.  There are a few
>> things to check.  Usually the problem is with pin configuration or with
>> jumper settings
>>
>> First, check the jumpers.  In 5.4.14 it looks like you would need:
>>
>> Pin J9 *NOT* tied to ground
>> Jumper JP1 *NOT* installed
>> Jumper JP2 DEBUG_DIS ON
>>
>> Then double check the pin configurations.
>>
>> In the schematic, I see that the connection to the CDC/ACM VCOM is via
>> DBGU_UXTD1_PD3 and
>> DBGU_URXD1_PD2.
>>
>> The UART1 pins must defined in the board.h file.  I see
>>
>> #define PIO_UART1_RXD  PIO_UART1_RXD_1
>> #define PIO_UART1_TXD  PIO_UART1_TXD_1
>>
>> And if I look in arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h, I see
>>
>> PIO_UART1_RXD_1 is pin PD2
>> PIO_UART1_TXD_1 is pin PD3
>>
>> So that looks okay.
>>
>> You can try UART2 if you like.  Sometimes EDGB VCOM interfaces are
>> mysterious.  On UART2 you could at least look at what is the TX pin to
>> see if anything is coming out.  Careful with pin configurations!
>>
>> Greg
>>
>>
>
> --
> Adam Feuer <ad...@starcat.io>
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Greg,

Ok, I wired up an FTDI USB converter to UART0... PB27 (UTXD0) and PB26
(UTXR0). That also didn't work. Hmmmm.

I'll think about it some more. Thanks again for the help.

cheers
adam

On Thu, Dec 26, 2019 at 6:30 PM Gregory Nutt <sp...@gmail.com> wrote:

>
> > Ok, I used the menuconfig system to set the serial console to UART1,
> 57600
> > baud rate.
> >
> > The system boots, hits the nsh_main breakpoint, I can continue to fputs,
> > and then if I continue, then break, the system stops in the idle loop. So
> > it seems like it's running, but the serial console isn't working, at
> least
> > on the DEBUG port. If I boot into Linux, I can get a console login on the
> > DEBUG port at 115200 baud.
> >
> > When I boot NuttX, I don't get any response from the serial terminal. I
> can
> > see I'm transmitting because the lights on my FTDI console blink.
> >
> > The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's what
> > the embedded debugger is connected to... so I'm confused.
> >
> > Any more ideas?
>
> Not really.
>
> It is in the IDLE loop because there is nothing to do.  This is a
> symptom of UART1 no working as it is supposed to.  There are a few
> things to check.  Usually the problem is with pin configuration or with
> jumper settings
>
> First, check the jumpers.  In 5.4.14 it looks like you would need:
>
> Pin J9 *NOT* tied to ground
> Jumper JP1 *NOT* installed
> Jumper JP2 DEBUG_DIS ON
>
> Then double check the pin configurations.
>
> In the schematic, I see that the connection to the CDC/ACM VCOM is via
> DBGU_UXTD1_PD3 and
> DBGU_URXD1_PD2.
>
> The UART1 pins must defined in the board.h file.  I see
>
> #define PIO_UART1_RXD  PIO_UART1_RXD_1
> #define PIO_UART1_TXD  PIO_UART1_TXD_1
>
> And if I look in arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h, I see
>
> PIO_UART1_RXD_1 is pin PD2
> PIO_UART1_TXD_1 is pin PD3
>
> So that looks okay.
>
> You can try UART2 if you like.  Sometimes EDGB VCOM interfaces are
> mysterious.  On UART2 you could at least look at what is the TX pin to
> see if anything is coming out.  Careful with pin configurations!
>
> Greg
>
>

-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Gregory Nutt <sp...@gmail.com>.
> Ok, I used the menuconfig system to set the serial console to UART1, 57600
> baud rate.
>
> The system boots, hits the nsh_main breakpoint, I can continue to fputs,
> and then if I continue, then break, the system stops in the idle loop. So
> it seems like it's running, but the serial console isn't working, at least
> on the DEBUG port. If I boot into Linux, I can get a console login on the
> DEBUG port at 115200 baud.
>
> When I boot NuttX, I don't get any response from the serial terminal. I can
> see I'm transmitting because the lights on my FTDI console blink.
>
> The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's what
> the embedded debugger is connected to... so I'm confused.
>
> Any more ideas?

Not really.

It is in the IDLE loop because there is nothing to do.  This is a 
symptom of UART1 no working as it is supposed to.  There are a few 
things to check.  Usually the problem is with pin configuration or with 
jumper settings

First, check the jumpers.  In 5.4.14 it looks like you would need:

Pin J9 *NOT* tied to ground
Jumper JP1 *NOT* installed
Jumper JP2 DEBUG_DIS ON

Then double check the pin configurations.

In the schematic, I see that the connection to the CDC/ACM VCOM is via 
DBGU_UXTD1_PD3 and
DBGU_URXD1_PD2.

The UART1 pins must defined in the board.h file.  I see

#define PIO_UART1_RXD  PIO_UART1_RXD_1
#define PIO_UART1_TXD  PIO_UART1_TXD_1

And if I look in arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h, I see

PIO_UART1_RXD_1 is pin PD2
PIO_UART1_TXD_1 is pin PD3

So that looks okay.

You can try UART2 if you like.  Sometimes EDGB VCOM interfaces are 
mysterious.  On UART2 you could at least look at what is the TX pin to 
see if anything is coming out.  Careful with pin configurations!

Greg


Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Greg,

Ok, I used the menuconfig system to set the serial console to UART1, 57600
baud rate.

The system boots, hits the nsh_main breakpoint, I can continue to fputs,
and then if I continue, then break, the system stops in the idle loop. So
it seems like it's running, but the serial console isn't working, at least
on the DEBUG port. If I boot into Linux, I can get a console login on the
DEBUG port at 115200 baud.

When I boot NuttX, I don't get any response from the serial terminal. I can
see I'm transmitting because the lights on my FTDI console blink.

The SAMA5D27 pinout definitely says that UTXD1 is UART1; and that's what
the embedded debugger is connected to... so I'm confused.

Any more ideas?

cheers
adam

On Thu, Dec 26, 2019 at 4:52 PM Adam Feuer <ad...@starcat.io> wrote:

> Greg,
>
> Thanks, I'll try this. Sorry about the two emails with the same question,
> after I sent the first question, I thought the subject line and question
> might have been unclear.
>
> -adam
>
> On Thu, Dec 26, 2019 at 4:37 PM Gregory Nutt <sp...@gmail.com> wrote:
>
>>
>> > In the menuconfig system I looked for a way to get an NSH prompt on
>> UART2,but didn't find it. Is there a way to do that? If so, how?
>>
>> The standard NSH output goes to /dev/console.  For serial devices that
>> is controlled by the setting:
>>
>> CONFIG_SERIAL_UARTn_CONSOLE=y
>>
>> this is in the drivers/serial configuration menu.  In that schematic, I
>> see that the connection to the CDC/ACM VCOM is vis DBGU_UXTD1_PD3 and
>> DBGU_URXD1_PD2.  So 'n' must be one in the above.
>>
>> I also notice that the default BAUD is 57600 which is unusual. That
>> means you will also need:
>>
>> CONFIG_SERIAL_UART_BAUD=57600
>>
>> > Or can I put an NSH prompt on a USB interface?
>>
>> Yes, but that is a lot more complex.
>>
>> Greg
>>
>
>
> --
> Adam Feuer <ad...@starcat.io>
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Adam Feuer <ad...@starcat.io>.
Greg,

Thanks, I'll try this. Sorry about the two emails with the same question,
after I sent the first question, I thought the subject line and question
might have been unclear.

-adam

On Thu, Dec 26, 2019 at 4:37 PM Gregory Nutt <sp...@gmail.com> wrote:

>
> > In the menuconfig system I looked for a way to get an NSH prompt on
> UART2,but didn't find it. Is there a way to do that? If so, how?
>
> The standard NSH output goes to /dev/console.  For serial devices that
> is controlled by the setting:
>
> CONFIG_SERIAL_UARTn_CONSOLE=y
>
> this is in the drivers/serial configuration menu.  In that schematic, I
> see that the connection to the CDC/ACM VCOM is vis DBGU_UXTD1_PD3 and
> DBGU_URXD1_PD2.  So 'n' must be one in the above.
>
> I also notice that the default BAUD is 57600 which is unusual. That
> means you will also need:
>
> CONFIG_SERIAL_UART_BAUD=57600
>
> > Or can I put an NSH prompt on a USB interface?
>
> Yes, but that is a lot more complex.
>
> Greg
>


-- 
Adam Feuer <ad...@starcat.io>

Re: Booting NuttX on SAMA5D27-XULT

Posted by Gregory Nutt <sp...@gmail.com>.
> In the menuconfig system I looked for a way to get an NSH prompt on UART2,but didn't find it. Is there a way to do that? If so, how?

The standard NSH output goes to /dev/console.  For serial devices that 
is controlled by the setting:

CONFIG_SERIAL_UARTn_CONSOLE=y

this is in the drivers/serial configuration menu.  In that schematic, I 
see that the connection to the CDC/ACM VCOM is vis DBGU_UXTD1_PD3 and 
DBGU_URXD1_PD2.  So 'n' must be one in the above.

I also notice that the default BAUD is 57600 which is unusual. That 
means you will also need:

CONFIG_SERIAL_UART_BAUD=57600

> Or can I put an NSH prompt on a USB interface?

Yes, but that is a lot more complex.

Greg