UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor dusanpon
Visitor
4,280 Views
Registered: ‎07-06-2017

Enter product serial number

Hi,

How to update the software for KCPSM6, which is already imbedded into .mcs file, with a serial number?

I have prepared a program for KCPSM that sends a short message about the unit (basically this is a serial number compodes of six characters) to the user using serial interface on request. Now, this message depends on the hardware built onto the board with the Spartan6, and should differ among units. The message itself is hard-coded and will not be modified in the field. I could adjust the program, recompile the complete project, and download it, but this will take several minutes for every board. Is there a way, functionally equivalent to the "JTAGLoader" shortcut, acting on the .mcs (.bit) file? I would simply use this way to modify the .mcs file and then download the modified version without recompiling the complete project.

I am using Spartan6, ISE webpack, in-house designed board and hardware. Thanks!

Dusan

0 Kudos
6 Replies
Scholar pratham
Scholar
4,269 Views
Registered: ‎06-05-2013

Re: Enter product serial number

@dusanponNo way, You should rebuild the design.

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Visitor dusanpon
Visitor
4,252 Views
Registered: ‎07-06-2017

Re: Enter product serial number

Too bad for me.

I know the address of bytes in question in the assembled file .hex, and I know the BRAM where the software for my microprocessor is located within the FPGA. So, in theory, I could hex-edit the .mcs file if only I knew where this BRAM is described and where in this BRAM my bytes reside. However, I can not find these bytes in .mcs file using a regular search function in hex-editor. Is this file in any way compressed? I understand that the machine code is of different width (18 bits?) than normal, and that hex editor probably does not show the code correctly. Where can I find a description of the .mcs file? A .pdf maybe, or a technical note? Then I could prepare a software to replace the bytes in question by myself.

Thanks!

Dusan

0 Kudos
Scholar pratham
Scholar
4,231 Views
Registered: ‎06-05-2013

Re: Enter product serial number

@dusanpon It is not practically impossible to do what you are looking for but needs a lot of work to be done. Your approach is a correct way to edit the mcs at the exact address. I hope you could make that work. I certainly have done this in the past but I exactly knew what things to change and an address.

 

Regarding MCS format, please check this thread and Ken's reply.

https://forums.xilinx.com/t5/Welcome-Join/Required-mcs-data-format-information-for-FPGA-configuration/td-p/228293

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Visitor dusanpon
Visitor
4,224 Views
Registered: ‎07-06-2017

Re: Enter product serial number

Thanks! Just an answer I was hoping for, now I can present it to my boss.

Joke aside, I have seen mr. Chapman's explanation of .mcs format and I find it very useful. However, the question is the address of the BRAM blocks as they are described in .mcs file and the formatting of the content within the .mcs file; more accuratelly: I use Spartan6, xc6slx9-2tqg144, the BRAM in question is the RAMB16 at X0Y8 or alternatively BRAMSITE2 X3Y16, the bytes in question start at address 0x25E in HEX file.

- What is the address in .mcs file for the content of this BRAM?

- How are 18-bit instructions for the microprocessor aligned within the 8-bit bytes of the .mcs file?

Please help me find this information. Thanks!

Dusan

 

0 Kudos
Visitor dusanpon
Visitor
4,169 Views
Registered: ‎07-06-2017

Re: Enter product serial number

Hi,

Ok, I am getting it going, kind of. I have prepared two .psm files that differ in just one byte (a part of the serial number), compiled the files and built the corresponding .mcs files. By using a file-compare option in notepad++ I was able to find the place of difference and to identify the individual commands from the .psm file. I can now change the serial number by editing the .mcs file. I also need to edit/correct the checksum at the lines edited (the calculation of the checksum is described in Ken's files).

 

However, there are still two differences in .mcs file that I cannot connect to anything. I presume these are the chechsums (?) of the entire .mcs file, but can not find any explanation about it. The difference is in three bytes at two places at the end of .mcs file (within last ten lines, the HEX file specifies addresses 3200 and 3250, record type 00). I understand that the programmer will reject the incomplete file (checksums difference), so I need some additional information on these two lines. Please help me with this. Thanks!

Dusan

0 Kudos
Visitor dusanpon
Visitor
4,143 Views
Registered: ‎07-06-2017

Re: Enter product serial number

Hi,

Following my last post I tried to ignore the difference at the last two occasions within .mcs file, and modified only the part I understand. To be on the safe side I prepared two .mcs files with slightly different serial number as described in my previous post, and then swapped the modified lines between the two files. As said, I left the two other lines where files differ untouched.

As expected the programmer complained and refused to finish the programming. The message was:

 

INFO:iMPACT:2219 - Status register values:
INFO:iMPACT - 0011 1100 1110 1100
INFO:iMPACT:2492 - '1': Completed downloading core to device.
'1': IDCODE is '20ba16' (in hex).
'1': ID Check passed.
 '1': IDCODE is '20ba16' (in hex).
'1': ID Check passed.
 '1': Erasing Device.
'1': Using Sector Erase.
'1': Programming Flash.
write count != nBytes(0), rc = C0000011.
write cmd failed C0000011.
write cmdbuffer failed 20000015.
write cmdbuffer failed 20000015.
repeated message...and then the programmer freezes.

 

Please help me find a way to modify/update the .mcs file with a new serial number. This, at least, should be a standard procedure in industry where a large number of products get programmed, and the serial number is embedded in the firmware. Why is it so difficult to do it here? What are the remaining two differences found in the .mcs files?

 

Regards

Dusan

 

0 Kudos