mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: gianluca <gianlucarenzi@eurek.it>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: Re: Barebox as first and second stage bootloader
Date: Fri, 28 Feb 2020 09:28:12 +0100	[thread overview]
Message-ID: <eeab62fa-2049-42d8-f666-8c912e2a7e2d@eurek.it> (raw)
In-Reply-To: <701628bd-3198-a670-a3e7-13f137a99d2d@eurek.it>

On 02/28/2020 08:50 AM, gianluca wrote:
> Now it compiles with the gcc version 7.3.1 20180622 (release)
> [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded
> Processors 7-2018-q2-update).
> Built build/stm32mp1/debug/tf-a-stm32mp157c-dk2.bin successfully
>
>
> Generated build/stm32mp1/debug/tf-a-stm32mp157c-dk2.stm32
> tools/stm32image/stm32image -s
> ./build/stm32mp1/debug/tf-a-stm32mp157c-dk2.bin -d
> build/stm32mp1/debug/tf-a-stm32mp157c-dk2.stm32 -l 0x000000002ffc2500 -e
> 0x000000002ffd8000 -v 0
> Image Type   : ST Microelectronics STM32 V1.0
> Image Size   : 245128 bytes
> Image Load   : 0x2ffc2500
> Entry Point  : 0x2ffd8000
> Checksum     : 0x00ebe57e
> Option     : 0x00000001
> Version       : 0x00000000
>

Now having the following .tsv file:

> #Opt	Id	Name	Type	IP	Offset	Binary
> -	0x01	fsbl1-boot	Binary	none	0x0	tf-a-stm32mp157c-dk2.stm32
> -	0x03	ssbl-boot	Binary	none	0x0	barebox-stm32mp157c-dk2.img

The STM32_Programmer_CLI cmdline gives those messages:

  ---> (cmdline) STM32_Programmer_CLI -c port=usb1 -w 
stm32mp157c-dk2.tsv <---

>       -------------------------------------------------------------------
>                         STM32CubeProgrammer v2.3.0
>       -------------------------------------------------------------------
>
>
>
> USB speed   : High Speed (480MBit/s)
> Manuf. ID   : STMicroelectronics
> Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
> SN          : 0022002B3338510534383330
> FW version  : 0x0110
> Device ID   : 0x0500
> Device name : STM32MPxxx
> Device type : MPU
> Device CPU  : Cortex-A7
>
>
> Start Embedded Flashing service
>
>
>
> Memory Programming ...
> Opening and parsing file: tf-a-stm32mp157c-dk2.stm32
>   File          : tf-a-stm32mp157c-dk2.stm32
>   Size          : 245384 Bytes
>   Partition ID  : 0x01
>
> Download in Progress:
> [==================================================] 100%
>
> File download complete
> Time elapsed during download operation: 00:00:00.830
>
> RUNNING Program ...
>   PartID:      :0x01
> Start operation done successfully at partition 0x01
>
> Flashlayout Programming ...
> [==================================================] 100%
> Running Flashlayout Partition ...
> Flashlayout partition started successfully
>
>
> Memory Programming ...
> Opening and parsing file: barebox-stm32mp157c-dk2.img
>   File          : barebox-stm32mp157c-dk2.img
>   Size          : 284074 Bytes
>   Partition ID  : 0x03
>
> Download in Progress:
> [==================================================] 100%
>
> File download complete
> Time elapsed during download operation: 00:00:00.232
>
> RUNNING Program ...
>   PartID:      :0x03
>
> reconnecting the device ...
>
> Error: unable to reconnect the target device: time out expired
>
>
> Error: Start operation failed at partition 0x03
> Error: TSV flashing service failed

So in the console debug (via ttyACM usb gadget) I have these messages:

