µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: m_mikula on March 21, 2008, 05:59:30 PM

Title: MSL library
Post by: m_mikula on March 21, 2008, 05:59:30 PM
Hi, Is any option how to use standard MSL library into uTasker??? I need some functions and floating point aritmetics...
I insert this libs:
fp_coldfire.a
C_4i_CF_RegABI_Runtime.a
C_4i_CF_RegABI_SZ_MSL.a

Result:
floating works, but some functions like: sprintf doesn't

Code: [Select]
char aa[20];
sprintf(&aa, "char: \n\r");
fnDebugMsg(aa);

What I'm doing wrong?
Title: Re: MSL library
Post by: mark on March 21, 2008, 06:33:08 PM
Hi

You can also take a look at this thread: http://www.utasker.com/forum/index.php?topic=96.0

The libraries you are linking look good - the reg passing is important when using SP6 (are you using SP6 or maybe there is a parameter passing problem?).

I don't now why sprintf() shoudn't work - it simply parses the input string and copies it to the output buffer so is environment and hardware independent.

However I don't know whether all of the CW libraries work correctly. There seems to be a big problem with malloc support (possibly limited to certain library versions) since it fails when certain memory sizes are called - not that it is out of memory but rather it somehow doesn't like all sizes (eg. calling malloc(100); malloc(100); malloc(100); may work fine, but calling malloc(100); malloc(90); malloc(100); may return memory for the two calls for 100 bytes but return 0 for the call in the middle for 90 bytes. Therefore I don't exclude a problem with some other library functions.

I know of some poeple who instead use GNU libraries with CW rather than the supplied ones due to various difficulties. Since I haven't done much work with them myself (apart from verifying the malloc problem, which is indeed very strange which I also confirmed) I don't want to imply that there is an error in the sprintf(), rather I would point out that this is not to be totally excluded.

Regards

Mark