µTasker Forum

µTasker Forum => ATMELTM AT91SAM7X and AVR32 => Topic started by: mark on August 09, 2007, 11:16:12 PM

Title: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on August 09, 2007, 11:16:12 PM
Hi All

I am in the process of porting the uTasker SAM7X project to work with the tool chain as decribed by James Lynch in his article "Using Open Source Tools for AT91SAM7S Cross Development revision C".

This article and some tutorial files can be loaded from the ATMEL web site - the article is very readable and gives some background to the development of the various tools and a clear step-by-step of installing and getting them running. Therefore it is not worth me giving too much detail here since it is all available in neat and tidy form there. To get the document and the files simply do the following:
1. Go to the web site www.at91.com
2. Click on the register "Documents"
3. Find the document "Using Open Source Tools for AT91SAM7S Cross Development" and click on it.
4. It appears by itself under the title "Key Resources" so click on it again.
5. This will cause "Source package" as download option to appear. Click on this to download a 12.4MByte ZIP file.
In the zip file you will find the famous document (8.6M) which you can follow to obtain all software and install the Eclipse IDE.

This uses the YAGARTO package which is an extremely simple set of 4 executables which install the GCC compiler and libraries, plus all other bits and pieces necessary. It works under Windows without the need for Cygwin or any tedious searching for the various components needed. You can read more about the history of this in James Lynch's article - but it is really easy to use so do have ago.

In fact I have used Eclipse before (for the Coldfire) and I have also compiled the uTasker project with GCC but this path seems the best way to go to ensure that the complete package is really simple and useable.

I can't say how long that it will take until everything is finalised. The uTasker project will run on the ATMEL EVAL board when built with GCC but I know that Emerson had difficulties with this package so it is an oppertunity to clean up and solve any special problems involved.

One important subject is the JTAG debugger used. I studied the various options which are supported by the package and found that the Segger J-Link which I use together with my IAR compiler and IDE will work but it requires another license to work with the debugger [GDB server software]. This license costs $261 (on top of the J-Link price which retails stand-alone for $327). It is repackaged as the ATMEL SAM-ICE JTAG for $129, including the necessary GDB server software. So if you don't have one and want to use it then it seems logical to get the ATMEL offerings. One strange thing about the J-Link GBD server is that it can not program FLASH and so needs either another J-Flash software for $525 or the ATMEL SAM-BA utility.

Anyway I decided that it would be a good idea to try out another solution so have ordered the Olimex ARM-USB-OCD which also works very well (according to James) and is compatible with the OpenOCD daemon which is included in the package. This costs $69.95 and there is a smaller Hobbyist/Student version called the ARM-USB-Tiny for $49.95 (without the serial interface and 5V supply output that the OCD version has). I hope that this will arrive shortly so that I can confirm that it works correctly. In any case it seems to be a more sensible choice seeing as the SAM7X is most popular in the educational world and so will probably be the preferred parts due to its affordable price.

I will report here again as soon as I have some results. If anyone else is interested in being involved just let me known.

Regards

Mark


Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: tecnoemerson on August 10, 2007, 02:57:36 AM
Marker

Congratulation by to dedicate your time in utasker to Open Source tools! Atmel has believed in Open Source tools.

I had problem in porting it,  i changed my tools, before i used WINARM, now i use Yagarto in tool chain as decribed by James Lynch in his article, i recomend all people that want use sam7x to install and test it, pretty good tools, excellent!

Excellent use GDB in Eclipse software, but i have used arm-jtag from Olimex, it use parallel port, it has worked well in simple examples code  by james Lynch, what do you think about it?

Well, i am working to porting uTasker, i hope that you can porting it!

Thank you, good job!

Sincerely.

Emerson M A Alves
Brazil
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on August 10, 2007, 12:45:45 PM
Emerson

James Lynch says that all of the JTAG tools he tried work well. The 'Wiggler' using the parallel port is however somewhat slower than the USB types - it can sometimes have problems with ground loops. The wiggler is however the least expensive solution (as long as your PC still has a parallel port) and it is possible to also build one yourself - there are probably various circuits for it in the Internet. In my case I have ordered the USB one because it should allow faster work.

