[Gen9, Gen10 General] scholbert:
low level kernel debugging

Hi again,

as we reach the point of open development on our devices, there'd been some requests to get early boot debugging on kernel level.

Of course there's uart0 but this might not that comfortable for most of you.

Archos kernel got a setup to use uart3 for this purpose and mux these signals on USB data lines of the USB-OTG port at the MicroUSB.

See this code in the kernel board file:

static struct omap_device_pad tablet_uart3_pads[] __initdata = {
{	/* UART3 TX on usba0_otg_dm */
.name	= "usba0_otg_dm.usba0_otg_dm",
.enable	= OMAP_PIN_OUTPUT | OMAP_MUX_MODE1,
},

{	/* UART3 RX on usba0_otg_dp */
.name	= "usba0_otg_dp.usba0_otg_dp",
.flags	= OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
.enable	= OMAP_PIN_INPUT | OMAP_MUX_MODE1,
.idle	= OMAP_PIN_INPUT | OMAP_MUX_MODE1,
},
};

To setup uart3 for early kernel debug you need to tweak your kernel config and activate the following:

...
CONFIG_ARCHOS_FORCE_CONSOLE_UART3=y
CONFIG_ARCHOS_UART3_ON_DPDM=y
CONFIG_CMDLINE_DEFAULT="mem=512M console=ttyO2,115200n8 init=/linuxrc debug omapdss.debug=0 omapfb.debug=0"
...
CONFIG_SERIAL_OMAP_CONSOLE=y
...
CONFIG_DEBUG_LL=y
...

You might try other baudrates as well (Archos uses 1000000n8, which is little unconvenient).

Anyway, kernel needs to get re-compiled afterwards.

Now the hardware side.

Though the MicroUSB uses 5V Signals and while in USB-mode the signals are capable to drive this voltage,

this changes, if the function gets swapped to UART-mode.

In UART-mode the signals need to get shifted either to RS232 level or in the case of using a UART to USB converter,

they need to match the converters operating voltage.

Let's concentrate on the physical connection first!

See the first pic of the MicroUSB connector (tablet side).

Here's is the assignment:

1 VBUS +5 V
2 D− usba0_otg_dm (uart3_tx)
3 D+ usba0_otg_dp (uart3_rx)
4 ID
5 GND signal ground

We may use the stock cable to connect from the MicroUSB to a more common USB type A connector.

You'll need to buy a simple Type A receptacle and solder some wires to your converter then.

1 VCC +5 V
2 D- uart3_tx -> adaptor 1.8V_rx
3 D+ uart3_rx <- adaptor 1.8V_tx
4 GND signal ground -> adaptor gnd

To adapt the low voltage uart signals, you may build your own:

http://xdaforums.com/showpost.php?p=22014823&postcount=72

I took a Digitus dongle sold by Reichelt Electronics and slightly modified it to accept 1.8V TTL level.

You'll need a 1.8V source in this case which could be derived form the mainboard.

Alternatively buy a ready-made, e.g. FTDI cable TTL-232RG-VREG1V8.

http://de.mouser.com/ProductDetail/FTDI/TTL-232RG-VREG1V8-WE/?qs=D1/PMqvA103SrplfYaKc1ZiziVGTkqX%2b

In this case you won't need 1.8V from the mainboard, because the adaptor generates it's own voltage.

Only RX, TX and GND are needed here.

There might be some similar/cheaper types which are sold in your country as well. Just take care that the converter is capable to work at 1.8V logic level.

I may add some more information here, but i must admit that it is not that easy to explain everything very detailed for those, who never did this before.

So i hope i have not missed anything...

Anyway, please ask if something is not clear enough.

Have fun!

scholbert