How to set heap size 0 in MCUXpresso IDE

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

How to set heap size 0 in MCUXpresso IDE

跳至解决方案
1,492 次查看
zorrotz
Contributor III

Hi,

I´m trying to set size 0 for the heap, but automaticaly it is set to 'default'.

How can I set heap size to 0 or disable the heap?

Thanks

0 项奖励
1 解答
1,283 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Yes, it looks like the current implementation of the Heap and Stack placement table only allows the heap to be reduced to 4 bytes, rather than 0. But also providing the below function in your application should do the trick:

unsigned __check_heap_overflow (void * new_end_of_heap) {
   return 1; // Heap has overflowed
}

See chapter 12 of the MCUXpresso IDE v10.0.0 User Guide for more details on this function.

Regards,

MCUXpresso IDE Support

在原帖中查看解决方案

0 项奖励
2 回复数
1,284 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Yes, it looks like the current implementation of the Heap and Stack placement table only allows the heap to be reduced to 4 bytes, rather than 0. But also providing the below function in your application should do the trick:

unsigned __check_heap_overflow (void * new_end_of_heap) {
   return 1; // Heap has overflowed
}

See chapter 12 of the MCUXpresso IDE v10.0.0 User Guide for more details on this function.

Regards,

MCUXpresso IDE Support

0 项奖励
1,283 次查看
zorrotz
Contributor III

Thank you

This trick helps.

0 项奖励