> NOTICE:  CPU: STM32MP157CAC Rev.B
> NOTICE:  Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
> NOTICE:  Board: MB1272 Var2 Rev.C-01
> INFO:    Reset reason (0x14):
> INFO:      Pad Reset from NRST
> INFO:    PMIC version = 0x10
> INFO:    Using USB
> INFO:      Instance 2
> INFO:    Boot used partition fsbl1
> NOTICE:  BL2: v2.0-r3.0(debug):v2.0-stm32mp-r3
> NOTICE:  BL2: Built : 08:44:36, Feb 28 2020
> INFO:    BL2: Doing platform setup
> INFO:    RAM: DDR3-1066/888 bin G 1x4Gb 533MHz v1.45
> INFO:    Memory size = 0x20000000 (512 MB)
> INFO:    BL2 runs SP_MIN setup
> INFO:    BL2: Loading image id 4
> INFO:    Loading image id=4 at address 0x2ffef000
> INFO:    Image id=4 loaded: 0x2ffef000 - 0x30000000
> INFO:    BL2: Loading image id 5
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    UPLOAD :
> INFO:                   Phase ID : 0
> INFO:                   address 0x2ffed78c
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    UPLOAD :
> INFO:                   Phase ID : 0
> INFO:                   address 0x2ffed78c
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    Start Download partition 0 to address 0xc0000000 length 0
> INFO:    USB : DFU : end of download partition : 0
> INFO:    Loading image id=5 at address 0xc0100000
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    UPLOAD :
> INFO:                   Phase ID : 3
> INFO:                   address 0x2ffed78c
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    receive request 6
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    UPLOAD :
> INFO:                   Phase ID : 3
> INFO:                   address 0x2ffed78c
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    usb_partition_size: partition size : 0x454aa
> INFO:    Start Download partition 3 to address 0xc0100000 length 283818
> INFO:    USB : DFU : end of download partition : 3
> WARNING: Skip signature check (header option)
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    UPLOAD :
> INFO:                   Phase ID : 0
> INFO:                   address 0xffffffff
> INFO:    Send detach request
> INFO:    GETSTATUS :
> INFO:                   DFU_STATE_IDLE
> INFO:    Receive Detach
> INFO:    Image id=5 loaded: 0xc0100000 - 0xc01454aa
> NOTICE:  BL2: Booting BL32
> INFO:    Entry point address = 0x2ffef000
> INFO:    SPSR = 0x1d3
> NOTICE:  SP_MIN: v2.0-r3.0(debug):v2.0-stm32mp-r3
> NOTICE:  SP_MIN: Built : 08:44:45, Feb 28 2020
> INFO:    ARM GICv2 driver initialized
> INFO:    stm32mp HSI (18): Secure only
> INFO:    stm32mp HSE (20): Secure only
> INFO:    stm32mp PLL2 (27): Secure only
> INFO:    stm32mp PLL2_R (30): Secure only
> INFO:    SP_MIN: Initializing runtime services
> INFO:    SP_MIN: Preparing exit to normal world

So it seems it hangs on running or transferring Barebox as SSBL... Or 
the Barebox output is not the same as TF-A...

The Barebox is 2020.01.0, the steps to build it are:

1- make ARCH=arm stm32mp_defconfig
2- make ARCH=arm all

>   CHK     include/generated/version.h
>   CHK     include/generated/utsrelease.h
>   CREATE  include/config.h
>   CHK     include/generated/compile.h
>   ENV     defaultenv/barebox_default_env
>   ENV     defaultenv/defaultenv-2-base.bbenv
>   ENV     defaultenv/defaultenv-2-menu.bbenv
>   CHKFILESIZE images/start_stm32mp157c_dk2.pblb
>   LN      images/../barebox-flash-image
> images built:
> barebox-stm32mp157c-dk2.img

So the SSBL the .tsv file is referring to is the last build of Barebox.

Any hint? Clue? or whatever?

Is the console output of Barebox in the stm32mp_defconfig routed to the 
same RX & TX pins for the ttyACM as for the TF-A components?


Gianluca
-- 
Eurek s.r.l.                          |
Electronic Engineering                | http://www.eurek.it
via Celletta 8/B, 40026 Imola, Italy  | Phone: +39-(0)542-609120
p.iva 00690621206 - c.f. 04020030377  | Fax:   +39-(0)542-609212

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

  reply	other threads:[~2020-02-28  8:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 11:57 gianluca
2020-02-26 14:28 ` Ahmad Fatoum
2020-02-26 14:46   ` gianluca
2020-02-26 15:08     ` Ahmad Fatoum
2020-02-26 15:30       ` gianluca
2020-02-26 15:46         ` Ahmad Fatoum
     [not found]           ` <2b5d2afe-c71e-34b9-efa5-57aaa5f28445@eurek.it>
2020-02-27 11:51             ` Ahmad Fatoum
2020-02-28  7:50               ` gianluca
2020-02-28  8:28                 ` gianluca [this message]
2020-03-03  6:58                   ` Ahmad Fatoum
     [not found]           ` <fb81fdd3-b674-ce0b-e472-ec8e606e4131@eurek.it>
2020-03-03  7:03             ` Ahmad Fatoum

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=eeab62fa-2049-42d8-f666-8c912e2a7e2d@eurek.it \
    --to=gianlucarenzi@eurek.it \
    --cc=a.fatoum@pengutronix.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