Problem with Malloc and Free use MCF52233 in CodeWarrior 6.3

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with Malloc and Free use MCF52233 in CodeWarrior 6.3

956件の閲覧回数
ChangSai
Contributor I

Hi , I create a project about MCF52233Demo Programe in Code Warroir 6.3.

 

But I can't use Malloc and free. At first I malloc a memory,when I free it, the chip is halt.

 

For Example:  Code is,

 

char * pt = (char *)malloc(10*sizeof(char));

        pt[0] = 'a';

        free(pt);

        pt = NULL; 

 

 

I debug it, when step in the "free(pt)", It appear the error dialog :

 

   Exception vector nam:BUS Error , PC Where the exception happend ox200012A6 

 

 

please help me! 

ラベル(1)
0 件の賞賛
1 返信

331件の閲覧回数
mjbcswitzerland
Specialist V

Hi

 

Please search for malloc in the forum to find a few discussion: the following may help in particular: http://forums.freescale.com/freescale/board/message?board.id=CWCFCOMM&thread.id=2006

 

Also try upgrading to CW7.1. There can be fundamental problems with malloc() in CW6.3, possibly explained in the link(?)

 

Regards

 

Mark

 

0 件の賞賛