This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cg_xml bootimage

How does one utilize the output of bootimage?  It seems the load addresses are listed in a comment.  Do I need to manually parse the output to get this info?

Could the author of the script make an update to do something like this:

int num_boot_sections = 3;

int array_addresses[3] = { _resetVecs, _text, _const };

int load_addresses[3] = {0x00000000, 0x8C7A0000, 0x8C826700};

That way the corresponding boot code could generically and programmatically determine how many sections, where they go, and where the data is located.

Background:  In order to put up a splash screen early in the boot process on DM8148 we need to be able to load an executable to one of the Cortex M3 devices.  Personally I'd like to use hex470 for that purpose but the --boot option still does not exist (SDSCM00038229) so it's out of the question.  So now I'm trying to use bootimage.  I've successfully generated the *.c and *.h files from this utility.  However, I'm having a little difficulty figuring out how to use it.  Here's a snippet from the output as an example:

output.c said:

/*********************************************************
** _text[0x866fe]: paddr = 0x8c7a0000
**********************************************************/

const unsigned char _text[0x866fe] = {
0x03, 0x46, 0x16, 0xe0, 0x1a, 0x68, 0x42, 0xf0, 0x10, 0x02, 0x0e, 0xe0, 0x1a,
0x68, 0x42, 0xf0, 0x01, 0x02, 0x0a, 0xe0, 0x1a, 0x68, 0x42, 0xf0, 0x02, 0x02,
0x06, 0xe0, 0x1a, 0x68, 0x42, 0xf0, 0x08, 0x02, 0x02, 0xe0, 0x1a, 0x68, 0x42,
0xf0, 0x04, 0x02, 0x1a, 0x60, 0x0a, 0x68, 0x52, 0x1c, 0x0a, 0x60, 0x0a, 0x68,
0x12, 0x78, 0x20, 0x3a, 0xf4, 0xd0, 0xd2, 0x1e, 0xee, 0xd0, 0x08, 0x3a, 0xe8,

 

  • The cg_xml package includes not only the utilities like bootimage, but it includes the Perl source code as well.  Thus the easiest thing to do is modify the source to bootimage to do exactly what you need.  This is a bit less convenient than running already built executables.  Among other things, you have to install Perl.  But, in most cases, you can have a solution that is precisely customized to your problem in almost no time at all.

    For the details, first see the last half of the presentation overview.ppt.  Then read through the file getting_started.txt.  Both files are in the root directory of the cg_xml package.

    Thanks and regards,

    -George

  • I've attached my updated perl script.  Also, here's how I invoke it:

    postprocess.bat said:

    %TI_ARM_CODEGEN_ROOT_DIR%\bin\ofd470.exe -x %OUT_FILE% > temp.xml
    %CG_XML_ROOT_DIR%\ofd\bootimage_custom.pl temp.xml
    del temp.xml

    EDIT:  Anyone looking for an overview of cg_xml please see this presentation.

    bootimage_custom.pl