Electrum

internet

Discussions about Micromint Electrum SBCs based on the the Atmel AT91SAM9 ARM9.

Moderator: support

internet

Postby KristinnEs » Wed Mar 21, 2012 8:15 am

I have run into problems and cant find a solution myself, due to newbieness.

First problem : I have an ethernet cable connected to my electrum 100, but on startup when it does DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6 to some higher number it seems to hang. It tries to do this 5 times before it does "NO DHCPOFFERS recieved." and moving on with the boot up.. This seems to result in me not being able to connect to the internet, localnet nor able to mount the filesystem as per the quickstart guide. Is there a solution for this?

Second problem : Every time I boot up the board it asks me to change the root password. "You are required to change your password immediately (root enforced)". I cant remember changing any password settings so this baffles me.

Any help is very much appreciated.
KristinnEs
 
Posts: 11
Joined: Tue Jan 31, 2012 12:30 pm

Re: internet

Postby jalvarez » Wed Mar 21, 2012 8:43 am

Responding to your questions:

1. The default TCP/IP configuration uses DHCP. If there are no DHCP servers on your network you should change this to a static IP by changing the /etc/network/interfaces file. This is documented in the Electrum User's Manual and in Debian online documents.

2. On Debian distributions the password policy is defined by /etc/pam.d/common-password. That message probably indicates either you cleared the root password or you didn't set the current time/date. The root account should not have a blank password and the time/date can't be null (1/1/1970). If your board doesn't have an RTC battery another option is to set time/date via NTP. You can also set the time/date manually as indicated in the FAQ.

http://wiki.micromint.com/index.php/Ele ... 8RTC.29.3F
Regards,
Jesus Alvarez
Micromint USA
jalvarez
 
Posts: 89
Joined: Thu Feb 17, 2011 8:50 am
Location: Lake Mary, FL

Re: internet

Postby KristinnEs » Wed Mar 21, 2012 9:36 am

I have gotten the internet working according to your suggestions :) thank you very much.

However I cant get the time to stick. I have that circular battery on the board just like it was out of the box. I suspect that its drained tho now. But find it unlikely since I havent been using the board for long. I will replace it soon and see what happens.
KristinnEs
 
Posts: 11
Joined: Tue Jan 31, 2012 12:30 pm

Re: internet

Postby jalvarez » Wed Mar 21, 2012 9:42 am

If you executed 'hwclock --systohc' (as stated on the FAQ) and the time is reset on a reboot, probably your RTC battery needs to be replaced. 'date' only updates the system clock, not the hardware clock (RTC).
Regards,
Jesus Alvarez
Micromint USA
jalvarez
 
Posts: 89
Joined: Thu Feb 17, 2011 8:50 am
Location: Lake Mary, FL

Re: internet

Postby KristinnEs » Wed Mar 21, 2012 12:49 pm

ok :) Everything is working as it should now.

So if you dont mind, I have one more question/problem I ran into :P

I have managed to share the nfs thing between my development pc and the elctrum. I followed this guide while installing the toolchain:

http://wiki.micromint.com/index.php/Ele ... ng_Started

and everything works fine until I compile my hello world program. The code I wrote is in a file main.c :

#include <stdio.h>
int main()
{
printf("hello world \n");
return 0;
}

Now when I compile it with the following from the page linked above "arm-linux-gnueabi-gcc -g -march=armv5te -Os -Wall main.c -o main" it compiles fine, however when I try to run it (./main) on the electrum I get the message:

"-bash: ./main: cannot execute binary file"

everything seems to check out, except actually running the file. If I do "file main" as per the getting started guide I get the output:

"main: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped".

Any chance you can spot what is going wrong for me? googling this resulted in no answers for me so far :P
KristinnEs
 
Posts: 11
Joined: Tue Jan 31, 2012 12:30 pm

Re: internet

Postby jalvarez » Wed Mar 21, 2012 1:53 pm

Probably you are using an ARM cross compiler that targets a different Debian version than the one installed on the board. If the executable is linked with dynamic libraries (.so) and those libraries do not exist in the target it will not load. You should either use an ARM cross compiler that uses dynamic libraries compatible with the Debian version on your board, or link to static libraries (.a). A statically linked executable is larger but is compatible with multiple Debian versions (and even other Linux distributions) since it does not depend on dynamic library versions.

Another alternative is to install the native ARM compiler on-board to build your application. This is simpler but slower for large project builds, generally OK for small builds. There is an FAQ with more details. Debian 6 users should install gcc 4.4 instead of the gcc 4.3 mentioned in the FAQ.

http://wiki.micromint.com/index.php/Ele ... e_board.3F
Regards,
Jesus Alvarez
Micromint USA
jalvarez
 
Posts: 89
Joined: Thu Feb 17, 2011 8:50 am
Location: Lake Mary, FL

Re: internet

Postby KristinnEs » Thu Mar 22, 2012 7:15 am

I tried to apt-get the "apt-get install --no-install-recommends binutils cpp cpp-4.3 gcc-4.3 gdb libc6-dev make" on the board itself, but it tells me I dont have enough free space in /var/cache/apt/archives after telling me 37.5M of additional disk space will be used. This is literally the only new thing I am adding software wise on the board. I have a micro-sd card on the board. Is there a way to install this, or expand the electrums onboard space via that?
KristinnEs
 
Posts: 11
Joined: Tue Jan 31, 2012 12:30 pm

Re: internet

Postby KristinnEs » Thu Mar 22, 2012 7:26 am

I seem to have solved my problem. I had to do them one at a time until I got the message, at which point I did apt-get clean. That allowed me to continue.
KristinnEs
 
Posts: 11
Joined: Tue Jan 31, 2012 12:30 pm

Re: internet

Postby KristinnEs » Thu Mar 22, 2012 11:54 am

Ok, now I can compile and run the executable on the board itself. However I dont understand why the toolchain on the x86 pc isnt working. I followed the steps in the manual. The only difference I see when I use the file command is the software on the pc is for linux 2.6.16, but the version of the executable that does run fine on the board itself is for 2.6.14.. The linux system itself on teh board is 2.6.33.
KristinnEs
 
Posts: 11
Joined: Tue Jan 31, 2012 12:30 pm

Re: internet

Postby jalvarez » Thu Mar 22, 2012 12:20 pm

Your problem is not the Linux version compatibility. Both 2.6.14 and 2.6.16 binaries load on 2.6.33.

Your problem is likely caused by linking to dynamic libraries not compatible with the Debian dynamic libraries on your board. A dynamic library is loaded at runtime not at compile time, so a compatible library needs to exist in the target. ARM toolchains include both static and dynamic libraries for libc, libm, etc. printf() is part of libc so you need to link to it on your simple hello program. Most compilers default to shared libraries (libc.so, libm.so, etc) to build smaller executables.

Two alternatives are stated on my previous response:
either use an ARM cross compiler that uses dynamic libraries compatible with the Debian version on your board, or link to static libraries (.a).

The manual presumes a basic understanding on the use of cross compilers, including the importance of version compatibility. Documenting basic Linux and gcc concepts is outside the scope of a board manual. Even when building native binaries you should be aware of differences between static and dynamic libraries. Some customers find the Sourcery ARM cross compiler simpler to work with than the Emdebian cross compiler. There is a link to the Sourcery download site in the Wiki. That may be an alternative for your case.
Regards,
Jesus Alvarez
Micromint USA
jalvarez
 
Posts: 89
Joined: Thu Feb 17, 2011 8:50 am
Location: Lake Mary, FL


Return to Electrum

Who is online

Users browsing this forum: No registered users and 1 guest

cron

Login Form