Author Topic: Configuration for MCF52258  (Read 8788 times)

Offline dkg

  • Newbie
  • *
  • Posts: 48
    • View Profile
Configuration for MCF52258
« on: September 22, 2009, 01:47:02 PM »
I am implementing uTasker on a board that has a 52258. The one difference between the 52259 and 52258 is that my chip doesn't have the random number generator. The problem is, I don't see how to use the definitions in config.h to tell uTasker that I do not have the RNG while at the same time using all the other code for the 5225x.

IOW, defining _M5225X will bring in the RNG code which just hangs forever on my chip. For now, I am commenting out the definition of RND_HW_SUPPORT in M5223X.h to get around the issue.

I just thought you should know that not all 5225x chips will work when configuring for _M5225X. In fact, only two of the six chips in the 5225x family will work.

Dave G.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Configuration for MCF52258
« Reply #1 on: September 22, 2009, 06:24:25 PM »
Hi Dave

As I understand it only the M52235, M52255 and M52259 have the random number generator. This is also shown here (my overview of things as I understand them)
http://www.utasker.com/forum/index.php?topic=256.msg995#msg995

I checked where the use of the RNG was controlled. It is in m5223x.h

#if defined _M52235 || defined _M5225X
    #define RND_HW_SUPPORT             
#endif


It is enabling when the Kirin3 is selected and so is not correct. It will indeed cause the processor to hang if the SW attempts to use it.
Therefore the best correction (to automate this) is to change the check in that file to

#if defined _M52235 || defined _M52255 || defined _M52259
    #define RND_HW_SUPPORT                               
#endif


Note that the exact chip type is defined in app_hw_m5223x.h. If either of the Freescale boards is used (M52259EVB or M52259DEMO as defined in config.h) the 144 pin _M52259 is automatically selected.
When using your own board you can select _M52258 which should then control the use of the SW based RNG instead.

!!! I tested and found another problem. There is a basic dependency problem in the Coldfire project: the exact type is defined in app_hw_m5223x.h but some decisions based on it in m5223x.h. Since there are some defines from m5223x.h used for calculations in app_hw_m5223x.h the include ordering is first m5223x.h and then app_hw_m5223x.h. The result is that the detailed decisions in m5223x.h don't work correctly since they know nothing about the detailed chip type!!!!

The solution to this was to remove the include of #include "../../Hardware/m5223x/M5223X.h" from types.h to within app_hw_m5223x.h. It can be positioned just after the detailed chip type settings. Then it all really does adjust itself as it should. The RND was in fact not being enabled together with the M52235 since the define _M52235 was never seen before. This should also be improved...

Thanks for pointing this error out. I have put a link to this thread in the patch list! http://www.utasker.com/forum/index.php?topic=644.msg2954#msg2954

Regards

Mark


« Last Edit: September 22, 2009, 06:39:36 PM by mark »