Problem with Malloc and Free use MCF52233 in CodeWarrior 6.3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with Malloc and Free use MCF52233 in CodeWarrior 6.3

1,116 Views
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! 

Labels (1)
0 Kudos
Reply
1 Reply

491 Views
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 Kudos
Reply