You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Flavio Castro Alves Filho <fl...@gmail.com> on 2021/04/25 11:22:11 UTC
Running applications from dataflash
Hello,
I intend to implement a firmware update feature for my project, which
is based on stm32f4discovery.
My idea is to load a separated ELF file on the dataflash, which is
loaded using the approach described in the following video:
https://www.youtube.com/watch?v=oL6KAgkTb8M
When running this application, another content from this same
dataflash, the new firmware, will be used to erase the mcu flash and
write the new firmware.
While evaluating this approach and watching the video, I had 2 questions:
1. Can an ELF file be executed from dataflash too?
2. Is this execution totally independent from the MCU flash?
Best regards,
Flavio
--
Flavio de Castro Alves Filho
flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves
Re: Running applications from dataflash
Posted by Gregory Nutt <sp...@gmail.com>.
> 1. Can an ELF file be executed from dataflash too?
No. ELF cannot run XIP (eXecute In Place) in NOR FLASH. That is
because the ELF module is only partially linked and requires run-time
relocations to the ELF image to access the data area arbitrarily located
in RAM.
An option is to use a fully linked file... basically a binary nuttx.bin
image ... that already has all of the RAM addresses resolved.
Another option is to use NxFLAT which does not require any relocations
in FLASH and which runs PIC/PID (Position Independent Code/Data).
NxFLAT has other limitations, however.
> 2. Is this execution totally independent from the MCU flash?
If I understand the question correctly... ELF is copied into RAM when it
executes and no longer needs to use FLASH memory for any execution.