LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 06-30-2011, 12:05 AM   #1
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Rep: Reputation: 0
Linking problem with pico-SAM9G45


I'm using the toolchain from the board vendor. I can compile and run a simple app on the target correctly. When I tried to add "printf" got an undefined referemce to "puts". I started including various libs I found in the toolchain, but it seems each one fixed a few references, then broke others.

Finally I brought over the libc.so I founf on the target itself - but I am getting the meesage "File format not recognized" - even though the file is ELF 32bit ARM, just like the main app. Not sure what to try next - thanks
 
Old 06-30-2011, 08:38 AM   #2
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Lightbulb help me on pico-sam9g45

Quote:
Originally Posted by imperialbeachdude View Post
I'm using the toolchain from the board vendor. I can compile and run a simple app on the target correctly. When I tried to add "printf" got an undefined referemce to "puts". I started including various libs I found in the toolchain, but it seems each one fixed a few references, then broke others.

Finally I brought over the libc.so I founf on the target itself - but I am getting the meesage "File format not recognized" - even though the file is ELF 32bit ARM, just like the main app. Not sure what to try next - thanks
HI,
I'm a newbie, and I would some test on pico-sam9g45. I would to put a boot and kernel on board: I start with the sd card, I used a toolchain buildroot, but, after to make on host (ubuntu 9.04), the output files not be have a success on sd card. I try in the sd with formatted the two partitions, one in fat16 and one in ext3. I not have success :-(
How to use the toolchain and howto use the compile and run the simple app ?? :-D

Also, I would to put the boot and kernel in tha board ram, with the sam-ba tool, on windows. The operation have some failure...!

Please, can you help me ? I hope that you send me any tutorial, any help that it to help my test... :-D
I'm waiting your suggestions.

thanks so much.
Best Regards,

Last edited by magickernel; 06-30-2011 at 08:45 AM.
 
Old 06-30-2011, 10:11 AM   #3
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Code working on pico ARM board

Hi we finally had some success, but we had to use the CodeSourcery toolchain to make it work, and that costs $399. You can get a 30-day evaluation if you just want to test something. Here's the details:

So I finally got everything working using an entirely new approach: the actual CodeSourcery toolchain. I picked up a 30 day eval of the linux version for the SAM9G45 (they also have a windows version). It's integrated with eclipse, and I think it could be a really nice way to go. I didn't decide to try it until I really started to find how many codesourcery dependencies were included in the toolchain from the picoboard wiki. To emphasize how easy it really was, here would be the steps from scratch:
1. Download eval version here (it should already have the SAM9G45 selected, you want the "ARMv5TE - Little-Endian, Soft-Float, GLIBC" version)
2. Install on Ubuntu (it's a self-installer)
3. Run the workbench
4. Create a new C project and add a source file with a main
5. Build, copy the executable to the target, and run

We are using the angstrom kernel on the board, and we had to use WinImage on Windows XP to get the sd card formatted correctly.

Quote:
Originally Posted by magickernel View Post
HI,
I'm a newbie, and I would some test on pico-sam9g45. I would to put a boot and kernel on board: I start with the sd card, I used a toolchain buildroot, but, after to make on host (ubuntu 9.04), the output files not be have a success on sd card. I try in the sd with formatted the two partitions, one in fat16 and one in ext3. I not have success :-(
How to use the toolchain and howto use the compile and run the simple app ?? :-D

Also, I would to put the boot and kernel in tha board ram, with the sam-ba tool, on windows. The operation have some failure...!

Please, can you help me ? I hope that you send me any tutorial, any help that it to help my test... :-D
I'm waiting your suggestions.

thanks so much.
Best Regards,
 
Old 06-30-2011, 10:46 AM   #4
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Question

HI,
thanks about the tips, very interesting and important for me. I have any questions about the steps that you suggest me:
1)I go on the CodeSourcery toolchain website, but there are some versions files as download: EABI, uclinux,etc..., which I download of files availability, please ? also, the installer on ubuntu, is .tar.bz2 or not ?

2) how to run the workbench ?

3) you use any specific compiler ?

So, I know winimage, I used it also image precompiled...!

many many thanks...
I hope that I run a simple app, like helloworld on board....!!!






Quote:
Originally Posted by imperialbeachdude View Post
Hi we finally had some success, but we had to use the CodeSourcery toolchain to make it work, and that costs $399. You can get a 30-day evaluation if you just want to test something. Here's the details:

