More info on the problem:
I compiled the software with a trivial change:
static volatile char xxx[19]; => static volatile char xxx[20];
and with the value 19 it works and 20 it does not.
So I took the diff of the maps produced by the compiler (see bottom):
My guess is , seeing that I'm right at the limit where variables
overflow
the first bank 0000-0100 to 0200 and upwards (just beyond the stack),
that this has something to do with it. But what?
An other thing I noticed is that (see the diff file execrt here):
< udata_stepper_6 udata 0x0000fe data
0x000001
> udata_stepper_6 udata 0x000200 data
0x000001
So some (what?) stepper_6 gets pushed to a different page.
Looking at the stepper.asm file I see:
00319
00320 udata_stepper_6 udata
00321 _stepperDump_t_1_1 res 36
00322
So this is a largish reservation, which I guess originates from this
(from stepper.c):
stepperState t;
USE_STEPPER(CRITICAL(memcpy(&t,&STEPPER,sizeof(stepperState));));
But why would this matter? And without realy understanding what is
going on
I would have thought that moving this variable to all on page would be
better...?!
Or wait a minute, I see that:
< udata_usartd_0 udata 0x000201 data
0x000001
---
> udata_usartd_0 udata 0x000202 data
0x000001
So when stepperDump_t_1_1 is at 0x00fe it extends to the next page
(stack)
which it should not (?) do but it does not matter since I do not use
that much
stack, so probaply no collision there. However, when it get pushed to
0x0200
then the variable udata_usartd_0 is right there in the next address
so where is my 36 bytes dude? So the memset overwrite everything after
that?!
Could this be it?
Have I analyzed this correctly? If so why there is no linker warning?
br Kusti
br Kusti
2c2
< Map File - Created 1-25-2009 16:24:12
---
> Map File - Created 1-25-2009 16:24:51
57c57
< .idata idata 0x0000d8 data
0x000007
---
> .idata idata 0x0000d9 data
0x000007
61,77c61,76
< udata_stepper_0 udata 0x0000a4 data
0x000013
< udata_vfprintf_0 udata 0x0000b7 data
0x00000d
< udata_cmdInterp_0 udata 0x0000c4 data
0x00000a
< udata_usartirq_1 udata 0x0000ce data
0x00000a
< udata_mullong_0 udata 0x0000df data
0x000004
< udata_mullong_1 udata 0x0000e3 data
0x000004
< udata_mullong_2 udata 0x0000e7 data
0x000004
< udata_mullong_3 udata 0x0000eb data
0x000004
< udata_mullong_4 udata 0x0000ef data
0x000004
< udata_streams_0 udata 0x0000f3 data
0x000003
< udata_streams_1 udata 0x0000f6 data
0x000003
< udata_stepper_1 udata 0x0000f9 data
0x000001
< udata_stepper_2 udata 0x0000fa data
0x000001
< udata_stepper_3 udata 0x0000fb data
0x000001
< udata_stepper_4 udata 0x0000fc data
0x000001
< udata_stepper_5 udata 0x0000fd data
0x000001
< udata_stepper_6 udata 0x0000fe data
0x000001
---
> udata_stepper_0 udata 0x0000a4 data
0x000014
> udata_vfprintf_0 udata 0x0000b8 data
0x00000d
> udata_cmdInterp_0 udata 0x0000c5 data
0x00000a
> udata_usartirq_1 udata 0x0000cf data
0x00000a
> udata_mullong_0 udata 0x0000e0 data
0x000004
> udata_mullong_1 udata 0x0000e4 data
0x000004
> udata_mullong_2 udata 0x0000e8 data
0x000004
> udata_mullong_3 udata 0x0000ec data
0x000004
> udata_mullong_4 udata 0x0000f0 data
0x000004
> udata_streams_0 udata 0x0000f4 data
0x000003
> udata_streams_1 udata 0x0000f7 data
0x000003
> udata_stepper_1 udata 0x0000fa data
0x000001
> udata_stepper_2 udata 0x0000fb data
0x000001
> udata_stepper_3 udata 0x0000fc data
0x000001
> udata_stepper_4 udata 0x0000fd data
0x000001
> udata_stepper_5 udata 0x0000fe data
0x000001
79,80c78,80
< udata_usartirq_0 udata 0x000200 data
0x000001
< udata_usartd_0 udata 0x000201 data
0x000001
---
> udata_stepper_6 udata 0x000200 data
0x000001
> udata_usartirq_0 udata 0x000201 data
0x000001
> udata_usartd_0 udata 0x000202 data
0x000001
168,173c168,173
< _stepperSeekPosition___sdcc_iflags_4_4 0x0000f9 data
static ../obj/stepper.asm
< _stepperGetState___sdcc_iflags_4_4 0x0000fa data static
../obj/stepper.asm
< _stepperGetPosition___sdcc_iflags_4_4 0x0000fb data
static ../obj/stepper.asm
< _stepperQueueGo___sdcc_iflags_4_4 0x0000fc data static
../obj/stepper.asm
< _stepperDump___sdcc_iflags_4_4 0x0000fd data static
../obj/stepper.asm
< _cntr 0x0000fe data extern
../obj/stepper.asm
---
> _stepperSeekPosition___sdcc_iflags_4_4 0x0000fa data
static ../obj/stepper.asm
> _stepperGetState___sdcc_iflags_4_4 0x0000fb data static
../obj/stepper.asm
> _stepperGetPosition___sdcc_iflags_4_4 0x0000fc data
static ../obj/stepper.asm
> _stepperQueueGo___sdcc_iflags_4_4 0x0000fd data static
../obj/stepper.asm
> _stepperDump___sdcc_iflags_4_4 0x0000fe data static
../obj/stepper.asm
> _cntr 0x000200 data extern
../obj/stepper.asm
232c232
< _linelen 0x0000d8 data static
../obj/cmdInterp.asm
---
> _linelen 0x0000d9 data static
../obj/cmdInterp.asm
236c236
< _linebuffer 0x0000c4 data static
../obj/cmdInterp.asm
---
> _linebuffer 0x0000c5 data static
../obj/cmdInterp.asm
243,247c243,247
< _usart_rx_data 0x0000d9 data extern
../obj/usartirq.asm
< _usart_rx_ready 0x0000da data extern
../obj/usartirq.asm
< _rear 0x0000db data static
../obj/usartirq.asm
< _front 0x0000dc data static
../obj/usartirq.asm
< _size 0x0000dd data static
../obj/usartirq.asm
---
> _usart_rx_data 0x0000da data extern
../obj/usartirq.asm
> _usart_rx_ready 0x0000db data extern
../obj/usartirq.asm
> _rear 0x0000dc data static
../obj/usartirq.asm
> _front 0x0000dd data static
../obj/usartirq.asm
> _size 0x0000de data static
../obj/usartirq.asm
252,253c252,253
< _getchar___sdcc_iflags_3_3 0x000200 data static
../obj/usartirq.asm
< _queue 0x0000ce data static
../obj/usartirq.asm
---
> _getchar___sdcc_iflags_3_3 0x000201 data static
../obj/usartirq.asm
> _queue 0x0000cf data static
../obj/usartirq.asm
280c280
< ___uflags 0x0000de data extern crt0i.asm
---
> ___uflags 0x0000df data extern crt0i.asm
291,292c291,292
< _stdout 0x0000f3 data extern
streams.asm
< _stdin 0x0000f6 data extern
streams.asm
---
> _stdout 0x0000f4 data extern
streams.asm
> _stdin 0x0000f7 data extern
streams.asm
328c328
< _vfprintf_buffer_1_1 0x0000b7 data static
vfprintf.asm
---
> _vfprintf_buffer_1_1 0x0000b8 data static
vfprintf.asm
477c477
< _USART_Status 0x000201 data extern
libio18f4550_a-usartd.asm
---
> _USART_Status 0x000202 data extern
libio18f4550_a-usartd.asm
486,490c486,490
< __mullong_x_1_1 0x0000df data static
mullong.asm
< __mullong_y_1_1 0x0000e3 data static
mullong.asm
< __mullong_t_1_1 0x0000e7 data static
mullong.asm
< __mullong_t1_1_1 0x0000eb data static
mullong.asm
< __mullong_t2_1_1 0x0000ef data static
mullong.asm
---
> __mullong_x_1_1 0x0000e0 data static
mullong.asm
> __mullong_y_1_1 0x0000e4 data static
mullong.asm
> __mullong_t_1_1 0x0000e8 data static
mullong.asm
> __mullong_t1_1_1 0x0000ec data static
mullong.asm
> __mullong_t2_1_1 0x0000f0 data static
mullong.asm
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user