Regards

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on August 13, 2007, 11:50:32 PM
Hi All

I have successfully compiled one of the demo projects in James Lynch's tutorial package but am still waiting to receive the Olimex JTAG debugger. I have had to change for the ARM-USB-Tiny (rather than the ARM-USB-OCD) due to the fact that the local supplier has only the Tiny in stock and Olimex is on holiday until the beginning of September. Never mind - I don't expect any disadvantages with it.

Here is a guide as to how to create a project in Eclipse for the uTasker. There are in fact different ways to do it (like importing all files to the Eclipse workspace) but this is the one that I prefer because it uses the project files directly - one word of warning is that the project view in Eclipse is not a project view as in VisualStudio (which users' of the uTasker simulator know well) where the project folders are virtual folders and the files are those included in the project (their actual location can be anywhere), but this is the REAL FILE SYSTEM on your PC. If you delete a file from the project it will be deleted from your hard disk, and not simply removed from the project!! You need to be a bit careful at the beginning but once you realise this you can use it as a sort of explorer to manipulate things on the hard drive.

1. Start Eclipe and set the working directory to anywher you would like it to be (this will be used as scratch pad and not for real project files).

2. File | New | Project...
Choose standard make C project

3. Enter the project name - such as "uTaskerV1.3"  (without the quotes)
but uncheck "use default location" and set the  uTasker directory as location. This will use the real directory directly rather than making a copy to the local workspace.

4. The further settings seem to be fine without any further configuration changes so click on "Finish" and the uTasker project will magically appear in the project view.
If you expand the project directory you will see that it contains all files and documents, etc. Don't worry that the project is going to build everything seen there because we will specify a make file to be used which defines the build details.

5. If you expand the sub-directories in the project view: Applications .. uTaskerV1.3 .. GNU_SAM7X the make file will be seen (it is called makefile and must have this name to work with Eclipse - as far as I can see).
Unless you have received a version of the project with GNU support from me directly (this is not yet included in the standard project and service packs) the GNU_SAM7X sub-directory will not be there. You can get a zipped version of this directory from the following link: http://www.uTasker.com/software/SAM7X/GNU_YAGARTO.zip
This also includes a startup file for use with GNN called startup_gnu.s and a development version of SAM7X.c. Place these in your directory \Hardware\SAM7X

To set this as the make file for building the project do the following:
In the make view (on the right hand side) expand the sub-directories again to the GNU_SAM7X directory and then right click your mouse.
Choose "Add make target" to make an 'all' build. This will allows a standard build, which will involve compiling only files which need to be compiled since they have either been modified or a header that they depend on has.
A green target will appear with the name 'all'
Then repeat but name the make taget 'clean' (make name and make target in the create dialog).
A second green target will appear with the name 'clean' and can be used to delete all objects in preparation for a re-build of the project.

6. Double click on the 'all' to build the uTasker project using the GNU compiler.

This will generate an S19 output and a binary output and show the size of the code and RAM use.
It also creates a project map file in the target directory Applications\uTaskerV1.3\GNU_SAM7X
The memory script file used for the build is called uTaskerV1.3.ld, also in the target directory.

Note that you may get a warning or two when compiling the standard project, which have been resolved in my working version. These are not serious warnings and just point out that parentheses could be used to help code clarity.
I don't know yet whether this build actually runs on the target - this will be the next thing to find out!

Good luck!!

Mark

Added note on 14.8.2007:

One small change to the standard Eclipse set up which I found useful was the following:
Initially changed files were not being saved when I compiled, and this can cause silly operator errors when not noticed (new build not including latest changes...).
So that modified files are automatically saved when rebuilding, the set up can be modified by opening
Windows | Preferences -> in Preferences dialog expand "General" and select "Workspace" then check "Save automatically before build".

Save this setting and then modified files are automatically saved when the project is built.
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: tecnoemerson on August 14, 2007, 06:43:13 AM
Marker

What pack did you use in project? I have uTaskerBeta_ref_Rowley.zip packs !

You sent me makefile to compile utasker, i had problem in to compile it, the makefile and ld file in GNU_YAGARTO.zip  are different?

Didn`t you get error in make it? Error like this:

libarm_enable_irq() and libarm_disable_irq() in sam7x.c file! ???????


In:  hardware\sam7x\sam7x.c

// Routine to re-enable interrupts on leaving a critical region (IAR uses intrinsic function)
//
extern void uEnable_Interrupt(void)                                      // {3}
{
#ifdef _WINDOWS
    if (!iInterruptLevel) {
        *(int *)0 = 0;                                                   // basic error - cause simulator exception
        // A routine is enabling interrupt although they are presently off. This may not be a serious error but it is unexpected so best check why...
    }
#endif
    if (!(--iInterruptLevel)) {                                          // only when no more interrupt nesting,
    #if defined (COMPILE_IAR)
        __enable_interrupt();                                            // IAR intrinsic routine
    #elif defined (_GNU)
      libarm_enable_irq();
    #endif
    }
}

How did you fix this problem?

What is password to unzip GNU_YAGARTO.zip ?

May you send me bin file to me test it in board?


Thank you


Emerson M A Alves
Brazil


Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on August 14, 2007, 12:16:00 PM
Hi Emerson

The Rowley project uses libarm_enable_irq() but these are not found in the GCC as installed by YAGARTO - they are probably routines special to the Rowley libraries (although I haven't studied this).
Therefore SAM7X.c uses __irq_dis() and __irq_en() which are then supplied in the startup_gnu.s file.

I have just added my (development) version of sam7x.c, which I used to compile, to the zip file. The file is protected by the standard SAM7X project password so can be opened by all uTasker SAM7X users.

I just loaded the bin file to my AT91SAM7X-EK to see whether there is life and it started. I could load the web pages to its FTP server and then browse to its web server. So it doesn't look too bad at all. (Just as well since I haven't received the JTAG debugger yet...!)

I have rebuilt for the Olimex board (which you are using) and sent a binary to your private Email address - I don't have such a board here so couldn't check - you can load it using SAM-BA to see whether it also runs.

Good luck

Mark


P.S. For the YAGARTO build use the standard SAM7X project and service packs!



Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: tecnoemerson on August 14, 2007, 07:12:00 PM
Hi Marker

I got file to uTaskerBeta_ref_Rowley.zip, so i overried it with new files from uTaskerV1.3.0_SAM7X_SP1.zip and GNU_YAGARTO.zip, and made step by step in Eclipse, but i still got a error.

Sounds Good now, but i had a little error look:

make -k all
arm-elf-gcc -march=armv4t -mlittle-endian -mthumb -mthumb-interwork -Wall -Wstrict-prototypes -I..\..\uTaskerV1.3 -D _GNU -D _HW_SAM7X -g -c -Os ..\..\..\Hardware\SAM7X\SAM7X.c -o Build\SAM7X.o
..\..\..\Hardware\SAM7X\SAM7X.c:150: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
..\..\..\Hardware\SAM7X\SAM7X.c: In function 'EMAC_Interrupt':
..\..\..\Hardware\SAM7X\SAM7X.c:629: warning: suggest parentheses around assignment used as truth value
make: *** [Build\SAM7X.o] Error 1
make: Target `all' not remade because of errors.

What can i do?

Thanks

Emerson
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on August 14, 2007, 07:40:35 PM
Emerson

I have the feeling that you are still not using the SAM7X.c file in the GNU_YAGARTO.zip.
Have you copied the sam7x.c to the hardware\sam7x directory?

If I open the file sam7x.c I find the following lines there where it is flagging an error and a warning:
Line 150 -   //#endif
Line 629 -                 else {
Line 629 is also in the interrupt routine PortB_Interrupt() and not in EMAC_Interrupt(), which begins at line 673.

Therefore it does look as you are compiling a different version of the code.

I will be Skype-Online this evening if it helps.

Regards

Mark
PS. Did the Olimex binary run on your board?
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: tecnoemerson on August 15, 2007, 05:40:25 AM
Marker

I changed sam7x.c file by sam7x.c from GNU_YAGARTO.zip. The first time that i download it, didn't have sam7x.c in zip pack.

I have copied new  sam7x.c to the hardware\sam7x directory.

I solved all problems, so i already compiled uTasker with GCC, excellent!

The code is small! I will test all functions!

Thanks a lot Marker, this work will motivate many developer use uTasker, open tools is a great idea!

Sincerely


Emerson M A Alves
tecnoemerson@interpira.com.br
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Stan on December 12, 2007, 06:02:17 PM
Hello everyone,
Today I tried to build the uTasker project with Eclipse but with no success. I followed the steps described described in
"Using Open Source Tools for AT91SAM7S Cross Development revision C.pdf" downloaded from Atmel website. So What I did is:
-Install OpenOCD;
-Install YAGARTO Tool Chain;
-Install Eclipse IDE;
-Install YAGARTO Tools;
-Install the Olimex ARM-USB-OCD USB Drivers; (I have other debuggers too but wanted to try this);
-Set Up OpenOCD as an Eclipse External Tool (ARM-USB-OCD);
and after that I followed the steps described from Mark. So after I finish with "add make target" for "all" and "clean" I recieve an error saying the following:

Severity and Description                           Resource         Path         Location        Creation Time        Id
make: *** [uTasker/Driver.o] Error 127      uTaskerV1.3                     line 0           1197477366656      121


And don't know what to do know :] Please help, thanks!
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on December 12, 2007, 08:50:44 PM
Hi Stan

I find the error messages which are generated by the make utility rather confusing, and never know whether it is an error in the make file, in the GCC installation or elsewhere. Therefore this error message also doesn't give any real indication of what is wrong, apart from the fact that the make was being executed at the time and perhaps the driver.c file is involved, or a line which has something to do with this file(?).

The first thing to remember is that Eclipse is not actually compiling anything but rather calls the utilities used to compile. To be able to do this, it must be set up correctly and also the utilities installed correctly. Eclipse is working as editor, launcher for the utilities and, once everything is building correctly, as debugger interface.

I suggest first making sure that the project compiles correctly without Eclipse. To do this, simply go to the directory \Applications\uTaskerV1.3\GNU_SAM7X\ and double click the bat file Build_SAM7X.bat. First check that the GCC path in the file is correct for your PC (matches where you have installed the GNU compiler for ARM).

If the project doesn't build you will first have to solve this problem by checking that the paths are correct, the GNU compiler has been installed correctly and the uTasker project is complete. Once this standalone build works you can go back to Eclipse and try to work out why Eclipse is not doing the same - check that it knows which make file to call and that it is at the correct location.

Good luck

Regards

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Stan on December 13, 2007, 02:42:02 PM
Hi Mark
I saw that in Build_SAM7X.bat is written the following:

SET PATH=%PATH%;C:\Programme\CodeSourcery\Sourcery G++\bin
cs-make -f make_uTaskerV1.3_GNU_SAM7X all

but I haven't installed CodeSourcery(I didn't know and I saw that it's not free), I installed everything about Yagarto and I thought that it includes these utilities, I have in my PATH:
C:\Program Files\openocd-2007re204\bin;
C:\Program Files\openocd-2007re204\utils\bin;
C:\Program Files\yagarto\bin;
C:\Program Files\yagarto-tools-20070303\bin;

so I don't know why the .bat can't find the necessary rule for "make" command. When I run it, I have:

D:\...\uTasker v 1.3.0\Applications\uTaskerV1.3\GNU_SAM7X>cs-make -f make_uTaskerV1.3_GNU_SAM7X all
'cs-make' is not recognized as an internal or external command,
operable program or batch file.

I've already tried to uninstall and then install again everything , so I don't think there is something wrong with the installation. From where can I find the necessary tools for the compilation? Thanks!
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on December 13, 2007, 05:59:13 PM
Hi Stan

The stand alone "bat" based build is set up for the Code Sourcery compiler but this is also 'just' the GNU compiler. If you set the path for your installation as performed with Yagarto it should be equivalent.

Code Sourcery offers also a free version as well as a "supported" version with better debug support (for a fee). I don't know which version is 'best' but I expect they are both perfectly useable!

I suggest searching your "C:\Program Files" directory for "make.exe". Note that "cs-make" is the CodeSourcery version so you will probably have to change this to "make". Then set the path in the bat file to the location where it exists.

Good luck

Regards

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Tino on January 02, 2008, 08:53:59 PM
Hi!

I also tried to compile µTasker with Eclipse and it worked fine. Some errors came as described but it compiled.
Then I uploaded the bin with SAM-BA to the Olimex SAM7X-EX256 Board. I executed the GPNVM script, quit SAM-BA and reset the Olimex Board. Now the LCD backlight is blinking and the device is not responding.
I am quite sure that all defines are correct and I copied all given files. I am using SP1 (not Rowley, but that makes the same).
I cannot ping the board nor connect with a browser. I deleted my arp cache with arp -d.
When I start the simulation from the same project (Eclipse works in the same directory as VS) it works perfectly.
What to do??
I tried several thing but always with the same outcome.
Mark, do you have an idea or can you send me the bin?

Thanks,
Tino

Edit: The cable connection also seems correct. The green led sometimes blinks and the yellow one is on.
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 02, 2008, 10:07:08 PM
Hi Tino

The SP1 doesn't include GNU support - although the SP1 Rowley does.

GNU is a bit special because you have to be very careful about how it works with struc packing. What you probably could observe is that it is sending a corrupted response to ARP requests (as LAN LEDs are blinking) which was the case originally since it inserts holes in some of the IP structs.

A version with GNU support will have the following in tcpip.h:

Code: [Select]
#define _PACK               __attribute__((__packed__))

typedef struct _PACK stARP_FRAME                                         
{
    unsigned char ucHardwareType[2];
    unsigned char ucProtocolType[2];
    unsigned char ucHardware_size;
    unsigned char ucProtocolSize;
    unsigned char ucOpCode[2];
    unsigned char ucSenderMAC_address[MAC_LENGTH];
    unsigned char ucSender_IP_address[IPV4_LENGTH];
    unsigned char ucTargetMAC_address[MAC_LENGTH];
    unsigned char ucTarget_IP_address[IPV4_LENGTH];
} ARP_FRAME;

I don't actually have an Olimex board but there have been various confirmations that the project operates correctly on it. The RUNLED output is connected to the backlight (I don't think that there are any LEDs) so if this is flashing it is a good sign.

There is in fact a new SP (SP2) available - this will be announced later - but you could already try it (http://www.utasker.com/software/V1.3/uTaskerV1.3.0_SAM7X_SP2.zip) since it includes GNU support in form of integrated Eclipse, stand-along and Rowley projects.

Regards

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Tino on January 03, 2008, 12:48:02 PM
Hi Mark,
Thanks für the quick reply.

I copied the new files and had to adapt the makefile to the GNU compiler.

Also there seems to be an error in webInterface.c line 210:
HTTP_session->ptrFileStart = (unsigned char*)cSuccessSW_HTML;
HTTP_session->FileLength = sizeof(cSuccessSW_HTML)-1;

cSuccessSW_HTML is undefined.
I tried to resolve it, but finally I just skip the lines.

After that it compiled smoothly. But the outcome it the same. The display backlight flashes at 2 Hertz and no network communication. Though the network LEDs at the PHY are blinking sometimes.



The VS project won't compile anymore. This is the error I get:

Error   1   error LNK2019: unresolved external symbol "void __cdecl fnDoPortSim(int)" (?fnDoPortSim@@YAXH@Z) referenced in function _WinMain@16   WinSimMain.obj   


Maybe just a little thing, but that takes the most time to find :)

Thanks for your effort!
Tino
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 03, 2008, 01:36:32 PM
Hi Tino


cSuccessSW_HTML is defined at the start of webInterface.c, but it is dependent on having a file system declared larger than 160k.
        #if FILE_SYSTEM_SIZE >= (160*1024)                               // support posting new firmware only with large file system
            static const CHAR cWarningHTML[]       = UPLOAD_FAILED;
            static const CHAR cSuccessSW_HTML[]    = SW_UPLOAD_COMPLETED;
        #endif

UPLOAD_FAILED is the defined in app_hw_sam7x.h.

I suggest removing the check of file system size. I will look into this again because I have the feeling some compilers don't get the same value of >= (160*1024)  at both locations - possibly header ordering dependent. I didn't have this problem with my tests but I had a similar occurance in another project...

fnDoPortSim() is in a new file called PortSim.cpp in \WinSim.
The simulator directory contains a project set up with this - if you are using your own simulator project you will need to manually add the new file to the project. Right click on the WinWim folder in VS and then add the file.


As for the fact that the network LED is still blinking but the communication not working, this seems to not be due to the GNU packing anymore - I tested the project with three different GNU versions without any problems.
I think that you will need to debug this. It may be due to a network configuration problem (although the simulator seemed to work well - I assume using the same network settings). Have you deleted the complete FLASH to ensure that no (unexpected) parameters are being taken from the parameter block?
I would see whether the Ethernet frames are really arriving at the Ethernet task. If the arrive there you can see where they are rejected - in ARP or IP (also check the data on the network using Ethereal/WireShark. This may give some indicators.
The PHY may be working but the interface between PHY and CPU not be absolutely correct. This may take a bit more work. However I have had confirmation that the PHY configuration/interface is correct for the Olimex board when the project is compiled with OLIMEX_EX256 in config.h.

I will be away for a day so hope that you make some progress in the meantime. Good luck!!

Regards

Mark


Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Tino on January 08, 2008, 04:07:34 PM
Hi,
I deleted the entire flash and tried it again - same result.

In the meantime I could get rid of the blinking by changing the values in app_hw_sam7x.h.
I watched the IP packets in wireshark and I could see the ping tool requesting the mac for the ip, but no one replied. So something isn't running well.

I cannot believe, no one has running µTasker on an Olimex Board?
I don't have the time to go into the deep of µTasker to figure out the problem. I'll have to try another approach.

Thanks for your help and I really hope this can work someday.
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 08, 2008, 04:40:26 PM
Hi Tino

I am sorry that you haven't had success on the Olimex board. I believe the project does run on it since several users have confirmed.

Have you tried the example download code at:
http://www.utasker.com/software/software.html ?

This is generated by the IAR compiler but if it runs on your board it will at least conform that the HW is OK, which would means that it may be an issue with the GNU project for this target.

Regards

Mark

PS. I just visited the Olimex web site and checked the SAM7X board. It seems that there is a revision B board now available and the first circuit diagrams are obsolete.
Can you see whether you perhaps have a rev.- B board?
I couldn't make out the changes between the first and the B-rev circuits and I didn't see any differences in the PHY connection. But may be there is some change which needs to be respected in the SW (?)
Check also that the PHY is not being held in power down mode via PHY_PD jumper.
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Tino on January 08, 2008, 05:54:24 PM
I downloaded the demo bin and uploaded it to the olimex board.
The display is blinking again. I assume that the ip address of the demo file is 192.168.0.3?
I tried to reach it - no answer.

I have the olimex rev b.
I tried another solution with the exact identical network settings (ip, mask, gateway) and it worked. So the hardware is OK!
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 08, 2008, 06:40:16 PM
Hi Tino

Yes, the IP in the demo defaults to 192.168.0.3.

The blinking backlight indicates that the code is running but the fact that it doesn't respond to network activity suggests that something is not set up correctly for the board (this can only really be in the area of the PHY since the rest is internal). Since you have other SW oprating correctly it can not be due to a HW error. Since you have successfully communicated with the simulator using the same default set up it can also not be a network configuration issue.

My educated guess is that there is a subtle change around the PHY - possibly its physical address is different - or the Micrel PHY has a new revision number (although this shouldn't theoretically change anything). When the MII interface is configured, the PHY identifier is read. It is checked with the expected PHY identifier (with the revision bits masked out) and if the check doesn't match the Ethernet controller set up is aborted. This can easily be checked with a debugger since the Ethernet configuration routien in SAM7x.c will return early.

I will order an Olimex board so that I can look into this - I will check that I really get a Rev.B. board (rather than one from old stock) and then I hope to be able to sort it out. Unfortunately it will take a while to receive the board.

If any one else has this board (Rev. B to be sure) and knows how to verify the Ethernet initialisation (by the way, stepping through this in the simulator shows how it should work as a reference) then it would be interesting if they could step through the code to see whether I am correct - and possibly offer a solution...!

Sorry to disappoint for the moment.

Regrads

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Tino on January 09, 2008, 04:00:15 PM
Hi,
I commented the following line:
if ((ulPhyIdentifier & PHY_MASK) != PHY_IDENTIFIER) return;

- no change.
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 09, 2008, 04:25:52 PM
Hi Tino

Could you see what value was being read?

I ordered the Olimex board today. However it seems that it won't actually arrive until the end of the month. As soon as I have a solution I will post it here.

Regards

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: Tino on January 13, 2008, 04:19:17 PM
Good news!!! :)

I was playing around more and finally it works.
Actually I cannot tell what did the trick... But I have to comment the PHY check, else it doesn't work.
The next step is getting the debugger to work. Then I can tell you which value was read.

Thank you for putting so much effort in it!

I think when you offer a complete solution with an Eclipse project and debugger support ready-to-go for standard evaluation boards, even more people will try out your great software because they don't have to get their minds too much into it before they can see results. Like me ;)

Have a great day and I'll keep you updated about my project.
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 13, 2008, 05:14:43 PM
Hi Tino

That is good new.

I think that a combination of Olimex and GNU is good for a lot of people and I have in fact ordered a few extra Olimex boards as well so that these can be better integrated.

This year, there will certainly be more emphasis on the ARM devices - for example the NXP LPC family supports a very broad range of applications starting with the LPC2101 with 2k RAM and 8k FLASH at a price of not much more than $1 up to the LPC2478 with Ethernet, USB host/device/OTG 96k RAM and 512k FLASH. They are all fast ARM 7 devices with peripheral compatibility which allows an LPC2378 or LPC2368 (etc.) user to simply make a smaller embedded project based on the cheap and quite tiny devices with almost zero effort: just remove the define for Ethernet and USB (which are not available) and the code will effectively work on the other device (as long as it is not too large for the memory of course). Since all tools remain the same, there is nothing new to be learned and the the same JTAG debugging power is available if needed. Even the little ones run at up to 60MHz and run 32 bit code.

Previously one would probably have dropped down to a cheap 8-bit processor to realise a small extension function - and have to use different tools, set up new projects, compromise development confort etc. but nowadays this can hardly be justified since the HW price saving is usually negligable (and in some cases the 8 bit HW may be even more expensive!).

As well as new device support, there are also new features on the way. This, coupled with an increasing history of successful and reliable projects with the uTasker, makes for an exciting 2008!

Regards

Mark

Note: the NXP example is not the only one. Also take a look at what Luminary Micro is doing with the new Cortex M3 processors...
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: mark on January 23, 2008, 09:59:23 PM
Hi Tino

I have received an Olimex SAM7-EX256 board and can confirm the same problem that you had. The reason is that the PHY is not responding to the PHY address 0x1f - instead it requires the PHY address 0x01.

I have made a change which ensures that the PHY is initialised with the correct address - this I have detailed in the following new post:

http://www.utasker.com/forum/index.php?topic=161.0

In addition I have updated demo software for the SAM7X on the web site to include latest features - one for the ATMEL and one for the OLIMEX board (http://www.utasker.com/software/software.html).

Regards

Mark
Title: Re: Using Open Source Tools with SAM7X and uTasker project
Post by: coflynn on January 06, 2009, 04:18:44 AM
Also - a note about using the SAM-ICE device from Atmel if you have one.

It's true that to support 'flash programming' you need to buy a license from Segger for a lot of $$. However what I just do is this, which if you already have a SAM-ICE might be useful:

I have the "GDB-Server" program and "SAM-PROG v2.4" running at the same time. A debug cycle is:

* Recompile binary

* On SAM-PROG have binary file selected using 'browse'. You only have to do this the first time you open the program
* On SAM-PROG have 'Auto' checkbox
* Hit 'Yes' button, and wait until it finishes

* Start debugging in Eclipse, which will connect you to the GDB-Server
* Find bug - recompile.
* Hit 'stop' to disconnect from GDB-Server

* Hit 'yes' buttong on SAM-PROG
* etc...

I haven't had any problems with both programs running at the same time. You get into trouble if you try to access the JTAG with two programs at once - aka while in the middle of programming accidentally hit anything in the debugger that causes it to send a command to GDB-Server.

If you have a SAM-ICE hope this helps!

  -Colin