Discussion Forum

Avoiding startup initialization of variables

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Ruven H
Posted
7-Jul-2003 16:11 GMT
Toolset
C51
New! Avoiding startup initialization of variables
Hello all,
My target is based on micro T89C51RD2 (with 64K flash, 1K RAM and 2K EEPROM), also in my target 32K SRAM and 8K EEPROM.
I need that some values of some parameters will not bee initialized to zero after reset (not power down). I reed and implemented what was written in post http://www.keil.com/support/docs/826.htm,
but it still not working.
In the STARTUP.A51 I changed the XDATASTART and XDATALEN as follow:
XDATASTART EQU 1C20H
XDATALEN EQU 10000H
In my program I locate the variable in addr 0x0000:
volatile rcvMSG xdata stRxBuff[NUM][LEN] _at_ 0x1000;
Am I missing something?

Please help,
Ruven
Read-Only
Author
erik malund
Posted
7-Jul-2003 16:36 GMT
Toolset
C51
New! RE: Avoiding startup initialization of variables
XDATASTART EQU 1C20H
XDATALEN EQU 10000H
Am I missing something?

My guess is that the code wraps, so that you still clear all. Set the length to 10000-1c20

Erik
Read-Only
Author
Ruven H
Posted
8-Jul-2003 06:55 GMT
Toolset
C51
New! RE: Avoiding startup initialization of variables
Hi Erik,
Thanks for your respond.
I tried to change XDATALEN from 10000H to E3E0H (10000H-1C20H), now I receive assembling error:
STARTUP.A51(30): error A45: UNDEFINED SYMBOL (PASS-2)
When I double click this message uVision points on XDATALEN.

P.S.
I don't think it's relevant to this case but I'm using the RTX-Full OS.

Regards,
Roberto
Read-Only
Author
Ruven H
Posted
8-Jul-2003 08:10 GMT
Toolset
C51
New! RE: Avoiding startup initialization of variables
Hi again,
I solve the assembler error by writing zero before the number (0E3E0H instead of E3E0H).
Now I don't receive any errors but the variable value is still initialized to zero after reset.

Any more ideas?
Ruven.
Read-Only
Author
Keil Support Intl.
Posted
8-Jul-2003 09:24 GMT
Toolset
C51
New! RE: Avoiding startup initialization of variables
You should use the simulator and check what happens in the startup code. From what you say everything seems correct (so you must make some other mistake).
Read-Only
Author
Ruven H
Posted
10-Jul-2003 09:16 GMT
Toolset
C51
New! RE: Avoiding startup initialization of variables
Thanks a lot,
I'll try to do so.
Read-Only
Author
Ruven H
Posted
10-Jul-2003 10:07 GMT
Toolset
C51
New! RE: Avoiding startup initialization of variables
Is it possible that RTXCONF.A51 and RTXSETUP.DSL influence the STARTUP.A51 settings?
Is there is a recommended order to put RTXCONF.A51, RTXSETUP.DSL, STARTUP.A51 and INIT.A51 in the project?

Thanks a lot,
R.H

Next Thread | Thread List | Previous Thread Start a Thread | Settings