So I finally got everything working using an entirely new approach: the actual CodeSourcery toolchain. I picked up a 30 day eval of the linux version for the SAM9G45 (they also have a windows version). It's integrated with eclipse, and I think it could be a really nice way to go. I didn't decide to try it until I really started to find how many codesourcery dependencies were included in the toolchain from the picoboard wiki. To emphasize how easy it really was, here would be the steps from scratch:
1. Download eval version here (it should already have the SAM9G45 selected, you want the "ARMv5TE - Little-Endian, Soft-Float, GLIBC" version)
2. Install on Ubuntu (it's a self-installer)
3. Run the workbench
4. Create a new C project and add a source file with a main
5. Build, copy the executable to the target, and run

We are using the angstrom kernel on the board, and we had to use WinImage on Windows XP to get the sd card formatted correctly.
 
Old 06-30-2011, 11:31 AM   #5
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
1 - Get the ARM GNU/Linux version, we got the .bin installer, it self-installs in Ubuntu (see my original notes below)
2 - We are still figuring this out - but it seems easy
3 - The compiler is included in the package

Quote:
Originally Posted by magickernel View Post
HI,
thanks about the tips, very interesting and important for me. I have any questions about the steps that you suggest me:
1)I go on the CodeSourcery toolchain website, but there are some versions files as download: EABI, uclinux,etc..., which I download of files availability, please ? also, the installer on ubuntu, is .tar.bz2 or not ?

2) how to run the workbench ?

3) you use any specific compiler ?

So, I know winimage, I used it also image precompiled...!

many many thanks...
I hope that I run a simple app, like helloworld on board....!!!
 
Old 06-30-2011, 10:47 PM   #6
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Turns out there is a "lite" version of the tools that are free - this works also:

http://www.codesourcery.com/sgpp/lit...al/release1803

Good Luck!


Quote:
Originally Posted by imperialbeachdude View Post
1 - Get the ARM GNU/Linux version, we got the .bin installer, it self-installs in Ubuntu (see my original notes below)
2 - We are still figuring this out - but it seems easy
3 - The compiler is included in the package
 
Old 07-01-2011, 03:12 AM   #7
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Question installation

HI,
thanks about the link and the suggestions. I found the file .bin, and I try it on Ubuntu 9.04.

Please, you have a tutorial that you can be send me, by mail, about the build simple application on codesourcery to board ?

thanks.
I hope that I have a good luck...! :-D

Quote:
Originally Posted by imperialbeachdude View Post
Turns out there is a "lite" version of the tools that are free - this works also:

http://www.codesourcery.com/sgpp/lit...al/release1803

Good Luck!

Last edited by magickernel; 07-01-2011 at 03:57 AM. Reason: installation success
 
Old 07-01-2011, 08:36 AM   #8
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Hi Marco -

I understand that you have built the simple helloworld app, and now you need to get it on the board. I am responding here so others may see the steps we took. There are several options possible, I will list them below.

1. Have you successfully built the SD card image using the instructions from the pico wiki page? You must get this done for anything to work. We finally used WinImage on a Windows XP box to do this, but there are several ways. You cannot get anything done unless you get this completed correctly.

2. Have you built a TTL to RS232 converter to attach to J7 on the board? It's not very hard, but it is not my area of expertise, you will have to find someone else to help with that. I do recommend building the converter, as it is the debug port used by the kernel. This is not absolutely required, but helpful. When the board is booting, you will see output on this port, so you will know if you got step 1 done properly, as it will boot correctly, and you can login as root from the debug port.

3. Even if you do not get #2 done, the board will still boot if you got step 1 done, and you can connect to it through your local network. To do this you will need the IP address of the board, by default the board uses DHCP. You can look at your DHCP server after the board boots - it will be listed in the DHCP client table. Or, you could use Wireshark with a port monitor switch and watch the IP traffic from the device, and discover it's IP address that way. After you discover the IP address, it is a normal Linux login, for example ssh root@192.168.1.113 (assuming the board came up at 113). Then you can use scp to load programs to the board.

Let us know if you get the app loaded - good luck!

Jeff

P.S. Have you considered using the BeagleBoard instead? My understanding is there is a lot more support and documentation for the BeagleBoard than the pico board.

Quote:
Originally Posted by magickernel View Post
HI,
thanks about the link and the suggestions. I found the file .bin, and I try it on Ubuntu 9.04.

Please, you have a tutorial that you can be send me, by mail, about the build simple application on codesourcery to board ?

thanks.
I hope that I have a good luck...! :-D
 
Old 07-01-2011, 09:37 AM   #9
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Question steps progress

Hi Jeff,

about your suggestion, I want to tell my steps:

1. About the wiki page, I built the compile a new kernel for pico-SAM9G45, on host (ubuntu 9.04). In the folder /arm/boot I have the compiled files: Image and zImage. So, at this step I think that I add the angstrom folders on the rootfs, but, I tried this step several times, but not is successful. You can help me about the steps and so finally can get the image file to winImage process, please ? Also, in the image (to sdcard) you build the codesourcery .bin ?

2. Sorry, I don't have the TTL to RS232 converter to attach to J7 on the board :-(

