Skip to main content
Visitor II
June 17, 2021
Question

Win10 Cubeprogrammer and DFU Bootloader STM32MP1 instable

  • June 17, 2021
  • 7 replies
  • 3627 views

I work on Win10. DFU is seen in the settings. I use the programmer to transfer the linux image to the customer MP1 board. The transfer is very instable and break on different files/positions. Very seldom the complete *.tsv image is transfered and I can start the linux system.

set TOOL=C:\ST\STM32CubeIDE_1.6.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.6.0.202101291314\tools\bin\STM32_Programmer_CLI.exe
%TOOL% -c port=USB1 -d tf-a-u-boot-kernel-initrd.tsv 
%TOOL% -c port=USB1 -detach
pause
C:\Projekte\30088\EMOTAS>C:\ST\STM32CubeIDE_1.6.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.6.0.202101291314\tools\bin\STM32_Programmer_CLI.exe -c port=USB1 -detach
 -------------------------------------------------------------------
 STM32CubeProgrammer v2.7.0-RC1
 -------------------------------------------------------------------
 
 
 
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN : 0037001E3438510B31393233
FW version : 0x0110
Device ID : 0x0500
Device name : STM32MP1
Device type : MPU
Device CPU : Cortex-A7

(The last code is from the detach, but it should show my settings.)

Example for an abort:

Memory Programming ...
Opening and parsing file: u-boot.stm32
 File : u-boot.stm32
 Size : 823588 Bytes
 Partition ID : 0x03
 
Download in Progress:
 Size : 823588 Bytes
sending packet nbr: 0
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 1
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 2
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 3
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 4
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 6
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 7
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 8
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 9
libusb control transfer error: -7
 
 
Error: failed to download Segment[0]
Error: failed to download the File
Error: Download partition 0x03 failed
Error: TSV flashing service failed

Regards

Steffen

    This topic has been closed for replies.

    7 replies

    Technical Moderator
    June 17, 2021

    Hi @Steffenose​ ,

    Thanks for your post.

    I first notice that you use STM32_CubeProgrammer integrated as STM32CubeIDE pluggin.

    Quite unusual way of working and this version strangely show up as STM32CubeProgrammer v2.7.0-RC1.

    Could you please make a try using the official STM32CubeProg delivery from here https://www.st.com/en/development-tools/stm32cubeprog.html ?

    Else please share further details about your environment :

    Custom board if I got it well from previous post but what STM32MP1 reference ?

    Which version of ecosystem ?

    Thanks to share the .tsv content you are using and complete CubeProg and UART console traces in case of failure.

    Thanks,

    Olivier

    Visitor II
    June 17, 2021

    Hi,

    thank you very much for your answer, but I cannot see the relevance. It would be nice, if you point me to the relevant information. At the end of the day I want to develop on the M4 using the STM32CubeIDE on Windows. The Linux A7 is not my part, but of course it is my part to initialize the system. I used the GUI of the Programmer, too. But without differences. (Unsure, why the IDE is delivered with a RC1 version? )

    I understand, that the transfer use two phases. But the transfer is instable in both. So in the first phase the CPU DFU bootloader is running, right?

    CPU: STM32MP153CAA Rev B

    At the moment not relevant, but I use an external ST-Link v2-1 from a Nucleo64 with SWD connection. (My next step would be to access the M4 without corrupting the A7 system. ;) But the initialization also create A7 accesses and A7 holds.)

    With "--verbosity 3" it transfer slower, but more stable.

    Because I use the ready to use linux images of my customer my information are limited. Hope, it helps.

    NOTICE: BL2: v2.2-r2.1(debug):v2.2-3-gbeca8e754-dirty
    NOTICE: BL2: Built : 18:43:48, Jun 6 2021
    U-Boot 2021.07-rc3-dirty (Jun 06 2021 - 22:58:02 +0200)
     
    CPU: STM32MP153CAA Rev.B
    Model: STMicroelectronics custom STM32CubeMX board
    Board: stm32mp1 in trusted mode (st,stm32mp153c-asample-mx)

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 5.10.10-as-dirty (***l@localhost.localdomain) (arm-***_linux-linux-gnueabi-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #80 SMP PREEMPT Sat Jun 5 13:30:40 CEST 2021

    Visitor II
    June 17, 2021

    only one attachment?

    Visitor II
    June 17, 2021

    the tsv-file itself

    Technical Moderator
    June 17, 2021

    Hi @Steffenose​ ,

    Sorry, problem you report is quite unusual. To be relevant I first need to have a clear view of your context. :smiling_face_with_smiling_eyes:

    With the provided file I understand you work on custom board with STM32MP153CAA RevB chip and with openstlinux-5.4-dunfell-mp1-20-11-12 (aka DV2.1 ).

    Thanks to give information Linux is not your part .. so who provide you the material ? ( binaries and tsv )

    Does he confirm your experiment ?

    Indeed, looks like you succeed to load TF-A and Uboot in DDR but then it seems you are facing instability on USB to download next partition.

    I would suggest to double check the USB Device Tree configuration in TF-A and Uboot.

    Else, since you want to focus on M4, did you already think about using at first the Engineering boot mode which allow you to experiment M4 firmware without taking care of Linux side ?

    For reference : https://wiki.st.com/stm32mpu-ecosystem-v2/wiki/STM32CubeMP1_development_guidelines

    Hope it help,

    Olivier

    Technical Moderator
    June 17, 2021

    Hi @Steffenose​ 

    Sorry I just realized I miss information that you are using ready to use image from customer.

    So interesting to get his feedback vs this issue.

    Olivier

    Visitor II
    June 18, 2021

    Hi,

    attached I have the log, with the aborted uboot transfer. Do I understand you correct this transfer use the TF-A? And you suggest to check the TF-A settings.

    Our customer maintain the hardware and the linux part. He use a Linux PC.

    I understand, that it is needed for this part.

    I familiar with STM32CubeIDE on Windows and had the hope I can use it for the M4 development, too.

    As I understand the production mode is set by hardware boot pins.

    I want to use the ST-Link to develop and debug the M4.

    Is it possible to use the remoteproc with serial console only? It seems I need ethernet access to copy the scripts and files to the Linux system.

    The hardware don't have ethernet and it seems Win10 doesn't have CDC ECM drivers, does it?

    Can you explain, why you use this way instead of write the M4 program using the debug interface? It's RAM and the area is fix, right?

    The M4 *elf files are static linked to fix addresses. Linux doesn't change it, does it?

    Or can I use the STM32CubeIDE setting for Engineering mode, but of course the CPU itself is in production mode, that means, I don't have access to all settings and memories. RAM write by gdb should be possible in this environment, doesn't it?

    OK, I will forward your information to our customer.

    Thank you

    Steffen

    Technical Moderator
    June 23, 2021

    Hi @Steffenose​ ,

    We have noticed in your log a strange DDR config @300000KHz which is the bottom limit and may explain some trouble.

    Again, this require further information from your customer about the product and design choice.

    You can use "Private message" to provide me further detail you don't want to disclose publicly.

    BR,

    Olivier

    Visitor II
    June 23, 2021

    I answered yesterday to your private mail. Seems you did not receive it?

    Technical Moderator
    June 24, 2021

    Hi @Steffenose​ ,

    I contacted ST guys supporting your customer and he confirm that migration to a consistent Ecosystem V3 version is a work in progress.

    I hope this next version will fix DFU instability you are observing.

    In the meantime I understand you can workaround instability with verbosity setting.

    Regarding other question :

    Can you explain, why you use this way instead of write the M4 program using the debug interface? It's RAM and the area is fix, right?

    The M4 *elf files are static linked to fix addresses. Linux doesn't change it, does it?

    In production mode M4 is a slave of the A7/Linux system that control the system resource provided to M4. ( memory, clock etc.. )

    That's why the load and start of M4 might be ensure by a Linux service and can't be bypass by a JTAG load directly into RAM ( this may lead to many resource conflict )

    The hardware don't have ethernet 

    2 alternatives :

    • if HW has an USB_OTG you can try to use the USB ethernet gadget which setup a peer to peer connection ( enabled by default on DK2 Starter Image )

    This can be transparently used by CubeIDE as ethernet connection.

    • If you have USB host port, use USB stick to copy manually the .elf inside /lib/firmware and then proceed to load and start of the firmware thanks to manual remoteproc command

    https://wiki.st.com/stm32mpu/wiki/Linux_remoteproc_framework_overview#How_to_use_the_framework

    You can then still use CubeIDE for debug just unticking the "load firmware" option in the Debug Configuration.

    Or can I use the STM32CubeIDE setting for Engineering mode, but of course the CPU itself is in production mode, that means, I don't have access to all settings and memories. RAM write by gdb should be possible in this environment, doesn't it?

    Engineering mode is a specific mode where A7 is on hold and M4 is JTAG open.

    as explain in  https://wiki.st.com/stm32mpu-ecosystem-v2/wiki/STM32CubeMP1_development_guidelines in this mode M4 has access to almost all resources as master.

    It can help you to mature your application.

    Only potential A7 to M4 communication and synchronization will then remain to validate with Production mode.

    Hope it help

    Olivier

    Visitor II
    June 25, 2021

    Thank you for your feedback. The use of Windows seems to be not so easy to create the M4 only part, but with interaction to the A7 linux.

    Now I use Linux, too.

    The DFU transfer seems to be good working on the beginning of the day, (fresh started PC, fresh started customer hardware). Later on the day with power off/on it seems, that I have more problems. But at the moment I have a run. ;)

    Because the customer hardware don't have Ethernet, the customer activated CDC ECM on USB and it works on linux. On windows it seems not to be supported and some versions ago the workarounds (Intel, Acer driver) was removed. But if you have a solution for this it would be a good point for the wiki.

    It seems, that the customer use a little bit changed linux image. The Stm32CubeIde seems to send commands to the linux side, that are not implemented (-ne not known). Is there a documentation, what the IDE needs on the Linux side to work correctly or is it possible to see the commands as echo?

    At the moment I use a shell and copy all data i need on the customer hardware and start it. After them I use the IDE and start debugging of the M4.

    Means in principe it works.

    Thank you

    BR

    Steffen