Author Topic: M52258 and SP9 ethernet problem  (Read 4074 times)

Offline johnr

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
M52258 and SP9 ethernet problem
« on: November 05, 2010, 05:26:27 PM »
Hi Mark, We're using an M52258, CW10 , and porting our modified uTasker SP6 code, which we've been
running on a M5223x, to run on the new M5225x using the SP9 changes you made. I've found that in the function entry_eth() in eth_driv.c that I had to change the

     #ifdef _M5223X to #if defined(_M5223X ) || defined(_M5225X )  in the 3 places it's used to
get the ethernet to work. Without this change the ethernet buffering isn't handled properly. Is there
some other option that I'm overlooking here ?

 John


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3068
    • View Profile
    • uTasker
Re: M52258 and SP9 ethernet problem
« Reply #1 on: November 05, 2010, 06:01:38 PM »
Hi John

The define _M5223X is always used with the Coldfire project - the define _M5225X then specifies what the actual device is.

This means that
#ifdef _M5223X
and
#if defined(_M5223X ) || defined(_M5225X )
are equivalent (since _M5223X is always true).

Maybe you deactivated the define _M5223X?

Regards

Mark

Offline johnr

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Re: M52258 and SP9 ethernet problem
« Reply #2 on: November 05, 2010, 09:06:37 PM »
Hi Mark,
 We're developing products based on the 5223X and 5225x from the same
source tree. We define either 5223X or 5225x  based on the actual Coldfire chip we're
targeting. So far the SPI EEPROM, serial port and Ethernet code is working with only the 5225x
defined on the new project.
 We did have to add #if defined(M5223X) || defined(M5225X) in a number of places. Why  are there two versions of the defines. ie  _M5223X and M5223x. I originally thought the _M5223X was used in assembly code and M5223x in compiler code, but it's not the case.

 Thanks,
 John
 
« Last Edit: November 05, 2010, 09:13:47 PM by johnr »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3068
    • View Profile
    • uTasker
Re: M52258 and SP9 ethernet problem
« Reply #3 on: November 06, 2010, 12:19:52 AM »
Hi John

If you work with M5223X and M5225X you need to set the following defines:

  • For M5223X - just set _M5223X
  • For M5225X - set _M5223X and _M5225X

You should find that both project work without any changes to the code.

Background: The M5223X was the first family supported by the project and _M5223X is used to distinguish Coldfires against SAM7X, Luminary etc. (for users of multiple manufactures).
When the M5225X can along it was distinguished by adding _M5225X to the base define (there are also _M5222X, _M5221X, _M521XX, _M520X, _M528X and _M521X which are used together with _M5223X for other derivatives - note that these may not all be in your package but are in the development version).

There is no define _M5223x (with x lower case) in any project (I just searched in V1.2 to latest V1.4 versions to be sure that there was not one once) so I think that this must be a change (typo?) that someone at your end made at some time.

Regards

Mark

Offline johnr

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Re: M52258 and SP9 ethernet problem
« Reply #4 on: November 07, 2010, 01:41:08 AM »
Thanks Mark, the lowercase x was a typo. My co worker may have introduced the _M5223X defines. Our source tree
is heavily modified from the uTasker base.

 John