adamgreen / mri

MRI - Monitor for Remote Inspection. The gdb compatible debug monitor for Cortex-M devices.
Apache License 2.0
151 stars 55 forks source link

UART1 has wrong Rx pin #1

Closed arthurwolf closed 11 years ago

arthurwolf commented 11 years ago

Hi !

I think I found a bug in MRI. I'm trying to use the SPI port on smoothieboard ( also UART1 ) to do MRI debugging. Not sure yet it's a bug though. Basically when using MRI_UART_MBED_P13_P14, the RX pin never receives anything from the host.

In here : https://github.com/adamgreen/mri/blob/master/mri/platforms/devices/lpc176x/lpc176x_uart.c When using the MRI_UART_MBED_P13_P14 option, that means it's using the second element in the config array, that is :

{
    &(LPC_SC->PCLKSEL0),
    &(LPC_PINCON->PINSEL0),
    &(LPC_PINCON->PINSEL1),
    (LPC_UART_TypeDef*)LPC_UART1,
    1 << 4,
    3 << 8,
    3 << 30,
    3 << 0,
    0x55555555
},

Now it is supposed to set pin 15 to be TXD1 ( I don't get the 3 but it's everywhere so I trust yout here ) and pin 16 to be RX1. You are using 3<<8 and 3<<30 respectively. But according to the datasheet I think it should be 3<<30 and 3<<0. The fact that 3<<30 is TX and TX works but not RX, and here it's the only one that is in agreement makes me suspect I'm correct.

Now the weird thing is, I was previously trying to use UART1 as my main UART for smoothie coms, and UART0 for MRI, and when I did that, I had the same problem ( I think, not sure ), so maybe something weird else is going on here.

Cheers !