0
votes

For context, I've been adding some patches to u-boot for a project, and I already have the kernel image, device tree blob, and initrd image loaded into u-boot memory.

I've had luck in the past calling command line functions (like do_mem_cp) through their respective C functions, but I am not having luck with the bootm command. I am currently doing:

char *argv[4] = {"bootm", "a5001000", "b0000000", "a9000000"};
do_bootm(NULL, 0, 4, argv);

As I stated, this worked in the past for other commands, but during this call I'm getting the error "Synchronous Abort" handler, esr 0x96000004. Does anyone know of a better way to call bootm (or a similar command) from C?

Edit: This is for the Jetson TX2i

1
One thing I noticed is that none of the sizes of these "BLOBs" are fed into bootm... do I need to store these somewhere? - Eric Miller

1 Answers

0
votes

The definition of do_bootm() is:

extern int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc,
                    char *const argv[]);

In case of an error cmdtp is dereferenced to print the name of the executed command. So you should not pass NULL as cmdtp. Instead fill a structure of the appropriate type and pass a pointer to it.