elftosb segfault on linux when generating bootloader script for iMXRT1050

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

elftosb segfault on linux when generating bootloader script for iMXRT1050

622 Views
liampribis
Contributor I

Hi,

I'm generating a bootloader command script for provisioning flash for a fresh iMXRT1050 board. This is done in two steps using elftosb:

  1. Package built screc file as bootable image (in ITCM) using elftosb
  2. Generate a bootloader command script using elftosb which configures qspi flash, erases the flash, loads the bootable image from step 1, and sets BT_FUSE_SEL fuse bit.

This process has been working on windows, and the bootloader command script works as intended when run on device using blhost. However, the second step causes a segmentation fault when elftosb is invoked on linux (first step works fine).

Here is the bd script causing segfault (`provision_flash.bd`):

sources {
bootableImage = extern (0);
}

section (0) {
# Flash config
load 0xc0000007 > 0x2000;
enable flexspinor 0x2000;


# clear the whole flash (128 MiB)
erase 0x60000000..0x61000000;

# erase a bit (faster for testing)
# erase 0x60000000..0x60100000;

# do the magic dance
load 0xf000000f > 0x3000;
enable flexspinor 0x3000;

load bootableImage > 0x60001000;

# set the BT_FUSE_SEL fuse bit
load fuse 0x00000010 > 0x06;
}

This is how elftosb is being invoked:

$ Flashloader_RT1050_1.1/Tools/elftosb/linux/amd64/elftosb -f kinetis -V -c provision_flash.bd -o provision.sb itcm_bootable_nopadding.bin

Segmentation fault (core dumped)

 

I have been using the flashloader tools from the iMXRT1050 downloads page  (Flashloader_RT1050_1.1).

 

This segfault does not happen:

  • On windows using the same flashloader tools version, script, and input image.
  • When generating bootable images using elftosb (as opposed to generating bootloader scripts).
  • When using the iMXRT1060 flashloader (FlashLoader_RT106x_1.0_GA) on the same script/image

 

My questions are:

  1. Is this a known issue?
  2. Is it safe to use the RT106x elftosb tool to generate a bootloader bd script for 1050 devices? This is the workaround I am currently using.
  3. What is the difference between elftosb for the 106x and the 1050? They both output the same version "4.0.0", but with slightly different copyright text. The executables are not binary identical.
# 106x version
$ elftosb --version
elftosb 4.0.0
Copyright (c) 2004-2015 Freescale Semiconductor, Inc.
Copyright 2016-2018 NXP
All rights reserved.

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

 

0 Kudos
Reply
0 Replies