HI All
Attached are SREC and binary files for the TWR-K70F120 kit. The binary was generated from the SREC and programming works correctly. The SREC however fails to load.
The problem looks to be with the the loader having problems with a block of code that it can't program (possibly since the SREC block is an uneven length (?)).
Below is console output showing the SREC loading fail, followed by the binary loading being succesful. It shows that two SREC area were successfully programmed but the third (last 23 bytes at 0x32A4) fail.
The problem was verified at two CW10.5 installations but it looks like something that should be easily "fixable", if not already improved in CW10.6 (?). For the moment REC loading is being avoided since binary loading is fine.
Regards
Mark
fl::target -lc "LC for Simple Flash"
fl::target -b 0x1fff0000 0x20000
fl::target -v off -l off
cmdwin::fl::device -d "FTFE_PFlash1M0" -o "128Kx64x1" -a 0x0 0xfffff
cmdwin::fl::image -f "C:\\MJBC\\Internal\\temp_to_delete\\uTaskerSerialBoot.srec" -t "Auto Detect" -re on -r 0x0 0xfffff -oe off
cmdwin::fl::erase image
Beginning Operation ...
-------------------------
Auto-detection is successful.
File is of type Motorola S-Record Format.
Performing target initialization ...
Downloading Flash Device Driver ...
Reading flash ID ...
Erasing Sector 0x00000000 to 0x00000FFF
Erasing Sector 0x00001000 to 0x00001FFF
Erasing Sector 0x00002000 to 0x00002FFF
Erasing Sector 0x00003000 to 0x00003FFF
Erasing ...
Erase Command Succeeded
cmdwin::fl::write
Beginning Operation ...
-------------------------
Using restricted address range 0x00000000 to 0x000FFFFF
Programming file C:\MJBC\Internal\temp_to_delete\uTaskerSerialBoot.srec
Auto-detection is successful.
File is of type Motorola S-Record Format.
Downloading Flash Device Driver ...
Reading flash ID ...
Auto-detection is successful.
File is of type Motorola S-Record Format.
Downloading 0x00000008 bytes to be programmed at 0x00000000
Executing program ....
Program Command Succeeded
Downloading 0x00002EA2 bytes to be programmed at 0x00000400
Executing program ....
Program Command Succeeded
Downloading 0x00000023 bytes to be programmed at 0x000032A4
Executing program ....
Error: Program failed. Flash driver reports the following error(s): Chip reported error during program. Please check that the sector you are programming is erased.
Error: Program failed. Flash driver reports the following error(s): Chip reported error during program. Please check that the sec
tor you are programming is erased.
fl::target -lc "LC for Simple Flash"
fl::target -b 0x1fff0000 0x20000
fl::target -v off -l off
cmdwin::fl::device -d "FTFE_PFlash1M0" -o "128Kx64x1" -a 0x0 0xfffff
cmdwin::fl::image -f "C:\\MJBC\\Internal\\temp_to_delete\\uTaskerSerialBoot.bin" -t "Auto Detect" -re on -r 0x0 0xfffff -oe off
cmdwin::fl::erase image
Beginning Operation ...
-------------------------
Auto-detection is successful.
File is of type Binary/Raw Format.
Performing target initialization ...
Downloading Flash Device Driver ...
Reading flash ID ...
Erasing Sector 0x00000000 to 0x00000FFF
Erasing Sector 0x00001000 to 0x00001FFF
Erasing Sector 0x00002000 to 0x00002FFF
Erasing Sector 0x00003000 to 0x00003FFF
Erasing ...
Erase Command Succeeded
cmdwin::fl::write
-------------------------
Using restricted address range 0x00000000 to 0x000FFFFF
Programming file C:\MJBC\Internal\temp_to_delete\uTaskerSerialBoot.bin
Auto-detection is successful.
File is of type Binary/Raw Format.
Downloading Flash Device Driver ...
Reading flash ID ...
Auto-detection is successful.
File is of type Binary/Raw Format.
Downloading 0x000032C7 bytes to be programmed at 0x00000000
Executing program ....
Program Command Succeeded
Original Attachment has been moved to: test_sw_TRW-K70F120.zip
Hello Mark:
Was this SREC generated by CodeWarrior?
I recreated the problem and it seems to be caused by a "gap" in the srec information. At the end of the file there are two lines:
S109329C00030000000025
S11332A401008021017001780906FCD57047FF37BD
The first line includes data from address 0x329C to 0x32A1 while second line starts at 0x32A4, so there is no data for 0x32A2 and 0x32A3. This causes a programming "jump" and Program Phrase command is executed twice for the same phrase, which is not valid.
Binary file does not have gaps, and such problem is not present.
To confirm this, I modified the s-record file, and this time it programmed successfully. The file I used is attached.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Jorge
Yes, the code was generated with CW10.5. You have identified the same effect.
It looks in fact be a problem with the SREC loader that doesn't handle such gaps in the SREC data - to correct the problem at the source the Flash programming utility used in CW needs to be modified/improved to fill in the missing data (eg. with 0xff) when gaps are detected so that it doesn't result in phrase porogramming errors.
Regards
Mark