3. I try to link the board with the microusb otg cable. It's possible to use the microusb cable to connect at the local network, or I must to use a rs232 cable ?

Thanks so much...I go on more pages on web, but I'm a newbie and I try several test, but at the momento I'm stuck in the 1.: howto add the angstrom, kernel, helloworld app in the image ? I'm use a script to format the sdcard, so it suggest on wikipage.

I hope on your help..!! :-D

I think that the step with beagleboard, with your suggestion are more friendly, but I'm forced to use the pico board for this study...:-D

Quote:
Originally Posted by imperialbeachdude View Post
Hi Marco -

I understand that you have built the simple helloworld app, and now you need to get it on the board. I am responding here so others may see the steps we took. There are several options possible, I will list them below.

1. Have you successfully built the SD card image using the instructions from the pico wiki page? You must get this done for anything to work. We finally used WinImage on a Windows XP box to do this, but there are several ways. You cannot get anything done unless you get this completed correctly.

2. Have you built a TTL to RS232 converter to attach to J7 on the board? It's not very hard, but it is not my area of expertise, you will have to find someone else to help with that. I do recommend building the converter, as it is the debug port used by the kernel. This is not absolutely required, but helpful. When the board is booting, you will see output on this port, so you will know if you got step 1 done properly, as it will boot correctly, and you can login as root from the debug port.

3. Even if you do not get #2 done, the board will still boot if you got step 1 done, and you can connect to it through your local network. To do this you will need the IP address of the board, by default the board uses DHCP. You can look at your DHCP server after the board boots - it will be listed in the DHCP client table. Or, you could use Wireshark with a port monitor switch and watch the IP traffic from the device, and discover it's IP address that way. After you discover the IP address, it is a normal Linux login, for example ssh root@192.168.1.113 (assuming the board came up at 113). Then you can use scp to load programs to the board.

Let us know if you get the app loaded - good luck!

Jeff

P.S. Have you considered using the BeagleBoard instead? My understanding is there is a lot more support and documentation for the BeagleBoard than the pico board.

Last edited by magickernel; 07-01-2011 at 09:54 AM. Reason: add comment
 
Old 07-01-2011, 10:09 AM   #10
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Ok - I understand. There is a pre-built angstrom image here:

http://arm.mini-box.com/releases/ang...2011-02-08.zip

You can use WinImage to load the pre-built image above to the SD card. Work on that first, that will get you a working kernel on the pico board. Then you can use the steps I described to connect through a network using DHCP.

I'm pretty sure the pico will not communicate through the USB without some changes to the kernel config files. I cannot help with that.

If you cannot connect through the network, and you cannot build the TTL/RS232 converter, I think it's impossible to use the board.

Jeff





Quote:
Originally Posted by magickernel View Post
Hi Jeff,

about your suggestion, I want to tell my steps:

1. About the wiki page, I built the compile a new kernel for pico-SAM9G45, on host (ubuntu 9.04). In the folder /arm/boot I have the compiled files: Image and zImage. So, at this step I think that I add the angstrom folders on the rootfs, but, I tried this step several times, but not is successful. You can help me about the steps and so finally can get the image file to winImage process, please ? Also, in the image (to sdcard) you build the codesourcery .bin ?

2. Sorry, I don't have the TTL to RS232 converter to attach to J7 on the board :-(

3. I try to link the board with the microusb otg cable. It's possible to use the microusb cable to connect at the local network, or I must to use a rs232 cable ?

Thanks so much...I go on more pages on web, but I'm a newbie and I try several test, but at the momento I'm stuck in the 1.: howto add the angstrom, kernel, helloworld app in the image ? I'm use a script to format the sdcard, so it suggest on wikipage.

I hope on your help..!! :-D

I think that the step with beagleboard, with your suggestion are more friendly, but I'm forced to use the pico board for this study...:-D
 
Old 07-01-2011, 10:18 AM   #11
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Hi,
I'm just used the pre-built angstrom image, and I test the pre-build image on board with success. So, I think that not possible to add a simple app (helloworld) in the pre-built image, or not ? ...maybe, the app to load by network DHCP, and so it's possible to execute the app independently the pre-built image ? :-D

So, I would understand one things: if I not have the TTL/RS232 converter, I think that I use the microsd and, so the process not very friendly, but I can everytime copy and past the new file on sd ...until I can buy the converter..it's correctly or not ?

Thanks.

Quote:
Originally Posted by imperialbeachdude View Post
Ok - I understand. There is a pre-built angstrom image here:

http://arm.mini-box.com/releases/ang...2011-02-08.zip

You can use WinImage to load the pre-built image above to the SD card. Work on that first, that will get you a working kernel on the pico board. Then you can use the steps I described to connect through a network using DHCP.

I'm pretty sure the pico will not communicate through the USB without some changes to the kernel config files. I cannot help with that.

