Dear Sirs,
My C Startup code is written in assembly and has those lines (copied from HARDCHA.LST):
------ 1803 ?PR?STARTUP1?HARDWARE_DRV_CH_ASM SEGMENT CODE ------ 1804 RSEG ?PR?STARTUP1?HARDWARE_DRV_CH_ASM ... 00013A 020000 E 2212 LJMP ?C_START
LX51 linker shows:
*** ERROR L121: IMPROPER FIXUP MODULE: .\Temp\HarDCha.obj (?HARDWARE_DRV_CH_ASM) SEGMENT: ?PR?STARTUP1?HARDWARE_DRV_CH_ASM OFFSET: 00013BH
The map file has:
MEMORY MAP OF MODULE: .\Temp\TP_KIca.a03 (KERNEL) START STOP LENGTH ALIGN RELOC MEMORY CLASS SEGMENT NAME ========================================================================= * * * * * * * * * * * C O D E M E M O R Y * * * * * * * * * * * * * *** CODE BANK 0 *** 002700H 00277FH 000080H BYTE UNIT CODE/B0 ?C_C51STARTUP ... *** COMMON AREA *** 001A68H 001BADH 000146H BYTE UNIT CODE ?PR?STARTUP1?HARDWARE_DRV_CH_ASM ... PUBLIC SYMBOLS OF MODULE: .\Temp\TP_KIca.a03 (KERNEL) VALUE CLASS TYPE PUBLIC SYMBOL NAME ================================================= 0080273BH CODE/B0 --- ?C_START
Why this error happens? I'm using LJMP and LX51 can put a 16 bit address on 13BH address.
What's a meanning of "E" letter after 020000 on HARDCHA.LST?
what is "My C Startup code"?
My C Startup code is written in assembly
?
It means I have written C startup on assembly.
Sorry for my wrong English...
What about Improper fixup, any idea?
Have you tried looking it up in the Manual?
Or putting it into the 'Search' box?
is this a replacement for startup.a51 ? if show the code
0080273BH how did you get THAT address?
Erik
Yes.
LX51 User's Guide: GENERAL: LOCATING IMPROPER FIXUP INSTRUCTIONS:
CAUSE A fixup error is generated when it is impossible to generate an instruction address that reaches an operand. This is frequently the case with instructions that implement relative jumps or branches. Typically, improper fixups are caused by in-line assembly code that attempts to access an address that is too far away. LX51 can put destination address (273BH) on 2 byte of LJMP operand (address ?PR?STARTUP1?HARDWARE_DRV_CH_ASM + 013BH).
I think 80 above means Bank 0.
From file MAP:
00818917H CODE/B1 --- _CompHora 00807EA4H CODE/B0 --- _CONFALARME 008185EFH CODE/B1 --- _ConfirmaKernelError 00815C34H CODE/B1 --- _CorrigeHorario 00809EC0H CODE/B0 --- _CpyPagFsh2Buff 0080ECC9H CODE/B0 --- _CpyRam2FshBuff 0080602EH CODE/B0 --- _CreateTask 00805415H CODE/B0 --- _DeletaDegrau 00805377H CODE/B0 --- _DelRamo
Someone has any idea what's happens?
My C Startup code
why is it 'special'?
what happens if you use the regular startup.a51?
This startup code: -choices 1 from 2 firmwares, check it and run it; -turns power supply on or not; -initializes bank switch; -... When all is ok, then jump to ?C_START in order to initialize variables and run main().
I'll test with startup.a51.
I give up. There are so many errors when I put Startup.A51 on project...
You keep adding info a little bit at a time. Special startup, that you did not Post. Banking? Selecting different firmware? How are you compiling that?
Are you starting this from scratch or modifying some other project?
How can using the compiler supplied startup cause errors?
Banking? Yes, 2 banks
Selecting different firmware? How are you compiling that? There is only 1 firmware to compile. The other one came with remote download, loaded on other memory area and startup changes to new version.
Are you starting this from scratch or modifying some other project? From begining years ago.
How can using the compiler supplied startup cause errors? My startup has a lot of functions, it isn't a simple startup like the Keil one. When I change it with Keil startup, I must create fake function, segments, variables and so on.
"My startup has a lot of functions, it isn't a simple startup like the Keil one. When I change it with Keil startup, I must create fake function, segments, variables and so on."
Sounds like a classic "you are doing it wrong".
Going back to your original posting:
"What's a meanning of "E" letter after 020000 on HARDCHA.LST?"
As far as I can remember, the E signifies that it is an external reference that must be satisfied and filled in by the linker.
Have you tried placing the ?C_C51STARTUP module in the common area as opposed to a banked area?