µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: johnr on November 05, 2010, 05:26:27 PM

Title: M52258 and SP9 ethernet problem
Post by: johnr 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

Title: Re: M52258 and SP9 ethernet problem
Post by: mark 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
Title: Re: M52258 and SP9 ethernet problem
Post by: johnr 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
 
Title: Re: M52258 and SP9 ethernet problem
Post by: mark on November 06, 2010, 12:19:52 AM
Hi John

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


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
Title: Re: M52258 and SP9 ethernet problem
Post by: johnr 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