"Same" SREC files behave differently. How to compare SREC to flash contents?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

"Same" SREC files behave differently. How to compare SREC to flash contents?

ソリューションへジャンプ
1,927件の閲覧回数
lucianomoretti
Contributor IV

Using a modified version of the S32 bootloader in AN12218 and I've got 2 SREC files that the data is identical except the record alignment. One loads and boots fine, the other ends up causing an exception after attempting to jump into the app.

Srecord Tools (http://srecord.sourceforge.net/) srec_cmp states that they are the "same". The one that fails is generated using S32 Design Studio with the --srec-len 32 option, while the other is the same file but run through the Srecord Tools srec_cat tool with the -Output_Block_Size 32 option.

How do I compare the flash contents to an SREC file to see what is different?

0 件の賞賛
返信
1 解決策
1,896件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

If you use S32 Design Studio, the memory content can be exported to s-record file in the memory tab:

lukaszadrapa_0-1623749135952.png

Regards,

Lukas

 

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,911件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

we got a report about weakness of the s-record parser short time ago:

https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-...

I already sent the report to responsible team and it will be either fixed or maybe they will add a note that it's necessary to convert the file to specific format when each s-record format has fixed length - and this is also the workaround I can recommend.

Regards,

Lukas

0 件の賞賛
返信
1,904件の閲覧回数
lucianomoretti
Contributor IV

Hi Lukas:

I found the post on the 8-byte alignment.

I modified the mem_man_write() function to pad the end of the phrase to 8-byte align it. The small incremental size increase was more than worth it to us as we had trouble getting srec_cat to output an aligned and padded SREC that would work properly. If the firmware wasn't an even 8-byte length the last line would still end up "short" and the download would fail.

 

	uint16_t sizeMod = data_size % 8;
	if(0 != sizeMod){
		/* set remaining bytes of array to 0xFF (default erased value)
		 * extend data_size to match new length.
		 */
		sizeMod = data_size + (8 - sizeMod); /* Generate new size */
		memset((void *) (BP->F.PhraseData + data_size), 0xFF, MAX_DATA_BP - data_size);
		
		data_size = sizeMod;
	}

 

I also added in a "Check after programming" to verify that the data written matched the data we intended to with the FlashProgramCheck() function:

 

flashReturn = FlashProgramCheck(&flashSSDConfig, flash_prog_address, data_size,  BP->F.PhraseData, &failAddress, 0x1U, FlashCommandSequence);

 

I'm seeing the FlashProgramCheck succeed once I added padding (it failed before) but the program still doesn't work properly so I really DO need an answer to the question I actually asked for dumping the flash contents for comparison.

0 件の賞賛
返信
1,897件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

If you use S32 Design Studio, the memory content can be exported to s-record file in the memory tab:

lukaszadrapa_0-1623749135952.png

Regards,

Lukas

 

0 件の賞賛
返信