2010-01-30 11:46:44     Serial connection fails?? BF537E

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-01-30 11:46:44     Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85360   

 

Hi

 

Im supposed to get our CM-BF537E module working. I would appreciate to get some some help.

 

Module is installed on our own minimalistic board. UART0 is connected with 2-wires Rx and Tx. RS232 tranciever works in loop-back test. Core module gives no answer.

 

Unluckily we got core module with Blacksheep from Bluetechnix though we ordered one with linux and first I tried to flash u-boot with JTAG being unaware that this module actually needs serial connection to be commanded. (I wonder why it couldn't have ssh server if it had web server anyway?)

 

Flashing went ok but serial terminal connection didn't give anything. Just stalled.

 

I tried booting u-boot_UARTBOOT.ldr via UART setting bootmode to 111 and went through all steps of troubleshooting and tried baud rates down to 300 but autobaud recieve returns timeout.

 

Trying to boot to Blacksheep (bootmode 001) seems to fail because standard web page is not available. Terminal connection (kermit)  gives back weird characters.

 

Now,Trying to boot to u-boot (bypass 000) and using terminal gives funny letter again. I tried baud rates down to 200. (patched air wire connection must have some noise.)

 

Its (very) possible that both self flashed u-boot and blacksheep are now bricked.

 

Does anyone have some help to such a situation?

 

Only possible try I can come up is to boot via UART but to use really low baudrate, but I dont know how to set autobaud rate of bfin-uclinux-ldr.

 

Thanks!

QuoteReplyEditDelete

 

 

2010-01-30 13:38:46     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85362   

 

the UART console on u-boot on the tiny boards defaults to 115200 baud.  selecting other bauds to access the console wont help.

 

if the shipped module with blacksheep couldnt utilize the terminal properly, then i dont think throwing other versions of software on there is going to make a difference.  you've got to fix the underlaying problem first before moving things around.

 

dont you have a tinyboard development board ?  put the module into that first since it's known to work under different configurations.

QuoteReplyEditDelete

 

 

2010-01-30 16:33:27     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85363   

 

Actually I never tried console with blacksheep. Originally, not knowing UART is ever needed, we designed our board with ONLY ethernet. This assumtion was based on Bluetechnix hardware manual which had simple "minimum configuration" schema with only ethernet and JTAG.

 

Not knowing UART will be ever needed and beeing fixed to the schema I used my steady hands to solver an air wire patch JTAG straight to the legs of FX-contactors.  Then I flashed u-boot. I got errors first and I needed to lower frequency to get u-boot flashed.

 

At this point I realized I should have read more and work less. U-boot (of course!) needs to be configured over serial connection to boot uClinux.

 

Blacksheep seems to be gone. Flashed u-boot may be broken. UART boot gives timout.

 

We don't have development board and I hope we wont need to buy one. Thats why I try to find out what could be the "underlying problem" and hope someone has ideas for finding it out (or to rule out some possible flaws).

 

You say that UART console on u-boot on the tiny boards defaults to 115200 baud but what about UART-boot? Because flashed u-boot may be bad and this is currently the only thing that comes to my mind taht could be tried I would like to try UART boot with very low baud rate. Unfortunately I dont know how do that because bfin-uclinux-ldr performs autobaud.

 

Thanks!

QuoteReplyEditDelete

 

 

2010-01-31 01:52:30     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85365   

 

you dont need uart with u-boot if you used netconsole, just ethernet:

https://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:netconsole

 

Linux too has a network console, but it's only one way.  you'd have to telnet into the board once it was booted.

 

there is no default UART boot baud rate.  it's completely automatic -- whatever baud rate you start with is the rate it transfers at.  that's what the ldr-utils package handles.  you didnt say how you were loading over the UART ... hopefully it is with the ldr-utils.

QuoteReplyEditDelete

 

 

2010-01-31 09:14:11     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85380   

 

Thanks for fast replies!

 

"you dont need uart with u-boot if you used netconsole, just ethernet:

https://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:netconsole"

 

I have read that page and Im pretty confused how that netconsole thing goes. At the beginning it says "If you are deploying a system, which has no UART connected to it, ... you can use the network console." But a few lines later: "First you need to tell U-Boot who to talk to: bfin> ..."

 

How do I get that bfin> prompt? If I have no u-boot running on the tiny board this makes no sense. If I have it running on the tiny board how can I get that prompt without serial console (i.e. kermit) over UART? Maybe I have misunderstood something very basic.

 

 

 

"Linux too has a network console, but it's only one way.  you'd have to telnet into the board once it was booted."

 

?

 

 

 

"there is no default UART boot baud rate.  it's completely automatic -- whatever baud rate you start with is the rate it transfers at. "

 

That the point. I would like to start with lower baudrate but how? If  "that's what the ldr-utils package handles"  I would like to how it would be possible to start with lower baud rate.

 

 

 

"you didnt say how you were loading over the UART ... hopefully it is with the ldr-utils."

 

 

 

I followd the example on the wiki pages "Initially Loading U-Boot" -> "ldr-utils" -> "Loading over the UART".  "Trying to read autobaud ..." returned timeout.

QuoteReplyEditDelete

 

 

2010-01-31 12:36:55     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85381   

 

u-boot gets its settings from the environment.  the default is the UART, but if you rebuild u-boot, you can tell it to default to the netconsole.

 

if you read the help output of the utility, it shows a baud option: bfin-elf-ldr -l -h

 

review the troubleshooting section about the autobaud timeout.

QuoteReplyEditDelete

 

 

2010-02-02 12:14:24     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85474   

 

u-boot gets its settings from the environment.  the default is the UART, but if you rebuild u-boot, you can tell it to default to the netconsole.

 

Thanks! How can I default to the netconsole? Netconsole wiki only tells how to use it from te command prompt and I went through half the source codes and internet to find out.

 

First:

 

cm-bf537.h has:

 

/*

* Network Settings

*/

#ifndef __ADSPBF534__

#define ADI_CMDS_NETWORK    1

#define CONFIG_BFIN_MAC

#define CONFIG_NETCONSOLE    1

#define CONFIG_NET_MULTI    1

#endif

#define CONFIG_HOSTNAME        cm-bf537e

/* Uncomment next line to use fixed MAC address */

#define CONFIG_ETHADDR    02:80:ad:20:31:e8

 

 

Should I add after that lines:

 

#define CONFIG_IPADDR        192.168.5.7

#define CONFIG_NETMASK        255.255.255.0

#define CONFIG_SERVERIP        192.168.5.1

 

Now, would those lines be same as writing to commands "setenv ipaddr 192.168.5.7" and "setenv serverip 192.168.5.1"?

 

If not then what I should do?

 

Second:

 

Now we would need to "run" commands "set stdout nc" and "set stdin nc". How to do that?

 

Should I just add setenv commands to the cm-bf537.c file like this:

 

int checkboard(void)

{

    setenv("stdout","nc");

    setenv("stdin", "nc");

    setenv("stderr","nc");

    printf("Board: Bluetechnix CM-BF537E board\n");

    printf("       Support: http://www.bluetechnix.at/\n");

    return 0;

}

 

 

Would that work to get netconsole up at boot?

 

Bare with me. Many thanks!

 

 

 

PS:

 

if you read the help output of the utility, it shows a baud option: bfin-elf-ldr -l -h

 

Thanks!! ...unfortunately lower baud rate didn't solve my problem.

 

review the troubleshooting section about the autobaud timeout.

 

Went through it carefully many times. No success.

QuoteReplyEditDelete

 

 

2010-02-02 12:37:41     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85476   

 

like i said, set your default environment.  that means tweaking CONFIG_EXTRA_ENV_SETTINGS.  tweaking the env at runtime via functions like checkboard is almost never a good idea.

QuoteReplyEditDelete

 

 

2010-02-03 12:14:31     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85542   

 

like i said, set your default environment.  that means tweaking CONFIG_EXTRA_ENV_SETTINGS.  tweaking the env at runtime via functions like checkboard is almost never a good idea.

 

 

 

Thanks again!

 

Now the problem is that Im not getting bfin prompt to netconsole.

 

I added:

 

#define CONFIG_EXTRA_ENV_SETTINGS                        \

    "stdin=nc\0"                                \

    "stdout=nc\0"                                \

    "stderr=nc\0"                                \

    "ipaddr=192.168.1.2\0"                            \

    "netmask=255.255.255.0\0"                        \

    "serverip=192.168.1.1\0"                        \

    "ncip=192.168.1.1\0"                            \

    "nc=setenv stdin nc;setenv stdout nc;setenv stderr nc\0"        \

 

 

To the end of header file before last #endif

 

I allso uncommented #define CONFIG_ETHADDR    02:80:ad:20:31:e8 and netconsole is set to be "1" here:

 

#ifndef __ADSPBF534__

#define ADI_CMDS_NETWORK    1

#define CONFIG_BFIN_MAC

#define CONFIG_NETCONSOLE    1

#define CONFIG_NET_MULTI    1

#endif

 

I ran make and got u-boot.bin which I flashed to my tinyboard. (By the way jtag seems to work with cm-bf537e when bus is inited to be bf537_stamp. I hope this is ok. tinyboards have no bus drivers in jtag.) Anyway it detect flash etc. flahed without errors.

 

Now I booted my board with bypass mode (000) and set my computer to listen..

 

$ nc -u -l -p 6666 < /dev/null &

$ nc -u 192.168.1.2 6666

 

..but I got no prompt.

 

Im very glad if I can get help to solve this problem. Im using crossover eth cable straight from host to board.

QuoteReplyEditDelete

 

 

2010-02-03 12:22:32     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85543   

 

By the way my root console at host states:

 

["numbers"."numbers"] eth2: link up

 

when I power up my board and "link down" when I shut it down.

QuoteReplyEditDelete

 

 

2010-02-03 14:28:29     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85554   

 

you should use the helper script in tools/netconsole (ive updated the wiki).  you should also compile the helper util "ncb" in tools/ as it handles deficiencies in netcat.

 

you did hit enter a few times after running nc right ?  the board isnt going to keep transmitting the prompt over and over.

 

since you have JTAG, it should be trivial to connect to it with gdbproxy / gdb and see where in u-boot things are (or arent).

QuoteReplyEditDelete

 

 

2010-02-03 14:47:51     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85555   

 

you should use the helper script in tools/netconsole (ive updated the wiki).  you should also compile the helper util "ncb" in tools/ as it handles deficiencies in netcat.

 

Huh.. I think I need to wait some more detailed info and examples to do this. I hope you update that to wiki.

 

you did hit enter a few times after running nc right ?  the board isnt going to keep transmitting the prompt over and over.

 

Sure. I hitted almost everything.

 

since you have JTAG, it should be trivial to connect to it with gdbproxy / gdb and see where in u-boot things are (or arent).

 

Hmm.. I didn't get gdbproxy to work because I have WIGGLER clone cable and it just didnt recognize it and I didn't find options to do that. Most likely I also need to downgrade frequency. Do you know how to handle these?

 

And if I get gdbproxy&gdb work what exactly I should check from u-boot?

 

PS. I needed to use UrJtag loaded from urjtag wep page since bfin-jtag cant handle "frequency" command. "Delay" kept growing but "current frequency" stayed almost the same. Should I file a bug report?

 

---

QuoteReplyEditDelete

 

 

2010-02-03 15:08:55     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85558   

 

if urjtag works with the cable, then so will gdbproxy.  you probably didnt use the --connect='...' option to tell gdbproxy to use a different cable.

 

if upstream urjtag supports something, then that is good enough.  we push our changes upstream and then update to the latest version from time to time.

QuoteReplyEditDelete

 

 

2010-02-04 04:00:31     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85605   

 

if urjtag works with the cable, then so will gdbproxy.  you probably didnt use the --connect='...' option to tell gdbproxy to use a different cable.

 

Thanks.. figure out that I need to put all "cable WIGGLER parallel 0x378" there but now it seems to work. But I actually don't know to what I should connect to and how to see where in u-boot things are (or arent). Any advice?

 

 

 

you should use the helper script in tools/netconsole (ive updated the wiki).  you should also compile the helper util "ncb" in tools/ as it handles deficiencies in netcat.

 

 

 

I compiled ncb (with my host computer gcc) to the same folder with netconsole and ran  "./netconsole 192.168.1.2"   but still there is no bfin prompt. What on earth can be wrong?

 

Thank you very much for continuaous support!

QuoteReplyEditDelete

 

 

2010-02-04 14:28:59     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85617   

 

gdbproxy is documented in the wiki:

https://docs.blackfin.uclinux.org/doku.php?id=toolchain:debug:gdbproxy

 

i'd try the JTAG route of debugging before trying to progress further with UART/network when you dont seem to be getting anything out.  you could (should) load up wireshark and sniff packets on the network to see if u-boot is transmitting anything.  look for UDP packets to port like 6666.

QuoteReplyEditDelete

 

 

2010-02-04 14:55:43     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 85621   

 

gdbproxy is documented in the wiki:

https://docs.blackfin.uclinux.org/doku.php?id=toolchain:debug:gdbproxy

 

Gdbproxy seems to wokr fine. Problem is what to look for with gdb. I have been reading gdb documentation. Also I have a guy who have used it but we dont konw what exactly to look for from u-boot.

 

i'd try the JTAG route of debugging before trying to progress further with UART/network when you dont seem to be getting anything out.  you could (should) load up wireshark and sniff packets on the network to see if u-boot is transmitting anything.  look for UDP packets to port like 6666.

 

That I may try tomorrow.

 

Im going to buy a different test board with proper serial port. If thats not working I didnt't jus get wrong product from bluetechnix but wrong and broken.

 

 

 

Thanks!

QuoteReplyEditDelete

 

 

2010-02-04 15:09:55     Re: Serial connection fails?? BF537E

Mike Frysinger (UNITED STATES)

Message: 85622   

 

i'm not sure what you mean by "what to look for".  you give gdb the u-boot ELF that represents the u-boot that was flashed into the board.  typically "u-boot.bin" or "u-boot.ldr" gets flashed while "u-boot" is the ELF you can use for debugging.

 

bfin-elf-gdb ./u-boot

QuoteReplyEditDelete

 

 

2010-02-15 08:44:52     Re: Serial connection fails?? BF537E

Joonas Reunamo (FINLAND)

Message: 86107   

SUCCESS!

 

We bought development board and with the help of the dev board documentation we discovered necessity to reset the board after communication link have been established. Such a small thing. Might be good to have "quick start" page and mark clearly to the wiki pages as well that the board needs to be reseted to show up.

 

Hitting enter didn't help but hitting reset did.

 

Netconsole is still not up but I guess we will get it functioning.

 

Many thanks, Mike, for steady help!

Attachments

    Outcomes