Hello,
when trying to discover why my program isn't booting-up properly (F2812 processor, CGT 6.4.4), I've found, that the .cinit section isn't terminated properly - or did I miss something?
The data in .cinit section looks like this (extracted from HEX file):
Length: FFFE (2) Address: 003F8220 Data: 0000 0000
Lenght: FF8A (118) Address: 003F8380 Data: 0046 0069 0072 006D 0077 0061 0072 0065
0020 0032 0038 0031 0032 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0053 006B 006F 0064 0061 0020 0045 006C 0065 0063 0074 0072 0069 0063 002C 0020
0073 002E 0020 0072 002E 0020 006F 002E 0000 0000 0000 0000 0030 0038 002E 0030
0039 002E 0032 0030 0030 0037 0000 0000 0031 002E 0032 002E 0030 0033 0030 0000
005A 0061 006B 006C 0061 0064 006E 0069 0020 0070 0072 006F 0067 0072 0061 006D
006F 0076 0065 0020 0076 0079 0062 0061 0076 0065 006E 0069 0020 006A 0065 0064
006E 006F 0074 006B 0079 0020 0048 0032 0031 0030 0035 0050 0031 0000
Length: FFFE (2) Address: 003F8736 Data: 0000 0000
Lenght: FFFE (2) Address: 003F8738 Data: 0000 0000
Length: FFFE (2) Address: 003F873A Data: 1A09 003F
Length: FFFE (2) Address: 003F873C Data: 1A09 003F
Length: FFFF (1) Address: 003F872B Data: 0000
No terminating zeros follows - instead, the .switch section follows immediately after the last data word. But the rts2800 library expects the .cinit section to be terminated by zero-length entry, even the comment in boot28.inc from rts2800 sources states, that "The init table is terminated with a zero length".
Compiler options: -c -g -q -pdr -pdv -as -O1 -ml -v28 -fr"$(OBJDIR)" -ff"$(LSTDIR)" -fs"$(ASMDIR)"
Linker options: -z --disable_clink -m"./$(TARDIR)/$(PROG).map" -o"./$(TARDIR)/$(PROG).out" -stack=0x400 -w -x $(INCLIBS) $(LIBS) $(CMDFILE)
hex2000 options: -q file.out -i -memwidth 16 -romwidth 16 -map file.mpx
The .cinit record in the map file looks like this:
.cinit 0 003f2b4e 00000096
003f2b4e 0000007e mon.obj (.cinit)
003f2bcc 0000000a rts2800_ml.lib : exit.obj (.cinit)
003f2bd6 00000005 : _lock.obj (.cinit:__lock)
003f2bdb 00000005 : _lock.obj (.cinit:__unlock)
003f2be0 00000004 sflash.obj (.cinit)
The length (96 (hex) = 150 (dec)) corresponds to the above data from HEX file: there are seven data blocks, each block has a three words long header, that gives 21 words for headers and 118 + 5*2 + 1 = 129 data words. When we put it together, it gives 129 + 21 = 150 words. So the map file and HEX file corresponds. But hey! Where is the terminating word?