Author Topic: Unable to configure correctly Rowley SAM7-EX Board (uTasker SP3)  (Read 10152 times)

Offline FrankD

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to configure correctly Rowley SAM7-EX Board (uTasker SP3)
« on: November 22, 2008, 10:02:38 PM »
Hello everyone.

First of all I would like to thank the uTasker Team for having academic licences available, this is a great incentive for me and my fellow classmates.

I've had a few problems with running the application correctly on my Olimex SAM7-EX256 Board with CrossStudio from Rowley Assosiates.

My question is: What should be configured in the source code so that it runs correctly for my Hardware?

I've already done the following:

In the config.h file I've changed the
Code: [Select]
#ifdef _HW_SAM7X
    #define SAM7X_EVAL                                                   // evaluation board from ATMEL
    //#define OLIMEX_EX256                                                 // Low cost evaluation board from Olimex[/quote]

To:
Code: [Select]
#ifdef _HW_SAM7X
    //#define SAM7X_EVAL                                                   // evaluation board from ATMEL
    #define OLIMEX_EX256                                                 // Low cost evaluation board from Olimex

This made the following errors appear in the following line of code (which I've commented just to be able to compile and run)
Code: [Select]
            http_session->ptrFileStart = (unsigned char*)cSuccessSW_HTML; BORRE
            http_session->FileLength = sizeof(cSuccessSW_HTML)-1;
Error:

Code: [Select]
In webInterface.c
'cSuccessSW_HTML' undeclared (first use in this function)
'BORRE' undeclared (first use in this function)


I've also changed the IP, submask, default gateway and DNS server parameters to fit my network (Im using a linksys WRT54GX2)

Code: [Select]
static const NETWORK_PARAMETERS network_default = {
    (AUTO_NEGOTIATE | FULL_DUPLEX | RX_FLOW_CONTROL),                    // usNetworkOptions - see driver.h for other possibilities
    {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},                                // ucOurMAC - when no other value can be read from parameters this will be used
    { 192, 168, 1, 3 },                                                  // ucOurIP - our default IP address
    { 255, 255, 255, 0 },                                                // ucNetMask - Our default network mask
    { 192, 168, 1, 1 },                                                  // ucDefGW - Our default gateway
    { 192, 168, 1, 1 },                                                  // ucDNS_server - Our default DNS server
};

I also read on another forum post about the PHY controllers, and made the following changes from:
Code: [Select]
    #define DRIVE_PHY_OPTION_LINES() PIO_PER_B = (PCS_LPBK | ISOLATION_MODE | RMII_MODE | RMII_BACKTOBACK_MODE); \
                                     PIO_OER_B = (PCS_LPBK | ISOLATION_MODE | RMII_MODE | RMII_BACKTOBACK_MODE);

To:

Code: [Select]
    #define PHY_ADD_31              (PB05 | PB06 | PB13 | PB14)         

    // set the option lines as we would like them to be for the MICREL PHY
    // drive to zero (default after reset)
    // drive PHY address configuration lines to correct address value
    #define DRIVE_PHY_OPTION_LINES() PIO_PER_B = (PCS_LPBK | ISOLATION_MODE | RMII_MODE | RMII_BACKTOBACK_MODE | PHY_ADD_31); \
                                     PIO_OER_B = (PCS_LPBK | ISOLATION_MODE | RMII_MODE | RMII_BACKTOBACK_MODE | PHY_ADD_31); \
                                     PIO_SODR_B = (PHY_ADD_31);

Once loaded to my board, the LCD flashes every half a second or so, and the Ethernet Yellow status LED turns solid and and the green status LED blinks occasionally.

Any help would be greatly appreciated, I'll continue to read the documentation, but so far I've missed what else I must do.

The simulator so far was of no help, since I use windows Vista and visual studio 2008  and ir appears to have problems (for example, it never detects any NIC devices on my computer)

Thank you for your time.

Javier Diaz

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Unable to configure correctly Rowley SAM7-EX Board (uTasker SP3)
« Reply #1 on: November 22, 2008, 11:56:07 PM »
Hi Javier

Welcome to the project. It looks as though the board is running but there seems to be a problem with the Ethernet interface, as you already known.

1. You have correctly configured for your Olimex board. This is in fact all that you should need to do.

2. Your IP configuration change is correct so that you can contact the board on your network.

3. The PHY line driving is a possible improvement so it is correct what you have modified.

4. The problem with cSuccessSW_HTML is strange because sometimes it occurs but not always.
The const string define is enclosed by a define #if FILE_SYSTEM_SIZE >= (160*1024) as is its use. At one location it is TRUE but at the other not - I would simply remove the condition since it is not really needed.

Recently it was found that the newer version of GCC optimises differently and caused the Ethernet interrupt initialisation to fail. See the following thread and see whether that possibly solves the problem for you:
http://www.utasker.com/forum/index.php?topic=434.0
Rowley uses the GNU compiler and your version is possibly using also a newer version that the one that I originally tested with.

Finally, you can load a pre-compiled version for your board from here:
http://www.utasker.com/software/software.html
This will verify that the board doesn't have any problems since it has been proven on the evaluation boards - it will however not have the IP configuration to match your network, but you can temporarily modify your PC configuration for a quick test.

5. I use Vista and have tested with VS 2008. However you are now the second person to mention a problem with the NIC configuration. I don't have an explanation at the moment but here are a few notes:
- the NICs are listed by using a WinPCap function (see fnGetNicList() in WinPcap.cpp). You can set a break point there and see whether you can see an error code with any meaning. I wonder whether newer WinPCAP versions (eg. installed with WireShark) behave differently?
- the NIC used is saved to NIC.ini and then used the next time to automatically select the correct one.
If the first NIC is used it saves simply the value '1' to the file (without the ''). You could try adding this to the NIC.ini to see whether it will at least use it, even if it can't display it...

Good luck

Regards

Mark


Offline FrankD

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unable to configure correctly Rowley SAM7-EX Board (uTasker SP3)
« Reply #2 on: November 23, 2008, 01:06:53 AM »
Thank you for the prompt response Mark, I'll look into your answer. I'll report back once I get everything up and running (or if I find myself stuck again ;D).

Thank you for your time again.

Javier

Offline FrankD

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unable to configure correctly Rowley SAM7-EX Board (uTasker SP3)
« Reply #3 on: November 28, 2008, 05:14:26 AM »
Hello everyone, just wanted to give closure to this post.

I've managed to run uTasker on my board after somework, however, Ethernet is still unable to function, Mark has helped me a lot on this issue, and we are almost to the conclusion that the board's PHY is fauilty. Every other tested function in the board seems fine, but all depending on the ethernet port have failed.

I've installed the simulator on an XP machine and everything worked fine...

Hopefully I can get another board, however it will most likely be too late for my final projects, which ill just simulate in order to present it. If by any chance I manage to make the board work, I will post what was wrong, because it's still a posibility that the PHY could have differences from other boards.

Thanks again.

Javier