[riot-users] How to flash at a specific address ?

Aurélien Fillau aurelien.fillau at gmail.com
Thu Mar 22 13:02:01 CET 2018


Thank you very much for your reply.
Actually, i would like to continue using the following "make flash" target
if possible. I'm calling a script by overiding PRE_FLASH_CHECK_SCRIPT
variable. This script is adding some informations to my binary. i saw that
i can flash HEX file by modifying this variable : "export IMAGE_FILE =
$(HEXFILE)" but it seems that BIN file is not generated after compilation,
only ELF and HEX files. With HEX file, there is no more corruption issue
when i flash my main application. But unfortunatly, my script can only
handles ELF or BIN file as input.
So is it possible to generate a BIN file as output and flashing it by using
"make flash" ?



2018-03-21 18:45 GMT+01:00 Francisco Acosta <francisco.acosta at inria.fr>:

> Hi Aurélien,
> This is completely normal. Whenever you flash an ELF file the “not used”
> ROM will become 0.
> What you might do is some magic to generate a “.o" file from your
> bootloader ELF and link it in a single ELF file together with your
> application.
> Or, you can flash everything as BIN, with openocd you can place it
> wherever you want.
> I have already tried something like that in some of my PRs regarding OTA
> and bootloader. You might look at them to have an example.
> Cheers,
> Francisco Javier Acosta Padilla
> Research Engineer at INFINE team
> Inria Saclay Ile-de-France
> On 21 March 2018 at 18:37:39, Aurélien Fillau (aurelien.fillau at gmail.com)
> wrote:
> > Hello,
> >
> > I'm currently working on a stm32l073 on a custom board. I'm writing an
> > application where i need to use my own linker file because i need to put
> > the application at a specific address. This application is starting at
> > 0x08008000. Between 0x08000000 and 0x08008000, i have a bootloader in
> > charge of booting on my application. But when i'm doing a "make flash",
> the
> > flasher is writing some code before 0x08008000 ... that is corrupting my
> > bootloader. Indeed, when i dump the memory i can find the ELF magic
> string
> > and i don't know why the flasher is flashing some code before 0x08008000
> > whereas it is specified in the linker file : rom (rx) : ORIGIN =
> > 0x08008000 !!! Regarding the vector table, it is put at the right place.
> If
> > i want this to work i need to flash my bootloader after the application
> ...
> > If i'm missing something or if you have any idea on how to put an
> > application at a specific address without corrupting the other
> partitions,
> > feel free to share :)
> >
> > Best regards,
> >
> > Aurélien
> > _______________________________________________
> > users mailing list
> > users at riot-os.org
> > https://lists.riot-os.org/mailman/listinfo/users
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20180322/3ec120fd/attachment.html>

More information about the users mailing list