Hi, On 2/28/20 9:28 AM, gianluca wrote: >> 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... barebox output is uart4 (ttyACM of ST-Link). > 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? Yes. Try enabling CONFIG_DEBUG_LL to see if you get some early output from barebox before the UART driver was probed. barebox might not work under a "trusted" TF-A, because it isolates some peripherals behind vendor-specific secure monitor calls. I intend to add support for these, once upstream TF-A has SCMI support. For now, you may be better off using the flash tool like it's intended and write vendor TF-A and vendor U-Boot to RAM and then use those to flash barebox and TF-A to eMMC. See FlashLayout_sdcard_stm32mp157c-ev1-basic.tsv[1] for an example. [1]: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Starter_Package_-_images Cheers Ahmad > > > Gianluca -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox