Problem with Malloc and Free use MCF52233 in CodeWarrior 6.3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem with Malloc and Free use MCF52233 in CodeWarrior 6.3

957 次查看
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 回复

332 次查看
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 项奖励