Hi Alan,

many thanks for your hints!!

In my this situation, the -29 error is returned by

ret = elf_load(&loadinfo);

But, turned out that the error was coming from the NXFFS.. I reformatted
the volume from which I was loading the ELF file, and the error
disappeared, working well..

Takes some seconds to load the binary, but this is because the I2C
EEPROM is running only at 400KHz max.



Best regards,

FLorian




On 03/04/2020 11:36, Alan Carvalho de Assis wrote:
Hi Florian,

The error -29 is -ESPIPE : Illegal seek.

Probably it comes from here:

   if (offset > iob->io_pktlen)
     {
       ioberr("ERROR: offset is past the end of data: %u > %u\n",
              offset, iob->io_pktlen);
       return -ESPIPE;
     }

Please try to enable CONFIG_IOB_DEBUG and see if the above error
message is printed. Then you can track why it is failing.

BR,

Alan

On 4/3/20, Florian Wehmeyer<flo...@gmx.net>  wrote:
Hi all,

I need to update my app running on nuttx 8.2 system in a simple way,
this is why I've chosen the

"Release System with ELF Programs: No Symbol Tables" approach.


My problem is the size of my elf file, it is up to 12K.

This is basically because I've packed all the features into 1 task
(network, file I/O, json, etc) because it would be more simple to update
a single elf file rather than have a lot of different elf files for
different tasks and having to maintain a "repository" of those tasks.


My question is, is this somehow stupid to do? Is there a reason why I
should avoid to load "bigger" elf-files?

The system has enough RAM:

nsh> free
               total       used       free largest
Umem:       229072      17760     211312     211136


What happens is, when the elf file is bigger than about 4K, the binary
loader encounters a problem, independently on the config settings of the
elf buffer sizes:

CONFIG_ELF_STACKSIZE=10240
CONFIG_ELF_BUFFERSIZE=256
CONFIG_ELF_BUFFERINCR=32


here's part of the debug output:


elf_loadshdrs: Insufficient space in file for section header table

elf_dumploadinfo: LOAD_INFO:
elf_dumploadinfo:   textalloc: 00000000
elf_dumploadinfo:   dataalloc: 00000000
elf_dumploadinfo:   textsize: 0
elf_dumploadinfo:   datasize: 0
elf_dumploadinfo:   filelen: 5360
elf_dumploadinfo:   filfd: 3
elf_dumploadinfo:   symtabidx: 0
elf_dumploadinfo:   strtabidx: 0
elf_dumploadinfo: ELF Header:
elf_dumploadinfo:   e_ident:      7f 45 4c 46
elf_dumploadinfo:   e_type: 0001
elf_dumploadinfo:   e_machine: 0028
elf_dumploadinfo:   e_version: 00000001
elf_dumploadinfo:   e_entry: 00000555
elf_dumploadinfo:   e_phoff: 0
elf_dumploadinfo:   e_shoff: 5056
elf_dumploadinfo:   e_flags: 05000000
elf_dumploadinfo:   e_ehsize: 52
elf_dumploadinfo:   e_phentsize: 0
elf_dumploadinfo:   e_phnum: 0
elf_dumploadinfo:   e_shentsize: 40
elf_dumploadinfo:   e_shnum: 11
elf_dumploadinfo:   e_shstrndx: 8
elf_loadbinary: Failed to load ELF program binary: -29


Thanks a lot for any help!!

Florian





--
Florian Wehmeyer
TFW Tech Solutions


--
Florian Wehmeyer
TFW Tech Solutions

Reply via email to