mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Mihaita Ivascu <mihaita_ivascu@trimble.com>
To: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de>
Cc: barebox@lists.infradead.org
Subject: Re: flash barebox to NAND
Date: Wed, 23 Oct 2019 12:39:33 +0200	[thread overview]
Message-ID: <CAEp+FuD-tQYJ1grcxZC0scaGtE4y_33zgLpUcgqWfr+PJ2sfNA@mail.gmail.com> (raw)
In-Reply-To: <1694d1a3-6eb3-4146-e0f1-2988925f1832@atsonline.de>

On Wed, Oct 23, 2019 at 12:27 PM Andreas Geisenhainer
<Andreas.Geisenhainer@atsonline.de> wrote:
>
> On 2019-10-23 11:39 a.m., Mihaita Ivascu wrote:
> > Hello all,
> >
> >    I would like to know what possibilities do I have to flash a barebox
> > image to mtd partition from Linux?
> >   Using ubifs commands does not work. the barebox will not boot so
> > probably additional info needs to be written except the barebox image
> > itself.
>
> I needed to flash updates to barebox from userspace myself and struggled
> with a solution for a bit.
>
> I'm doing three things:
>
>   1) get the correct /dev-device for barebox
>   2) use `flash_erase` on that device
>   3) use `nandwrite` to write the barebox_*.img onto the device
>

   Thanks for your prompt reply. I already tried that but it won't
boot for me. Maybe additional info related to barebox env needs to be
written.
   I am trying by sending UTP commands from MFGtools:

UTP: received command '$ flash_erase /dev/mtd0 0 0'
UTP: executing "flash_erase /dev/mtd0 0 0"
Erasing 128 Kibyte @ 39002e0000 -- -1 % compl[    6.275463] utp_poll:
pass returned.
Erasing 128 Kibyte @ 64004e0000 -- -1 % complete
UTP: sending Success to kernel for command $ flash_erase /dev/mtd0 0 0.
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ nandwrite -p /dev/mtd0 -p $FILE'
UTP: executing "nandwrite -p /dev/mtd0 -p $FILE"
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
UTP: sending Success to kernel for command $ nandwrite -p /dev/mtd0 -p $FILE.
[    6.823965] utp_poll: pass returned.

  I am writing a barebox.bin using nandwrite but it seems the new
barebox(which is correct should boot) won't boot. So I am wondering if
the nandwrite command is enough?
  I know nandwrite you can use it successfully for flashing roots or
kernel on mtd partition but maybe for the bootloader is not working

Thanks,
       Mihaita

> This works for me, and there's probably some documentation for this
> around, but i do not recall where i found it anymore.
>
> good luck
> Andreas

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-10-23 10:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  9:39 Mihaita Ivascu
2019-10-23 10:27 ` Andreas Geisenhainer
2019-10-23 10:39   ` Mihaita Ivascu [this message]
2019-10-23 13:33 ` Sascha Hauer
2019-10-23 13:47   ` Mihaita Ivascu
2019-10-24  6:58     ` Sascha Hauer
2019-10-25 16:43       ` Mihaita Ivascu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEp+FuD-tQYJ1grcxZC0scaGtE4y_33zgLpUcgqWfr+PJ2sfNA@mail.gmail.com \
    --to=mihaita_ivascu@trimble.com \
    --cc=Andreas.Geisenhainer@atsonline.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox