From: SourceForge.net <no...@so...> - 2005-08-25 16:47:23
|
Feature Requests item #853893, was opened at 2003-12-04 09:12 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=853893&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Submitted By: Maarten Brock (maartenbrock) >Assigned to: Maarten Brock (maartenbrock) Summary: CRC output from linker Initial Comment: Hello, I would like to see the option added to the linker to be able to have it compute a CRC on the produced code and insert that into the output code as well. This way a program can sanity check itself before startup. This way one could also decide (based on an educated guess) not to download code to a target, because it wasn't changed, which saves development time. To implement this, I think the following are required: 1) Generate a symbol for the CRC 2) Select an area to compute the CRC over 3) Fill unused bytes in the area with a default value (FF) 4) Compute the CRC (8/16/32) 5) Store the CRC outside this area. Keep up the good work, hope this helps improving SDCC further and further. Maarten ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2005-08-25 18:47 Message: Logged In: YES user_id=888171 SRecord supports omf files, but only the memory contents and it throws away all debug info. Still no good solution then :- ( But wait. With SRecord 1.22 you can generate C source files with the data in a "const unsigned char crc[]" array. And SDCC 2.5.2 can place const data in a specified segment with an absolute address. So this is what I do now: 1) Compile and link all project files with SDCC. 2) Let srecord fill unused spaces in the hex-file. 3) Let srecord compute the length of the hex-file and store it inside the hex-file. 4) Let srecord compute the crc over the hex-file and store it inside the hex-file. 5) Let srecord extract the length and crc into a C source file. 6) Compile this with SDCC --constseg CRC. 7) Link the project again with the new file added and option - Wl-bCRC=0x4000 to store the crc and length data at a predetermined memory place. The result is that the CRC is included in the omf file as well and still fully debuggable. This works for me and closes this request. ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2004-01-12 20:45 Message: Logged In: YES user_id=888171 Follow up, So I asked at SRecord and they implemented! Sometimes, life is just great. I'll try to create a piece of library code that can be integrated into SDCC and used in conjuction with SRecord. Greetings, Maarten ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2003-12-04 14:23 Message: Logged In: YES user_id=888171 Hi Frieder, I know there is something like srecord. But a quick glance learned me it doesn't support omf files, that's why I popped the question. Otherwise using srecord would be perfectly ok, allthough integrating into sdcc is nicer. But maybe I should just request this feature for srecord and not for sdcc. Greets, Maarten ---------------------------------------------------------------------- Comment By: Frieder Ferlemann (frief) Date: 2003-12-04 10:07 Message: Logged In: YES user_id=589052 Hi Maarten, just to make things complicated: I'm using the following command line to fill the unused bytes with 0x12 (0x12 is good for a 8051) and to insert several additive checksums: srec_cat myfile.ihx -Intel -fill 0x12 0x0000 0x006FFE -Big_Endian_Checksum_Negative 0x006FFE 0x02 0x02 -fill 0x12 0x007000 0x007FFE -Big_Endian_Checksum_Negative 0x007FFE 0x02 0x02 -fill 0x12 0x008000 0x00EFFE -Big_Endian_Checksum_Negative 0x00EFFE 0x02 0x02 -Output myfile.hex -Intel The link to srecord is in the manual (srecord supports CRC16 and CRC32 in little and big-endian) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=853893&group_id=599 |