You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Robert Middleton <os...@gmail.com> on 2022/08/08 00:05:44 UTC

PIC32: disabling JTAG

I'm messing around with NuttX for fun, and I'm working on adding a
sample for the Explorer16 board.  Some of the LEDs on the board are on
the same pins as JTAG pins.  I've managed to set the correct register
to disable JTAG(DDPCON), however this only works after configuring the
pins to be LEDs(using pic32mx_configgpio).  It seems like it shouldn't
matter if this is done before or after the TRIS/ODC registers are set.

I didn't notice anything about this in the datasheet or in the errata,
has anybody seen this before?  Is there something that I'm missing?

-Robert Middleton

Re: PIC32: disabling JTAG

Posted by Robert Middleton <os...@gmail.com>.
Looking at it again today, it's all working properly.  I think that I
was confusing myself yesterday with what I was doing.  I forgot to put
the CONFIG_ in front of the new Kconfig option that I had added, and I
also see now that the config.h will not be regenerated once you save
it via menuconfig, it only seems to do that once you exit menuconfig.
So I think I was sometimes doing it and sometimes not, leading to very
strange behavior.

Anyway it's fixed now, PR incoming shortly.

-Robert Middleton

On Mon, Aug 8, 2022 at 8:32 AM Alan Carvalho de Assis <ac...@gmail.com> wrote:
>
> Hi Robert,
>
> Strange, if it was the opposite "LEDs only works after you disable
> JTAG on DDPCON" would make more sense. Maybe the gpio config is
> activating some necessary clock, but I don't see nothing about it here
> http://ww1.microchip.com/downloads/en/DeviceDoc/61129D.pdf
>
> What is happening when you just configure the pin as GPIO output to
> control the LED and don't disable the JTAG?
>
> BR,
>
> Alan
>
> On 8/7/22, Robert Middleton <os...@gmail.com> wrote:
> > I'm messing around with NuttX for fun, and I'm working on adding a
> > sample for the Explorer16 board.  Some of the LEDs on the board are on
> > the same pins as JTAG pins.  I've managed to set the correct register
> > to disable JTAG(DDPCON), however this only works after configuring the
> > pins to be LEDs(using pic32mx_configgpio).  It seems like it shouldn't
> > matter if this is done before or after the TRIS/ODC registers are set.
> >
> > I didn't notice anything about this in the datasheet or in the errata,
> > has anybody seen this before?  Is there something that I'm missing?
> >
> > -Robert Middleton
> >

Re: PIC32: disabling JTAG

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Robert,

Strange, if it was the opposite "LEDs only works after you disable
JTAG on DDPCON" would make more sense. Maybe the gpio config is
activating some necessary clock, but I don't see nothing about it here
http://ww1.microchip.com/downloads/en/DeviceDoc/61129D.pdf

What is happening when you just configure the pin as GPIO output to
control the LED and don't disable the JTAG?

BR,

Alan

On 8/7/22, Robert Middleton <os...@gmail.com> wrote:
> I'm messing around with NuttX for fun, and I'm working on adding a
> sample for the Explorer16 board.  Some of the LEDs on the board are on
> the same pins as JTAG pins.  I've managed to set the correct register
> to disable JTAG(DDPCON), however this only works after configuring the
> pins to be LEDs(using pic32mx_configgpio).  It seems like it shouldn't
> matter if this is done before or after the TRIS/ODC registers are set.
>
> I didn't notice anything about this in the datasheet or in the errata,
> has anybody seen this before?  Is there something that I'm missing?
>
> -Robert Middleton
>