Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC18F26K80 and HI-TECH PICC18 V.9.80
#1
Hi,

I am using HI-TECH PICC18 compiler V9.80.
I have customised C30loader for PIC18F26K80 and RS485 bus, and it works great.
Bootloader easily writes hex file, but my aplication does not works.
If I write same hex file with ICD3 and without bootloader, aplication works as it is supposed.
It looks to me like bootloader and aplication code, overlaps.
When I compile my project a I see in hex file, compiler uses locations where boot loader is placed, so boot loader cut off part of my application code to protect himself from overwriting.

Can you help me?
I do not know how to set up to the compiler, to reserve end of memory for boot loader.

If I am right, --CODEOFFSET option reserve locations only on top of memory.
I tried with, --ROM=default,-C000-FFFF option but there is no success.

Here is my application hex file.

Quote::04025600C6EF01F0FE
:10025E00D9CF34F0DACF35F0F29E24EC05F038EC3D
:10026E0005F0F2A401D001D085D0F294090ED62665
:10027E0010500F10D8B401D001D003D00F06D8A063
:10028E0010061D28D8B41E28D8B401D001D002D033
:10029E001D4A1E2A1F28D8B42028D8B401D001D058
:1002AE0002D01F4A202A0B28D8B40C28D8B401D06B
:1002BE0001D002D00B4A0C2A0D28D8B40E28D8B47F
:1002CE0001D001D002D00D4A0E2A050E1F5C000E81
:1002DE002058D8A001D001D002D000014D82165076
:1002EE001510D8B401D001D00FD01506D8A016061F
:1002FE0016501510D8A401D001D006D0C00E11167C
:10030E00000E12162350111211C030F012C031F02F
:10031E006EEC05F003EC04F02FC005F030C006F0D3
:10032E0006500510D8B401D001D00ED00A500618D0
:10033E0002E109500518D8B401D001D005D0000152
:10034E004D84076A086A12D006500510D8B401D041
:10035E0001D00AD00728D8B40828D8B401D001D0CB
:10036E0005D0074A082A02D0076A086A05C009F0B4
:10037E0006C00AF035C0DAFF34C0D9FF1100A0EF75
:10038E0003F08051020A7AE181C149F0020EACEC11
:10039E0004F036C042F037C043F0040EACEC04F06B
:1003AE0036C044F037C045F04950030A03E04950C7
:1003BE00040A48E1226A020E0001606F222A2150CF
:1003CE00080A38E1435042102BE14404451028E15D
:1003DE002250600FD96EDA6A49C0DFFF222A2250FE
:1003EE00600FD96EDA6A020EDF6E222A4650030AB9
:1003FE0005E111C047F012C048F004D005C047F027
:10040E0006C048F02250600FD96EDA6A4850DF6E8F
:10041E00222A2250600FD96EDA6A47C0DFFF0DD054
:10042E004250640A431003E144044510D1E028D839
:10043E00020E02D025D8030EDF6E222A225053EC74
:10044E0004F01CD0466601D019D0226A020E0001BB
:10045E00606F222A2250600FD96EDA6A0101815133
:10046E008009DF6E222A22500001600FD96EDA6AEF
:10047E00010EDF6E222A225053EC04F0216A120084
:10048E002250600FD96EDA6A49508009DF6E222A37
:10049E002250600FD96EDA6A120000014DA232D0DE
:1004AE0000014DA02FD04D9000014D92030E2164FE
:1004BE0027D001017E0E2124D96EDA6A010EDA22CE
:1004CE00DF504B6E4C6A4B504C6E4B6A4B6A7F0E34
:1004DE002124D96EDA6A010EDA22DF504B12010E98
:1004EE00376E800E366E2150FE0F386E6BEC03F0B9
:1004FE004C50371802E14B50361802E1C8EF01F0AC
:10050E00216A1200B2EC05F00009D8B412004D8039
:10051E0000014D92800E216017D010D0000E376A68
:10052E00366AD2EC03F04A6E0101800E2124D96E98
:10053E00DA6A010EDA224AC0DFFF212AB2EC05F098
:10054E000009D8B41200EAD7216A00014D901200BA
:10055E00E8CF38F0080EA76E386604D0D00E376E8E
:10056E00540E28D0380404E1340E376E140E22D007
:10057E003850020A04E11A0E376E0A0E1BD038509C
:10058E00030A04E1060E376E820E14D03850040AA8
:10059E0004E1030E376E400E0DD03850050A04E10B
:1005AE00010E376E160E06D03850060AEBE1000E1D
:1005BE00376E8A0E366E36C0AFFF37507D6E240E04
:1005CE00AC6E900EAB6E948E949C9F989D989F9A55
:1005DE009D8A900CE8CF38F0080EB96E240EBA6ED4
:1005EE00900EA66E386604D0D00E376E540E28D0FC
:1005FE00380404E1340E376E140E22D03850020A3D
:10060E0004E11A0E376E0A0E1BD03850030A04E1AD
:10061E00060E376E820E14D03850040A04E1030E13
:10062E00376E400E0DD03850050A04E1010E376EBC
:10063E00160E06D03850060AEBE1000E376E8A0E03
:10064E00366E36C07BFF37507C6E938E939CA5988A
:10065E00A3989F9AA38A1200F29E700ED36E5DEC41
:10066E0005F0F8EC04F0B5EC05F0A7EC05F0ADECF8
:10067E0005F0030EAFEC02F0030EF1EC02F094EC79
:10068E0005F0BB6A0F01506B4D6B4A6B476B8A8A44
:10069E008A888B968B94F28EF28C376A640E366E45
:1006AE008BEC05F0B8EC05F0B2EC05F0000902E1B8
:1006BE0000014DB254EC02F0E90E0B5C030E0C5827
:1006CE00F3E3116A126AF0D73D683E6824D036C053
:1006DE00D9FF37C0DAFFDF503D183B6E3C6A364A11
:1006EE00372AEE0E3B24F66EF76AFD0EF722F86AF5
:1006FE00000EF8220800F5503E183D6EEE0E3B241B
:10070E00F66EF76AFE0EF722F86A000EF82208005F
:10071E00F5CF3EF038063866DAD73DC039F03A6A82
:10072E0039503A6E396A39503E10366E3A50376E3D
:10073E00120005EE00F0810EEE6AE806FDE104EE11
:10074E0000F0810EEE6AE806FDE103EE00F0810E88
:10075E00EE6AE806FDE102EE00F0810EEE6AE806B2
:10076E00FDE101EE00F011EE00F0EE6AE550E15011
:10077E00FCE1E250FAE100EE60F0800EEE6AE8066F
:10078E00FDE14D6A00EE01F02D0EEE6AE806FDE188
:10079E00000133EF03F0375036100FE02A502B5C78
:1007AE000CE336C00FF037C010F001D000F010503F
:1007BE000F1003E02A502B60F9D7F2AE04D0010ED1
:1007CE00396EF29E01D0396A2A502B600BD003018C
:1007DE00000E2B24D96EDA6A030EDA22DF50386E41
:1007EE002B2A05D02B6A2A6A386AA38AA688395022
:1007FE00D8A4F28E385012009BEC05F08A9800F0C7
:10080E0000F08A8800F000F08A9800F000F07DEC8D
:10081E0005F0336E8A8833C031F0326A3150326E51
:10082E00316A8A9A00F000F08A8A00F000F08A9A03
:10083E0000F000F07DEC05F0336E8A8A316A335099
:10084E003112311E321E31C02FF032C030F0FF0C8B
:10085E00E8CF36F07F0E2C6402D02C66FED7A4A80B
:10086E000AD02C502D5C07E38B88A39AA698A388F8
:10087E0036C079FF1200F2AE04D0F29E02D8F28E8C
:10088E0012000201000E2C24D96EDA6A020EDA2250
:10089E0036C0DFFF2C2A1200E8CF41F0000E376E73
:1008AE00600E366E41C038F06BEC03F036C03FF090
:1008BE0037C040F04150600FD96EDA6A4050DF6E9B
:1008CE00412A4150600FD96EDA6A3FC0DFFF412ADC
:1008DE0041C037F0600E4CEF05F01F6A206A2A50B7
:1008EE002B5C02E32A6A2B6AA6507ACF2EF0800E7A
:1008FE002A600AD00301000E2A24D96EDA6A030E8A
:10090E00DA222EC0DFFF2A2AA650A69800F0A6886B
:10091E0012001D6A1E6A2650275C02E3266A276AA9
:10092E00AB50AECF2EF0800E26600AD00401000E22
:10093E002624D96EDA6A040EDA222EC0DFFF262AAA
:10094E00AB50AB9800F0AB881200E8CF3AF0800EB7
:10095E003A24D96EDA6A010EDA22DF50386E396A1D
:10096E003850396E386A386A810E3A24D96EDA6A8E
:10097E00010EDA22DF50381238C036F039C037F0A7
:10098E001200285029600CD08B8A0501000E2924F4
:10099E00D96EDA6A050EDA22DF50AD6E292A120000
:1009AE002850295CD8A01200286A296AAC509D985C
:1009BE0012002C502D600CD08B880201000E2D24BD
:1009CE00D96EDA6A020EDA22DF50796E2D2A120003
:1009DE002C502D5CD8A012002C6A2D6ABA50A39808
:1009EE001200F26AF06A9D6AA06A9F6AA26A9E6A03
:1009FE00A16AD09EF194F294F28A9F909E909D905F
:100A0E009F929E929D92A292A192A0921200E8CFE6
:100A1E002EF0A1EC05F0F00E89162EC02FF00F0E61
:100A2E002F162F508912F00E8A162E380F0B2F6E9E
:100A3E000F0E2F162F508A1212009DBA9EAA02D0A8
:100A4E0090EC04F09DB89EA802D0C8EF04F08BBACB
:100A5E00ACA212009DA89EA812008B9A9D8AAB880C
:100A6E001200A3BAA4AA02D074EC04F0A3B8A4A8EE
:100A7E0002D0E0EF04F08BB8BAA21200A3A8A4A88B
:100A8E0012008B98A38AA6881200E8CF38F0396A34
:100A9E0008D038503924D96EDA6ADF502FEC04F0C2
:100AAE00392A3750395CD8B01200F3D70F015D6B7D
:100ABE005C6B806A816A826A896AD00E926E8A6ADB
:100ACE00800E936E8B6A800E946EF18E800C305079
:100ADE000EEC05F08B8600F000F08B9631500EEC8C
:100AEE0005F08B8400F000F08B9412009BEC05F067
:100AFE0081500F0B2E6E2E3AF00E2E162E168050A3
:100B0E000F0B2E122E50120036C00FF037C010F001
:100B1E0010500F10D8B41200FBD7216A4D9200016D
:100B2E004D901F6A206A12000F0E9212931200F05F
:100B3E0000F00F0CF00E9216931600F000F0F00C71
:100B4E00CE6ACF6AAA6A880ECD6E880C640ECB6E02
:100B5E00020ECA6E020C2B502A5C1200C50ED56E08
:040B6E00C50C1200A0
:10FDEE0000C1814001C0804101C0804100C18140FD
:10FDFE0001C0804100C1814000C1814001C08041ED
:10FE0E0001C0804100C1814000C1814001C08041DC
:10FE1E0000C1814001C0804101C0804100C18140CC
:10FE2E0001C0804100C1814000C1814001C08041BC
:10FE3E0000C1814001C0804101C0804100C18140AC
:10FE4E0000C1814001C0804101C0804100C181409C
:10FE5E0001C0804100C1814000C1814001C080418C
:10FE6E0001C0804100C1814000C1814001C080417C
:10FE7E0000C1814001C0804101C0804100C181406C
:10FE8E0000C1814001C0804101C0804100C181405C
:10FE9E0001C0804100C1814000C1814001C080414C
:10FEAE0000C1814001C0804101C0804100C181403C
:10FEBE0001C0804100C1814000C1814001C080412C
:10FECE0001C0804100C1814000C1814001C080411C
:10FEDE0000C1814001C0804101C0804100C181400C
:10FEEE0000C0C101C30302C2C60607C705C5C404CC
:10FEFE00CC0C0DCD0FCFCE0E0ACACB0BC90908C83C
:10FF0E00D81819D91BDBDA1A1EDEDF1FDD1D1CDC2B
:10FF1E0014D4D515D71716D6D21213D311D1D0109B
:10FF2E00F03031F133F3F23236F6F737F53534F48B
:10FF3E003CFCFD3DFF3F3EFEFA3A3BFB39F9F838FB
:10FF4E0028E8E929EB2B2AEAEE2E2FEF2DEDEC2CEB
:10FF5E00E42425E527E7E62622E2E323E12120E05B
:10FF6E00A06061A163A3A26266A6A767A56564A44B
:10FF7E006CACAD6DAF6F6EAEAA6A6BAB69A9A868BB
:10FF8E0078B8B979BB7B7ABABE7E7FBF7DBDBC7CAB
:10FF9E00B47475B577B7B67672B2B373B17170B01B
:10FFAE00509091519353529296565797559594540B
:10FFBE009C5C5D9D5F9F9E5E5A9A9B5B995958987B
:10FFCE00884849894B8B8A4A4E8E8F4F8D4D4C8C6B
:10FFDE0044848545874746868242438341818040DB
:10FFEE0032372F30342F3230313300313030610020
:02FFFE00000001
:020000040020DA
:080000000004010301000000EF
:020000040030CA
:0400000009134B7C19
:020005008991DF
:040008000FC00FE036
:0200000400F00A
:100000000000000A0032000000060006000600069C
:1000100000060006000000000005000AFF9C001416
:10002000020300030A0103000000000000000000BA
:1000300000000000000000000000000000000000C0
:1000400000000000000000000000000000000000B0
:1000500000000000000000000000000000000000A0
:100060000000000000000000000000000000000090
:100070000000000000000000000000000000000080
:100080000000000000000000000000000000000070
:100090000000000000000000000000000000000060
:1000A0000000000000000000000000000000000050
:1000B0000000000000000000000000000000000040
:1000C0000000000A003200000006000600060006DC
:1000D00000060006000000000005000AFF9C001456
:1000E000020300030A0103000000000000000000FA
:1000F0000000000000000000000000000000000000
:1001000000000000000000000000000000000000EF
:1001100000000000000000000000000000000000DF
:1001200000000000000000000000000000000000CF
:1001300000000000000000000000000000000000BF
:1001400000000000000000000000000000000000AF
:10015000000000000000000000000000000000009F
:10016000000000000000000000000000000000008F
:10017000000000000000000000000000000000007F
:00000001FF

Thanks in advance.
Reply
#2
I didn't find solution for my problem till now.
I appreciate any kind of advice. My firmware is almost done and now I need bootloader, for my mcu so I have possibility to easily upgrade my firmware.

Thanks and regards.
Reply
#3
You should leave codeoffset empy. You may reserve the boot loader space with the ROM options if needed. Please attached the zipped application hex file, don't paste it.

Do you use the application config bits also in the boot loader?
Reply
#4
(2013-08-06, 22:26:34)Mikael Gustavsson Wrote: You should leave codeoffset empy. You may reserve the boot loader space with the ROM options if needed. Please attached the zipped application hex file, don't paste it.

Do you use the application config bits also in the boot loader?

Hi,

Yes, codeoffset is empty. Yes I know I can reserve space with ROM option but it won't works for me. In mid time I found that something is wrong with my IDE environment or compiler since I get this message during build phase.

Quote:Executing: --ROM=default,-C000-FFFF
Could not spawn language tool. Check command-line options. (2)

I am not sure what is happening.

I have tried to set config bits to be same in my application and in bootloader. I got same result again. Application do not works if it is programmed by bootloader. I see in compilers ROM usage map that last block of ROM is not free. I must to reserve last block of ROM but I can't.
Any idea how to solve this problem?

Sorry I have paste hex. If needed, I can attach hex file.

Regards and thanks.
Reply
#5
Have you tried the following in MPLAB before building:
Project>Built Options>Project>Linker Tab> Format hex file for download
Reply
#6
Huh, problem solved.

I made mistake trying to put command line option under "Custom Build" tab instead "Global" tab.
So,
Project>Built Options>Project>Global Tab>Additional command-line options (link-time only)
In my case, --ROM=default,-C000-FFFF
and it works great now.

Thanks for your time and special thanks to Nebojsa, who helped me to solve this problem.

Btw. Great bootloader tool. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)