How to generate blob image by command line mode in S32DS3.4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to generate blob image by command line mode in S32DS3.4

Jump to solution
2,436 Views
strong
Contributor I

Hello, 

  I want to generate blob image by command line mode for S32R41 in S32DS3.4. According to "HOWTO: Use IVT Tool To Create A Blob Image" and S32DS Help document - "Command Line Execution - IVT Tool", I use following command to generate IVT image: 

C:\NXP\S32DS.3.4\eclipse\eclipsec.exe -noSplash \
    --launcher.ini C:\NXP\S32DS.3.4\eclipse\s32ds.ini \
    -application com.nxp.swtools.framework.application \
    -HeadlessTool IVT \
    -MCU S32R41 \
    -SDKVersion PlatformSDK_S32R41_2022_02_CD04 \
    -Load "%cd%\System_M7_0\System_M7_0.mex" \
    -ExportAB "%cd%\System_M7_0\customer\app_boot.bin" \
    -start_pointer_addr 0x34150000 \
    -entry_pointer_addr 0x34281000 \
    -raw_binary "%cd%\System_M7_0\customer\System_M7_0.bin"

  It generates an image file called "app_boot.bin" with start address and entry address. Also, I use S32DS ide to generate another image file called "r41.bin" with start address and entry address. Then I compare these two files, as below:(left part is app_boot.bin, right part is r41.bin)

ivt.png

  Although first line is the same, it adds 00 to app_boot.bin generated by command line, and it adds FF to r41.bin generated by ide. Is there anything I missed in command line mode?

  Then, I use following command to generate blob image and c format file:

C:\NXP\S32DS.3.4\eclipse\eclipsec.exe -noSplash \
    --launcher.ini C:\NXP\S32DS.3.4\eclipse\s32ds.ini \
    -application com.nxp.swtools.framework.application \
    -HeadlessTool IVT \
    -MCU S32R41 \
    -SDKVersion PlatformSDK_S32R41_2022_02_CD04 \
    -ImportBin "%cd%\System_M7_0\customer\app_boot.bin" \
    -ExportC "%cd%\System_M7_0\customer\app_boot_c.c" \
    -ExportBlob "%cd%\System_M7_0\customer\app_boot_blob.bin"

It shows some error messages in procedure:

資訊: [TOOL] Importing IVT Image D:\Cubtek Tool\SourceCode\PF_R41_unit\System_M7_0\customer\app_boot.bin ...
三月 10, 2023 1:28:21 下午 com.nxp.swtools.ivt.model.IVTImage importIVTImage
嚴重: ?? - ?入 IVT ?像: 文件包含?效?文件值。
image header tag的期望值: 0xD1
??值: 0xD5
三月 10, 2023 1:28:21 下午 com.nxp.swtools.ivt.IVTCmdApplication logResult
嚴重: [TOOL] Import failed

It generates two files, blob image "app_boot_blob.bin" and c format "app_boot_c.c", but both files size are quite small, I think it may be caused by import image failed, so these files are only include ivt_config. The error message is "image header tag expect: 0xD1, get: 0xD5", I check app_boot.bin and r41.bin file, they are all start with D5 00. For confirm this situation, I use S32DS ide to import app_boot.bin, it shows the same error message.

importivt.png

 How can I import the ivt image to generate blob image? Thanks.

0 Kudos
1 Solution
2,221 Views
mikedoidge
NXP Employee
NXP Employee

Hello @strong,

You have identified a bug in our command line support. I have shared this with our development team and they have entered an internal ticket to address this in a future release.

The issue identified is regarding support for saving the mex file with the new application bootloader image path as part of the first command. I was able to reproduce the issue by using your first command and noticed the following message in the output:

WARNING: Program arguments were not processed: "[-ExportMEX?, C:\Users\Public"workspaceS32DS.3.4\R41_Blob_test\R41_Blob_test_M7_0\Debug_RAM]"

I do have some good news, there is a solution, though it is not ideal. Here are the steps to successfully produce a Blob image from a raw binary image:

  1. Using “-ExportAB” command, export the complete application image based on raw binary code, start pointer address, and end pointer address
  2. Manually edit the mex file you want to use for exporting the blob image and change the path for the application bootloader pointer to the path of the previous exported image (or you can use the UI to import the image for the application bootloader pointer and save the current configuration to the mex file that to be sure you don’t have any overlapping errors).
  3. Load the new mex file and using “-ExportBlob” command, export the blob image

I would suggest that you use the UI to update the mex file for now, until we release a new version which fully supports the workflow you are trying to achieve.

