Segmentation fault on building sb file using elftosb tool

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

Segmentation fault on building sb file using elftosb tool

Jump to solution
1,203 Views
razools
Contributor III

Hi

I am getting segmentation fault when building sb file. I built simple helloworld program using SDK Example and generated SREC file using binary Tools in MCUXpresso. I used the .s19 file generated as input to elftosb utility but following is error:

 

./elftosb -f imx -V -c program_flexspinor_image_hyperflash.bd -o evkmimxrt1170_freertos_hello_cm7.bin evkmimxrt1170_freertos_hello_cm7.s19 
	Section: 0x0
Segmentation fault (core dumped)

 

I followed this link. What can be the issue @jeremyzhou ?

0 Kudos
1 Solution
1,147 Views
jeremyzhou
NXP Employee
NXP Employee


Hi,
Thanks for your reply.
Did you ever try using the Linux version of the tool to generate the sb file?
If not, please give it a try, then compare it with your command.
I also attached the elftosb for the Linux OS and you can try it.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
7 Replies
1,185 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @razools ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Actually, the above bd file is inappropriate to generate the bin, so please check the commands carefully in the link.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,180 Views
razools
Contributor III

Hi @jeremyzhou 

Thanks for your prompt reply. I am able to generate bin file if using imx-flexspinor-normal-unsigned.bd as is. As I am using IMXRT1176 adn Flash address starts from  0x30000000 rather than 0x60000000. As soon as i change my start address to 0x30000000, I get Segmentation fault (core dumped)

My bd file looks like

options {
    flags = 0x00;
    startAddress = 0x30000000;
    ivtOffset = 0x1000;
    initialLoadSize = 0x2000;
    //DCDFilePath = "dcd.bin";
    # Note: This is required if the default entrypoint is not the Reset_Handler 
    #       Please set the entryPointAddress to Reset_Handler address 
    // entryPointAddress = 0x60002411;
}

sources {
    elfFile = extern(0);
}

section (0)
{
}

while imx-flexspinor-normal-unsigned.bd (that doesn't creates segmentation fault) is 

options {
    flags = 0x00;
    startAddress = 0x30000000;
    ivtOffset = 0x1000;
    initialLoadSize = 0x2000;
    //DCDFilePath = "dcd.bin";
    # Note: This is required if the default entrypoint is not the Reset_Handler 
    #       Please set the entryPointAddress to Reset_Handler address 
    // entryPointAddress = 0x30002000;
}

sources {
    elfFile = extern(0);
}

section (0)
{
}

and my elftosb version is 

elftosb 4.0.0
Copyright (c) 2004-2015 Freescale Semiconductor, Inc.
All rights reserved.

Any ideas what can be the issue ?

0 Kudos
1,178 Views
razools
Contributor III

I just tried elftosb version 5.1.18. same results. As soon as i change my startAddress from 0x30000000 to 0x60000000, it works. 

@jeremyzhou can you point me out what could be the reason and probable fix ?

0 Kudos
1,171 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @razools 

Thanks for your reply.
Please illustrates the steps of generating evkmimxrt1170_freertos_hello_cm7.s19, further, you can try to use the GUI tool instead of typing commands manually.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,158 Views
razools
Contributor III

Thanks @jeremyzhou 

The GUI Tool works fine. I am able to generate bin file. Using the newly generated nopadding.bin file, I am able to create sb file.

For generation image using Linux OS i am following this link and following are my steps

  1. Generated .s19 file
  2. Generated dcd.bin
  3. Generated .bin file using following command
    ./elftosb -f imx -V -c imx-flexspinor-normal-unsigned.bd -o evkmimxrt1170_freertos_hello_cm7.bin evkmimxrt1170_freertos_hello_cm7.s19
    I am not able to find imx-flexspinor-normal-unsigned-dcd.bd so I used the normal one without DCD and uncommented DCD File input in the bd file
  4. Now using evkmimxrt1170_freertos_hello_cm7_noppading file to get sb file. Heremy Linux tool is throwing Segmantation Fualt. While using same bd and _nopadding.bin file, I am ble to generate .sb using Windows elftosb. Followng is my command
    ./elftosb -f kinetis -V -c program_flexspinor_image_hyperflash.bd -o evkmimxrt1170_freertos_hello_cm7.sb evkmimxrt1170_freertos_hello_cm7_nopadding.bin  

Following is the error output i am getting on Linux

 

./elftosb -f kinetis -V -c program_flexspinor_image_hyperflash.bd -o evkmimxrt1170_freertos_hello_cm7.sb evkmimxrt1170_freertos_hello_cm7_nopadding.bin
Segmentation fault (core dumped)

 

While on windows its is successful

 

./elftosb.exe  -f kinetis -V -c program_flexspinor_image_hyperflash.bd -o evkmimxrt1170_freertos_hello_cm7.sb evkmimxrt1170_freertos_hello_cm7_nopadding.bin
Boot Section 0x00000000:
  FILL | adr=0x00002000 | len=0x00000004 | ptn=0xc0233007
  ENA  | adr=0x00002000 | cnt=0x00000004 | flg=0x0900
  ERAS | adr=0x30000000 | cnt=0x01000000 | flg=0x0000
  FILL | adr=0x00003000 | len=0x00000004 | ptn=0xf000000f
  ENA  | adr=0x00003000 | cnt=0x00000004 | flg=0x0900
  LOAD | adr=0x30001000 | len=0x0002e5e4 | crc=0x8e62122b | flg=0x0000

 

 

What can be the issue with elftosb in Linux version ?

0 Kudos
1,148 Views
jeremyzhou
NXP Employee
NXP Employee


Hi,
Thanks for your reply.
Did you ever try using the Linux version of the tool to generate the sb file?
If not, please give it a try, then compare it with your command.
I also attached the elftosb for the Linux OS and you can try it.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,144 Views
razools
Contributor III

Thanks @jeremyzhou 
the elftosb attached with your reply worked.

I am able to generate the sb file now.

0 Kudos