Array over 123 elements

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

Array over 123 elements

跳至解决方案
1,467 次查看
aaronlee
Contributor V

Hi,

My project is using S12ZVCA. I have an issue about array over 123 element as follow:

void main(void) {
const unsigned int TemperatureTable[124]={ 
4924, 4920, 4915, 4910, 4905, 4900, 4894, 4888, 4882, 4876,
4869, 4862, 4855, 4847, 4839, 4831, 4822, 4813, 4803, 4794,
4783, 4773, 4761, 4750, 4738, 4725, 4712, 4699, 4685, 4671,
4656, 4640, 4624, 4608, 4590, 4573, 4555, 4536, 4516, 4496,
4476,
4454, 4432, 4410, 4387, 4363, 4338, 4314, 4288, 4262, 4235,
4207, 4179, 4150, 4121, 4091, 4060, 4029, 3998, 3965, 3933,
3899, 3864, 3830, 3795, 3759, 3723, 3687, 3650, 3612, 3575,
3536, 3498, 3459, 3420, 3380, 3340, 3300, 3260, 3219, 3178,
3137, 3096, 3055, 3014, 2973, 2931, 2890, 2849, 2807, 2766,
2725, 2684, 2643, 2602, 2562, 2521, 2481, 2441, 2401, 2362,
2322, 2284, 2245, 2207, 2169, 2131, 2094, 2057, 2021, 1985,
1949, 1914, 1879, 1845, 1810, 1777, 1744, 1711, 1679, 1648,
1617, 1586, 1555};

}

I execute step by step in debugging mode. It terminate after assign array TemperatureTable[124]={......}.

Then show message as follow:

No source available for "0x0001F1 (0x0001F1)() "

It can work when elements of array less than 123. How to resolve the issue?

Best Regards,

Aaron

标记 (2)
1 解答
1,165 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The reason for this is that the array is placed on the stack.

So you can extend the stacksize in the linker file:

 stack.png

You can place the array as global (before the main function), or declare it as a static array.

Also, there is an article S12Z constant, variable, code allocation in CodeWarrior you can refer to.

Regards,

Daniel

在原帖中查看解决方案

1 回复
1,166 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The reason for this is that the array is placed on the stack.

So you can extend the stacksize in the linker file:

 stack.png

You can place the array as global (before the main function), or declare it as a static array.

Also, there is an article S12Z constant, variable, code allocation in CodeWarrior you can refer to.

Regards,

Daniel