Best Regards,

Mike

View solution in original post

0 Kudos
8 Replies
2,397 Views
mikedoidge
NXP Employee
NXP Employee

Hello @strong,

There is a simple explanation for this issue. It is an easy mistake to make, but you have selected the app_boot.bin file to use with the '-ImportBin' command. The '-ImportBin' is intended to be used with the IVT Binary image, not the Application Bootloader Image. To resolve the issue, I suggest that after you generate the Application Bootloader Image, generate the IVT Image and then use this generated IVT Image in the command to export the Blob image.

Best Regards,

Mike

0 Kudos
2,390 Views
strong
Contributor I

Hello mikedoidge,

Thanks for your reply. It is my mistake to use wrong image file in importing file. Now I change command to:

C:\NXP\S32DS.3.4\eclipse\eclipsec.exe -noSplash \
    --launcher.ini C:\NXP\S32DS.3.4\eclipse\s32ds.ini \
    -application com.nxp.swtools.framework.application \
    -HeadlessTool IVT \
    -MCU S32R41 \
    -SDKVersion PlatformSDK_S32R41_2022_02_CD04 \
    -Load "%cd%\System_M7_0\System_M7_0.mex" \
    -ExportAB "%cd%\System_M7_0\customer\app_boot.bin" \
    -start_pointer_addr 0x34150000 \
    -entry_pointer_addr 0x34281000 \
    -raw_binary "%cd%\System_M7_0\customer\System_M7_0.bin" \
    -AutoAlign 0x100 \
    -ExportBin "%cd%\System_M7_0\customer\app_boot_ivt.bin" \
    -ImportBin "%cd%\System_M7_0\customer\app_boot_ivt.bin" \
    -AutoAlign 0x0 \
    -ExportBlob "%cd%\System_M7_0\customer\app_boot_blob.bin"

I think it will generate an application bootloader image file "app_boot.bin" with specified address, and an IVT image file "app_boot_ivt.bin", and then import IVT image to generate a blob image file "app_boot_blob.bin" in finally. Please correct me if I am wrong.

After I execute this command, I only get two files and the size of app_boot_ivt.bin is quite small. Attached log.txt is cmd log in this build. What could I do to resolve this situation?

importivt2.png

Best regards & thanks,

strong

0 Kudos
2,362 Views
mikedoidge
NXP Employee
NXP Employee

Hello @strong,

Your IVT image file is likely correct. The IVT image file only contains the IVT data, that is, the header information of pointers to each of the IVT component images, but not the application bootloader data or any of the other IVT component images. If all this was included, then we would call it Blob file.

In your command, I'm not sure why you perform the IVT image import. This is not needed. The information needed to generate the Blob file is contained within the .mex file. When you use the option to import the IVT image, all the data provided by the .mex file is cleared and only the data coming from the IVT image is loaded. So then you no longer have the application boot image (or any other IVT component image files, if any exist). There is likely some error message reported (listed after 'SEVERE') indicating that the Blob generation option was skipped.

My suggestion is to use the 'ExportAll' option to generate all of the binaries as shown in the user guide.

mikedoidge_0-1678829248571.png

Best Regards,

Mike

 

0 Kudos
2,347 Views
strong
Contributor I

Hello mikedoidge,

  Thanks for your reply. I need to add specified RAM start & entry addresses in the raw code, like step7 in this article "HOWTO: Use IVT Tool To Create A Blob Image". Do I need to add "ExportAB" option in order to add "start_pointer_addr" and "entry_pointer_addr" if I use "ExportAll" option to generate all the binaries? If not, how can I insert these addresses to the raw code?

C:\NXP\S32DS.3.4\eclipse\eclipsec.exe -noSplash \
    --launcher.ini C:\NXP\S32DS.3.4\eclipse\s32ds.ini \
    -application com.nxp.swtools.framework.application \
    -HeadlessTool IVT \
    -MCU S32R41 \
    -SDKVersion PlatformSDK_S32R41_2022_02_CD04 \
    -Load "%cd%\System_M7_0\System_M7_0.mex" \
    -ExportAB "%cd%\System_M7_0\customer\app_boot.bin" \             <---?
    -start_pointer_addr 0x34150000 \                                                      <---?
    -entry_pointer_addr 0x34281000 \                                                     <---?
    -raw_binary "%cd%\System_M7_0\customer\System_M7_0.bin" \   <---?
    -ExportAll "%cd%\System_M7_0\customer"

I execute this command with importAB and get below result with cmd log "with_importAB.txt".

with.png

The blobImage is generated but the size is small.

Best regards & thanks,

sc

0 Kudos
2,335 Views
mikedoidge
NXP Employee
NXP Employee

Hi @strong,

Your command will not work. The command line capability for IVT tool does not support generation of the Application Bootloader Image and Blob image within the same command. You will need to create 2 separate commands to achieve this. First one to create the App boot image and the second one to create Blob image. Please note, to generate the Blob image, within the command you will need to include the option to load the mex file. This means you will also need to export the mex file within the first command where the App boot image is generated.

To summarize:

  1. Create command to import mex file, then export App boot image from raw binary and export new mex file.
  2. Create command to import new mex file, then export Blob image

Hope that helps.

Best regards,

Mike

0 Kudos
2,321 Views
strong
Contributor I

Hi mikedoidge,

  Thanks for your reply. According to your suggestion, I use two step command to generate Blob image.

First, to generate a new .mex file with specified address:

C:\NXP\S32DS.3.4\eclipse\eclipsec.exe -noSplash \
    --launcher.ini C:\NXP\S32DS.3.4\eclipse\s32ds.ini \
    -application com.nxp.swtools.framework.application \
    -HeadlessTool IVT \
    -MCU S32R41 \
    -SDKVersion PlatformSDK_S32R41_2022_02_CD04 \
    -Load "%cd%\System_M7_0\System_M7_0.mex" \
    -ExportAB "%cd%\System_M7_0\customer\app_boot.bin" \
    -start_pointer_addr 0x34150000 \
    -entry_pointer_addr 0x34281000 \
    -raw_binary "%cd%\System_M7_0\customer\System_M7_0.bin" \
    -ExportMEX​ "%cd%\System_M7_0\customer\app_boot.mex"

Second, use app_boot.mex to generate Blob image:

C:\NXP\S32DS.3.4\eclipse\eclipsec.exe -noSplash \
    --launcher.ini C:\NXP\S32DS.3.4\eclipse\s32ds.ini \
    -application com.nxp.swtools.framework.application \
    -HeadlessTool IVT \
    -MCU S32R41 \
    -SDKVersion PlatformSDK_S32R41_2022_02_CD04 \
    -Load "%cd%\System_M7_0\customer\app_boot.mex" \
    -ExportBlob​ "%cd%\System_M7_0\customer\app_boot_blob.bin"

In step1, it only generates app_boot.bin but not app_boot.mex, full cmd log in attached "step1.txt". So I replace option ExportMEX to ExportAll and execute it again, full cmd log in attached "step1_exportAll.txt". And I get .mex file finally, though my original .mex file size is 204k.

strong_0-1678948350393.png

Then I execute step2 command to generate Blob.bin, full cmd log in attached "step2.txt". And I get a 1k size app_boot_blob.bin. Is there anything wrong in my commands or my flow?

Best regards & thanks,

strong

0 Kudos
2,222 Views
mikedoidge
NXP Employee
NXP Employee

Hello @strong,

You have identified a bug in our command line support. I have shared this with our development team and they have entered an internal ticket to address this in a future release.

The issue identified is regarding support for saving the mex file with the new application bootloader image path as part of the first command. I was able to reproduce the issue by using your first command and noticed the following message in the output:

WARNING: Program arguments were not processed: "[-ExportMEX?, C:\Users\Public"workspaceS32DS.3.4\R41_Blob_test\R41_Blob_test_M7_0\Debug_RAM]"

I do have some good news, there is a solution, though it is not ideal. Here are the steps to successfully produce a Blob image from a raw binary image:

  1. Using “-ExportAB” command, export the complete application image based on raw binary code, start pointer address, and end pointer address
  2. Manually edit the mex file you want to use for exporting the blob image and change the path for the application bootloader pointer to the path of the previous exported image (or you can use the UI to import the image for the application bootloader pointer and save the current configuration to the mex file that to be sure you don’t have any overlapping errors).
  3. Load the new mex file and using “-ExportBlob” command, export the blob image

I would suggest that you use the UI to update the mex file for now, until we release a new version which fully supports the workflow you are trying to achieve.

Best Regards,

Mike

0 Kudos
2,197 Views
strong
Contributor I

Hello mikedoidge,

Thanks for your reply. Follow your suggestion step, I can generate Blob image successfully. And compare this Blob image with image generated by ide UI, they are the same.

This procedure is one of automation test step, I will handle step2 by other solution temporarily until your new release to fix this issue. Thanks again for your support.

Best regards & thanks,

strong

0 Kudos