Reply by Vladimir Vassilevsky August 19, 20112011-08-19

Rob Gaddi wrote:

> On 8/19/2011 10:49 AM, Don Y wrote: >
>> E.g., add to the flash image: >> >> "Copyright 08192011 Vladimir Vassilevsky, Build 12.3.4, v9A03" >> >> (assuming this *context* is unlikely to randomly appear elsewhere >> in your code image :> ) > > > Surprisingly, on the Blackfin, that actually disassembles to code that > erases the entire flash and then sets the chip on fire.
Does the "(c)Rob Gaddi" string put an ARM processor into an idle mode ? Actually, I can remember piece of code that started with a text string "Hello my dear friend". That was a computer game for Sinclair Spectrum. IIRC, that translated to a harmless series of relative jumps on Z80 cpu. VLV
Reply by Don Y August 19, 20112011-08-19
Hi Rob,

On 8/19/2011 11:02 AM, Rob Gaddi wrote:

>> Instead of requiring a "predefined location" (admittedly, easier to >> *find*), could you wrap the information with a unique signature >> such that anything else is unlikely to be (erroneously) recognized >> as having that signature IN THAT REGION OF MEMORY? >> >> E.g., add to the flash image: >> >> "Copyright 08192011 Vladimir Vassilevsky, Build 12.3.4, v9A03" >> >> (assuming this *context* is unlikely to randomly appear elsewhere >> in your code image :> ) > > Surprisingly, on the Blackfin, that actually disassembles to code that > erases the entire flash and then sets the chip on fire.
Ah, my bad. :< Then, instead, store: "30A9v ,4.3.21 dliuB ,yksvelissaV rimidalV 11029180 thgirypoC" which, theoretically, should *program* the entire chip and spray water (halon?) on anyone nearby!!
Reply by Vladimir Vassilevsky August 19, 20112011-08-19

Roberto Waltman wrote:

> Another way, (which I don't like, but it works.) > You can enbedd the version info in the flash image surrounded by > "markers" that will allow you to search and locate it anywhere.
That idea almost works... but the maker string could be occasionally broken into two chunks in the boot sequence. So, the flash stream should be interpreted rather then simply searched. If the flash stream has to be interpreted, then I can put a version structure to a predefined location in the target memory map, and everything is simple. Oh, but I don't like writing an interpretor, that's the only problem :-) Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by Don Y August 19, 20112011-08-19
Hi Roberto,

On 8/19/2011 10:52 AM, Roberto Waltman wrote:
> > Another way, (which I don't like, but it works.) > You can enbedd the version info in the flash image surrounded by > "markers" that will allow you to search and locate it anywhere. > > #pragma pack() > > struct version > { > char before[35]; > int v_major; > int v_minor; > char date[11]; > int checksum; // to reduce the likelihood of false possitives
I figured the string "Vassilevsky" probably stands a greater chance of reducing those sorts of hits! (there are advantages to having "unique" surnames! :> )
> char after[35]; > }; > > struct version this_version = > { > "find version after this ##########", > 0, > 0, /* to be updated after build */ > "--/--/----", > 0, > "######### find version before this" > }; > > Of curse, if the boot image includes any checksums to detect corrupted > files they will need to be updated after modifying the structure > above.
Or, ensure the struct's contents are "checksum neutral" (not possible with all checksum algorithms)
Reply by Don Y August 19, 20112011-08-19
Hi Roberto,

On 8/19/2011 10:54 AM, Roberto Waltman wrote:

>> Instead of requiring a "predefined location" (admittedly, easier to >> *find*), could you wrap the information with a unique signature >> ... > > Are you feeling slightly telepathic? ;)
No, you can use some of the enhanced instructions added to the newer models: OUIJA "Copyright" ;locate "Copyright" in image CHANNEL "Vladimir Vassilevsky" ;(actually only works posthumously)
Reply by Roberto Waltman August 19, 20112011-08-19
Roberto Waltman  wrote:

>Of curse, if ...
Pardon me, Freudian slip... -- Roberto Waltman [ Please reply to the group. Return address is invalid ]
Reply by Rob Gaddi August 19, 20112011-08-19
On 8/19/2011 10:49 AM, Don Y wrote:
> Hi Vladimir, > > On 8/19/2011 8:14 AM, Vladimir Vassilevsky wrote: >> >> There is a system with ADI BlackFin DSP which boots up from SPI flash. >> The flash contains the standard ADI boot stream. >> >> I would like to insert hw/sw version number, build number, release date >> and some other information into the flash. This information should be >> accessible to a program running on Blackfin. Also, the flash programming >> tools should be able to read this information from the flash hex file. >> >> Is there a way to configure the VDSP toolset so this data would be >> inserted automatically from a C source to a predefined location in the >> flash? > > Instead of requiring a "predefined location" (admittedly, easier to > *find*), could you wrap the information with a unique signature > such that anything else is unlikely to be (erroneously) recognized > as having that signature IN THAT REGION OF MEMORY? > > E.g., add to the flash image: > > "Copyright 08192011 Vladimir Vassilevsky, Build 12.3.4, v9A03" > > (assuming this *context* is unlikely to randomly appear elsewhere > in your code image :> )
Surprisingly, on the Blackfin, that actually disassembles to code that erases the entire flash and then sets the chip on fire. -- Rob Gaddi, Highland Technology Email address is currently out of order
Reply by Roberto Waltman August 19, 20112011-08-19
Don Y  wrote:

>Instead of requiring a "predefined location" (admittedly, easier to >*find*), could you wrap the information with a unique signature >...
Are you feeling slightly telepathic? ;) -- Roberto Waltman [ Please reply to the group. Return address is invalid ]
Reply by Roberto Waltman August 19, 20112011-08-19
Another way, (which I don't like, but it works.)
You can enbedd the version info in the flash image surrounded by
"markers" that will allow you to search and locate it anywhere.

#pragma pack()

struct version
{
    char before[35];
    int  v_major;
    int  v_minor;
    char date[11];
    int  checksum;  // to reduce the likelihood of false possitives
    char after[35];
};	

struct version this_version =
{
    "find version after this ##########",
    0,
    0,                    /* to be updated after build */ 
    "--/--/----",
    0,
    "######### find version before this"
};	


Of curse, if the boot image includes any checksums to detect corrupted
files they will need to be updated after modifying the structure
above.
--
Roberto Waltman

[ Please reply to the group.
  Return address is invalid ]
Reply by Don Y August 19, 20112011-08-19
Hi Vladimir,

On 8/19/2011 8:14 AM, Vladimir Vassilevsky wrote:
> > There is a system with ADI BlackFin DSP which boots up from SPI flash. > The flash contains the standard ADI boot stream. > > I would like to insert hw/sw version number, build number, release date > and some other information into the flash. This information should be > accessible to a program running on Blackfin. Also, the flash programming > tools should be able to read this information from the flash hex file. > > Is there a way to configure the VDSP toolset so this data would be > inserted automatically from a C source to a predefined location in the > flash?
Instead of requiring a "predefined location" (admittedly, easier to *find*), could you wrap the information with a unique signature such that anything else is unlikely to be (erroneously) recognized as having that signature IN THAT REGION OF MEMORY? E.g., add to the flash image: "Copyright 08192011 Vladimir Vassilevsky, Build 12.3.4, v9A03" (assuming this *context* is unlikely to randomly appear elsewhere in your code image :> )