AW: RTEMS for U-Boot scripts

Andre.Nahrwold at Andre.Nahrwold at
Thu Feb 11 15:31:29 UTC 2021

There has been a small typo in the previous patch.

-----Ursprüngliche Nachricht-----
Von: users <users-bounces at> Im Auftrag von Andre.Nahrwold at
Gesendet: Donnerstag, 11. Februar 2021 16:14
An: users at
Betreff: AW: RTEMS for U-Boot scripts


after some digging I think I found the problem and at least a workaround.

As a disclaimer, I do not know if this really counts as a general fix.
I have not invested enough time to dig through the original mkimage U-Boot source to figure this out.
But I have attached my workaround patch if anyone might face the same problems.

The source of the problem are eight bytes between the header and the actual input file which are missing when using
Also the input size and input crc are wrong which is a result of the missing bytes.

These eight bytes always reflect the actual size of the input file (first four bytes) with four bytes zeros following.
Within the original mkimage tool these eight bytes are considered part of the input file section in the output file.
Therefore the calculated input size is eight bytes higher and the input crc differs.

As a workaround the script will add these eight bytes to the output file and the input crc calculation and adjusts the input size.
This only happens when the type script was selected.

Best regards

-----Ursprüngliche Nachricht-----
Von: users <users-bounces at> Im Auftrag von Andre.Nahrwold at
Gesendet: Dienstag, 26. Januar 2021 08:09
An: users at
Betreff: RTEMS for U-Boot scripts


in our laboratory setup we use different U-Boot scripts to control the boot behavior of our development board (Trenz TE0715 [1] on top of Trenz TE0706 [2]).

These simple scripts need to be converted into a script image using the mkimage command for U-Boot. [3] We use the following command which works fine:

./mkimage -A arm -T script -C none -n "fancy name" -d bootscripts/rtems rtems.img
Image Name:   fancy name
Created:      Tue Jan 26 06:57:50 2021
Image Type:   ARM Linux Script (uncompressed)
Data Size:    324 Bytes = 0.32 KiB = 0.00 MiB
Load Address: 00000000
Entry Point:  00000000
   Image 0: 316 Bytes = 0.31 KiB = 0.00 MiB

Because our setup also depends on the rtems-zynq-mkimg command and the rtems environment to be available we wanted to switch to the usage of the command which comes via RTEMS.
BUT every script image we generate with this tool behaves different than the one we generated with mkimage.
First of all is the output different, including a different resulting file size and a missing contents section. -A arm -T script -C none -n "fancy name" -d bootscripts/rtems rtems.img
Image Name:    fancy name
Created:       Tue Jan 26 08:00:06 2021
Image Type:    none
Data Size:     316
Load Address:  0
Entry Point:   0

Adding the OS option with linux or u-boot does seem to change something, but the resulting script image is again not usable.

I became aware of this because when a script image like this is uploaded to U-Boot and sourced, no error occurs but also nothing else happens.
Usually it should print some information on what the script is doing and then well do its intended operations like it does when it is converted via the mkimage script.

Has somebody else had the same issue and maybe even overcome it?
Or does anybody have a clue where the problem may originate from?

Thanks in advance for the answer and help.


Best regards
Andre Nahrwold
Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR) German Aerospace Center Institute for Software Technolog | SRV-OSS BS | Lilienthalpl. 7 | 38108 Braunschweig | Geb. 112C Raum 001 M.Sc. Andre Nahrwold | Telephone +49 531 295-3834 | andre.nahrwold at

users mailing list
users at
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/octet-stream
Size: 483 bytes
URL: <>

More information about the users mailing list