If you cannot connect through the network, and you cannot build the TTL/RS232 converter, I think it's impossible to use the board.

Jeff

Last edited by magickernel; 07-01-2011 at 10:26 AM. Reason: update
 
Old 07-01-2011, 10:35 AM   #12
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Good news - I'm not sure I understand your question. Here's what I think you can do

1. You can load the app over the network to the board, the app is saved on the target, and you can run it anytime. This seems like the easiest solution to me. Use scp to load the app to the target - it will be saved on the target.

2. I'm sure it's possible to add the app to the pre-built image, and program the SD card again, but it's not friendly - and I don't know how to do that yet.


Quote:
Originally Posted by magickernel View Post
Hi,
I'm just used the pre-built angstrom image, and I test the pre-build image on board with success. So, I think that not possible to add a simple app (helloworld) in the pre-built image, or not ? ...maybe, the app to load by network DHCP, and so it's possible to execute the app independently the pre-built image ? :-D

So, I would understand one things: if I not have the TTL/RS232 converter, I think that I use the microsd and, so the process not very friendly, but I can everytime copy and past the new file on sd ...until I can buy the converter..it's correctly or not ?

Thanks.
 
Old 07-01-2011, 11:42 AM   #13
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Smile

So, if I understand your suggestions...I can:

1. the "add app" can be saved on the target: I try to connect the board by rs232 cable (rs232 output notebook link to rs232 board, until I can have the converter cable!), and I hope that the connection is open. Howto use the scp (like command by terminal..I not know the scp protocol or not be understand!). The DHCP is clear...!

2. I think that it's possible to add the "app" on the pre-build image, I try...: so, I can see the rootfs by terminal connection ?

3. So, please, can you suggest me howto build the image...with the kernel,etc..etc...so, after the test I would to try to build a new image that it can be to use with winimage...! :-D

Thanks....and sorry some of my newbie questions posted !!


Quote:
Originally Posted by imperialbeachdude View Post
Good news - I'm not sure I understand your question. Here's what I think you can do

1. You can load the app over the network to the board, the app is saved on the target, and you can run it anytime. This seems like the easiest solution to me. Use scp to load the app to the target - it will be saved on the target.

2. I'm sure it's possible to add the app to the pre-built image, and program the SD card again, but it's not friendly - and I don't know how to do that yet.
 
Old 07-01-2011, 06:25 PM   #14
imperialbeachdude
LQ Newbie
 
Registered: Jul 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Hi there -

1. You can google for the linux scp command, it's easy to use. You must have a working network connection to the target board for scp to work.

2. We have not been able to successfully rebuild the pre-build image, so that might not work

What are you trying to do with the board? If you can get scp working over the network, you will not need to rebuild the image. Please explain the final result you need.

Quote:
Originally Posted by magickernel View Post
So, if I understand your suggestions...I can:

1. the "add app" can be saved on the target: I try to connect the board by rs232 cable (rs232 output notebook link to rs232 board, until I can have the converter cable!), and I hope that the connection is open. Howto use the scp (like command by terminal..I not know the scp protocol or not be understand!). The DHCP is clear...!

2. I think that it's possible to add the "app" on the pre-build image, I try...: so, I can see the rootfs by terminal connection ?

3. So, please, can you suggest me howto build the image...with the kernel,etc..etc...so, after the test I would to try to build a new image that it can be to use with winimage...! :-D

Thanks....and sorry some of my newbie questions posted !!
 
Old 07-04-2011, 01:30 AM   #15
magickernel
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Question

Hi,

I would to use the linux pre-build image, if possible, to put inside the sdcard, some "app", like "helloworld.c", so that they can be performed on board, and the output can be visible on the lcd touch. The app is stand-alone. So, I see in the angstrom, is available the arm-eabi-gcc, it's is the only mode to run the app ? So, the file app can be load on a subdir of the pre-build image ?

Please, can you help me, thanks ?




Quote:
Originally Posted by imperialbeachdude View Post
Hi there -

1. You can google for the linux scp command, it's easy to use. You must have a working network connection to the target board for scp to work.

2. We have not been able to successfully rebuild the pre-build image, so that might not work

What are you trying to do with the board? If you can get scp working over the network, you will not need to rebuild the image. Please explain the final result you need.
 
  


Reply

Tags
arm, linker


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in using both load time linking and runtime linking durgaprasad_j Linux - General 0 08-01-2006 03:49 AM
Linking problem kalleanka Programming 2 07-13-2006 07:02 AM
Problem linking f77 and f90 object files Make problem (I think) TheBrick Programming 1 05-22-2006 06:17 AM
Pico problem ust Linux - Software 0 08-06-2003 08:07 PM
linking problem with ld ! gluon Programming 2 05-19-2002 01:59 PM


All times are GMT -5. The time now is 04:25 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration