HC9S08QE8 - Out of allocation space in segment RAM

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

HC9S08QE8 - Out of allocation space in segment RAM

跳至解决方案
5,127 次查看
mexxx01
Contributor I

Hello all!

 

I am very new in microcontrollers...i searched long time through the forum, but I couldn't find something similar to my problem.

 

I trying to programm a HC9S08QE8 with USBDM and CodeWarrior for Eclipse. I got some sample code from freescale with my sensor toolbox. Now I am having the following problem:

 

ERROR L1102: Out of allocation space in segment RAM at address 0x1C8

 

Most of the variables are stored according #pragma DATA_SEG __SHORT_SEG _DATA_ZEROPAGE.

 

The prm file is like that:

 

SEGMENTS
    Z_RAM                    =  READ_WRITE   0x0060 TO 0x00FF;
    RAM                      =  READ_WRITE   0x0100 TO 0x025F;
    ROM                      =  READ_ONLY    0xE000 TO 0xFFAD;
    ROM1                     =  READ_ONLY    0xFFC0 TO 0xFFCD;

 

For the project I am using the memory model SMALL.

Can you help me to fix that problem, please.

 

br

max

标签 (1)
标记 (1)
0 项奖励
1 解答
1,847 次查看
CrasyCat
Specialist III

Hello

 

According to your ,map file you have following objects which will be allocated in RAM:

  fifo_data (size 0xC0), BufferTx  (size 0xC8) and stack (size 0x40).

This makes a total of 0x1c8 bytes, which does not fit into the RAM area (0x0100 TO 0x025F).
Try to define smaller fifo_data and/or BufferTx.

CrasyCat

在原帖中查看解决方案

0 项奖励
6 回复数
1,847 次查看
CrasyCat
Specialist III

Hello

 

Apparently the area RAM (0x0100 TO 0x025F) is not big enough to hold all data you want to allocate there.

 

Check the generated .map file. It should indicate which variable could not be allocated.

 

CrasyCat

0 项奖励
1,847 次查看
mexxx01
Contributor I

Hello CrasyCat

 

Thank you for your fast response.

 

 

Most of the variables are indicated as error. Is it possible, that I missed some settings for the linker in codewarrior. Thats the original AN3922 code for the sensor toolbox, and I supposed that I won`t have problem to compile it again. I am very confused...I tried to compile that with several settings, but without luck.

 

Maybe the attached .map file can tell you (the expert) what I am doing wrong.

 

 

0 项奖励
1,847 次查看
stanish
NXP Employee
NXP Employee

Hello,

 

I'd suspect this might be caused by the size of  the stack.

Could you doble check stack fits the RAM?

 

RAM includes 200 bytes variable BufferTX so the remaining space for stack < 0x98 (152 Bytes)

 

Stanish

0 项奖励
1,847 次查看
mexxx01
Contributor I

Hello!

 

 

At the project.prm there is the size of the stack defined as followed:

 

STACKSIZE 0x40

 

should be ok

 

I checked the rest of the prm file in relation to the memory map. Should be no problem.

 

Is it possible that I missed a linker or compiler setting ?

0 项奖励
1,848 次查看
CrasyCat
Specialist III

Hello

 

According to your ,map file you have following objects which will be allocated in RAM:

  fifo_data (size 0xC0), BufferTx  (size 0xC8) and stack (size 0x40).

This makes a total of 0x1c8 bytes, which does not fit into the RAM area (0x0100 TO 0x025F).
Try to define smaller fifo_data and/or BufferTx.

CrasyCat

0 项奖励
1,847 次查看
mexxx01
Contributor I

Hey!

 

Ah...I am so stupid.

Thank you....it is working now!!

 

 

Thank you for this great support

0 项奖励