Differential FW update

for GPRS application

  • 1
  • 2
  • Page 2 of 2
Marco
Benutzer
Avatar
Gender: n/a
Location: Italy
Posts: 270
Registered: 10 / 2004
Subject:

Re: Differential FW update

 · 
Posted: 11.03.2012 - 11:28  ·  #9
Hi,
just to have a practical view of the problem, I have attacched the flash images (not HEX files) of an AVRco demo, App2313.

If you open the two TXT files with the WinMerge utility (http://winmerge.org),
you can see the differences which happens when you simply add this procedure
Procedure StartBand2();
and call it in a single point of the main loop.

Marco

ps:
To see the differences between files, is better if you edit-options and in the
Editor-categories you set View-line-differences at Character-level.
Attachments
0EC2D3C2D2C2D1C2D0C2CFC23CC2CDC2CCC2CBC2CAC218EF18BB10EF12BB1CE017BB10EF11BB08951FEFB12E949A1127B4991FEF112309F405C010E010936400
969A03C011E01093640010916400113010E009F41FEF1F9310E081D20F911023112309F406C012E010936200959A969810C013E074D2112309F406C011E01093
6200969A959805C010E010936200969A9598089510E0B12E959A1127B4991FEF112309F404C010E01093640004C011E010936400969A10916100113010E009F4
1FEF112309F409C012E049D2112309F403C0969A949836C011C010916100123010E009F41FEF112309F408C010E037D2112309F403C0949A969824C010916400
103010E009F41FEF1F9310E028D20F911023112309F406C0949A969812E01093610010C012E01BD2112309F406C0969A949811E01093610005C0969A949810E0
1093610008951AB5103010E011F008F01FEF112309F401C012C0C29AC39A12E31ABD1AB513951ABD10E002E0C4D11AB51F3F10E009F41FEF112309F4F2CF0895
11E0EDD1112309F403C01FEFB12E02C010E0B12E1AB5103010E009F41FEF112309F401C00DC01FE71ABDC29813E008EEA2D110E01ABD10E002E39DD1C29AC398
089510916100123010E009F41FEF112309F417C01127B5991FEF112309F402C0B2DF0EC0CDDF10E0BAD11095112309F4FACF11E0B4D11095112309F401C0A3DF
01C0A1DF12E008E5E8E0F0E0B1E094D111E0A5D11F931127042D017009F410950F91102B112309F4F3CF11E098D1112309F429C010E010936200F6DE10916200
113010E009F41FEF112309F407C013E086D1112309F401C017C015C010916200123010E009F41FEF112309F40CC010E076D1112309F407C01127B5991FEF1123
09F401C001C07CDF089510916200123010E009F41FEF112309F40AC01127B5991FEF112309F402C04EDF01C069DF01C04ADF12E008E5E8E0F0E0B1E03DD11091
6200113010E009F41FEF112309F409C013E045D11095112309F402C051DF55C011C010916200123010E009F41FEF112309F408C010E033D11095112309F402C0
3FDF43C011E02BD110951F931127042D017009F410950F91102B112309F4CFCF11E01DD1112309F402C02ADF2EC0109162001093630010E01093610011E004EF
E8E0F0E0B1E0F8D011E009D1112309F404C06ADE15DF19C001C09CDE10916100103010E009F01FEF112309F405C0E8E0F0E00EEFD7D009C01127042D017009F4
1095112309F4E0CFFBDE089544DE11E004EFB1D010E8212A789410E004E6ABD011E0DDD01095112309F415C0CCDE11E004EFE8E0F0E0B1E0BFD011E0D0D01F93
1127042D017009F410950F91102B112309F4F3CFD5DE11E0C2D0112309F402C023DE01C057DE1B2D112309F40BC010916200103010E009F01FEF112309F401C0
Filename: App2313 original.txt
Filesize: 3.81 KB
Title:
Download counter: 42
2CC2F1C2F0C2EFC2EEC2EDC25AC2EBC2EAC2E9C2E8C218EF18BB10EF12BB1CE017BB10EF11BB08951FEFB12E949A1127B4991FEF112309F405C010E010936400
969A03C011E01093640010916400113010E009F41FEF1F9310E09FD20F911023112309F406C012E010936200959A969810C013E092D2112309F406C011E01093
6200969A959805C010E010936200969A9598089510E0B12E959A1127B4991FEF112309F404C010E01093640004C011E010936400969A10916100113010E009F4
1FEF112309F409C012E067D2112309F403C0969A949836C011C010916100123010E009F41FEF112309F408C010E055D2112309F403C0949A969824C010916400
103010E009F41FEF1F9310E046D20F911023112309F406C0949A969812E01093610010C012E039D2112309F406C0969A949811E01093610005C0969A949810E0
1093610008951AB5103010E011F008F01FEF112309F401C012C0C29AC39A12E31ABD1AB513951ABD10E002E0E2D11AB51F3F10E009F41FEF112309F4F2CF0895
11E00BD2112309F403C01FEFB12E02C010E0B12E1AB5103010E009F41FEF112309F401C00DC01FE71ABDC29813E008EEC0D110E01ABD10E002E3BBD1C29AC398
089510916100123010E009F41FEF112309F417C01127B5991FEF112309F402C0B2DF0EC0CDDF10E0D8D11095112309F4FACF11E0D2D11095112309F401C0A3DF
01C0A1DF12E008E5E8E0F0E0B1E0B2D111E0C3D11F931127042D017009F410950F91102B112309F4F3CF11E0B6D1112309F429C010E010936200F6DE10916200
113010E009F41FEF112309F407C013E0A4D1112309F401C017C015C010916200123010E009F41FEF112309F40CC010E094D1112309F407C01127B5991FEF1123
09F401C001C07CDF089510916200123010E009F41FEF112309F40AC01127B5991FEF112309F402C04EDF01C069DF01C04ADF12E008E5E8E0F0E0B1E05BD11091
6200113010E009F41FEF112309F409C013E063D11095112309F402C051DF55C011C010916200123010E009F41FEF112309F408C010E051D11095112309F402C0
3FDF43C011E049D110951F931127042D017009F410950F91102B112309F4CFCF11E03BD1112309F402C02ADF2EC0109162001093630010E01093610011E004EF
E8E0F0E0B1E016D111E027D1112309F404C06ADE15DF19C001C09CDE10916100103010E009F01FEF112309F405C0E8E0F0E00EEFF5D009C01127042D017009F4
1095112309F4E0CFFBDE08951AB5103010E011F008F01FEF112309F401C012C0C29AC39A12E31ABD1AB513951ABD10E002E0BFD01AB51F3F10E009F41FEF1123
09F4F2CF089527DE11E004EFB2D010E8212A789410E004E6ACD011E0DED01095112309F415C0AFDE11E004EFE8E0F0E0B1E0C0D011E0D1D01F931127042D0170
Filename: App2313 modified.txt
Filesize: 3.81 KB
Title:
Download counter: 43
Filename: App2313.zip
Filesize: 4.47 KB
Title:
Download counter: 28
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1408
Registered: 03 / 2005
Subject:

Re: Differential FW update

 · 
Posted: 11.03.2012 - 16:41  ·  #10
Hi Marco.

Quote

c) If I must modify an existent procedure and it becomes bigger, I think it's hard reduce it to situation b) isn't easier to fully place it in the free area on top ?


In principle, yes, but that would presume that AVRCo allows you to put new functions at top of memory and leave gaps for smaller/removed functions, neither of which is true.

Your example is quite illuminating, isn't it? Why are there so many differences for such a small change? It is because of where the procedure is placed. If it were at top of memory, and the original call existed (maybe to a different procedure) there would be very few changes, but because it is not, all of the relative calls to system functions for any function before the added function also change (they now have to jump over the new procedure). If the function is at bottom of memory (first rather than last) it is no better since every page would change! And indeed, the addition af an extra line to call the new funtion has the same effect! it displaces every line after it, meaning every page boundary changes.

Regards

Merlin.
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Differential FW update

 · 
Posted: 11.03.2012 - 17:50  ·  #11
Hello Marco,

there is only one (difficult and dangereous) way to handle this using the {$Phase addr} {$Dephase} switch around of a procedure/function or a block of procedures/functions. This switch places the concerned functions to an absolute address, at best at a flashpage boundary. But this is difficult to handle in order to avoid code overlapping or big code holes.
Furthermore if functions are appended the calling code must also updated. So also the calling block must be updateable in the same way.
Code
{$Phase $6000}
procedure PhaseTest;
begin
  ...
  ...
end;
{$Dephase}

rolf
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1408
Registered: 03 / 2005
Subject:

Re: Differential FW update

 · 
Posted: 12.03.2012 - 09:38  ·  #12
Hi Rolf/Marco

Any solution will of course be difficult/dangerous, but probably stll worth doing for Marco. The {$Phase} method holds promise, I think.
Marco
Benutzer
Avatar
Gender: n/a
Location: Italy
Posts: 270
Registered: 10 / 2004
Subject:

Re: Differential FW update

 · 
Posted: 13.03.2012 - 14:18  ·  #13
Yes,
I think it's something on which I can start some experiments...

Regards,
Marco
  • 1
  • 2
  • Page 2 of 2
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 16 · Cache Hits: 15   96   111 · Page-Gen-Time: 0.023208s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI