2023-06-06 12:27 AM
I am currently developing using the STM32MP157FAD. And I want to create a distribution image and download the image using STM32CubeProgrammer.
However, while downloading the image, the following error message is displayed in the log of STM32CubeProgrammer.
15:34:17:270 : DFU status = 0
15:34:17:270 : DFU State = 5
15:34:17:270 : Segment[0] downloaded successfully
15:34:17:270 : File download complete
15:34:17:270 : Time elapsed during download operation: 00:00:01.440
15:34:17:270 : RUNNING Program ...
15:34:17:270 : PartID: :0x01
15:34:17:270 : DFU status = 0
15:34:17:270 : DFU State = 5
15:34:17:270 : sending a dfu end of download request
15:34:17:270 : DFU status = 0
15:34:17:271 : DFU State = 7
15:34:22:259 : DFU status = 0
15:34:22:259 : DFU State = 2
15:34:22:259 : sending a set alternate setting request with index: 5
15:34:27:259 : receiving packet
15:34:32:260 : sending a clear status request
15:34:42:262 : an error occured after sending the clear status request
15:34:42:262 : Status: errUNKNOWN, State: dfuERROR
15:34:42:262 : sending a clear status request
15:34:52:263 : an error occured after sending the clear status request
15:34:52:263 : Status: errUNKNOWN, State: dfuERROR
An error message is continuously displayed and the connection with the device is disconnected, and the following error is displayed.
16:18:01:268 : unable to switch the device to dfuIDLE state
16:18:01:268 : Error: an error occured while uploading data from the virtual partition 0xF1
16:18:01:288 : Error: Start operation failed at partition 0x01
16:18:01:312 : Error: TSV flashing service failed
16:18:46:271 : Warning: Connection to device 0x500 is lost
16:19:51:499 : Disconnected from device.
For OTG Device Tree, refer to the following site.
&usbotg_hs{
pinctrl-names = "default", "sleep";
pinctrl-0 = <&usb_otg_hs_pins_mx>;
pinctrl-1 = <&usb_otg_hs_sleep_pins_mx>;
compatible = "st,stm32mp15-hsotg", "snps,dwc2";
phys = <&usbphyc_port1 0>;
phy-names = "usb2-phy";
u-boot,force-b-session-valid ;
dr_mode = "peripheral";
usb-role-switch;
role-switch-default-mode = "peripheral";
status = "okay";
/* USER CODE BEGIN usbotg_hs */
/* USER CODE END usbotg_hs */
};
I would be grateful if you could teach me how to solve this problem.
2023-06-06 02:01 AM
HI @KNam.2
could you double check that the TSV file is conform : https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout
Maybe have a look to https://wiki.st.com/stm32mpu/wiki/How_to_configure_U-Boot_for_your_board#USB_OTG_node
Which USB connector and surrounding HW on your custom board (e.g. Type-C with STUSB1600)
Please share the UART console output log ?
Regards.
2023-06-06 07:34 PM - edited 2023-11-20 03:52 AM
NAND is used, there is no difference compared to the EV board TSV.
And the USB port was used as a test point without using a connector.
Finally, I did a pull-up on UART PA13, but no data is output. I wonder if there is a separate setting to use.
2023-06-07 12:15 AM
It uses NAND flash for storage. Does this happen if there is no communication with the NAND flash?
2023-06-07 12:27 AM
Hi,
At that stage of error (TF-A-usb seems not to answer), you not have yet loaded uBoot, so NAND is not involved as Flash programming is done by uBoot.
Is your console UART set to use UART4_TX on PA13 in TF-A Device Tree ?
PA13 is only useful for BootROM boot fail (when you will boot from Flash, which is not the case here).
In our MP157x-EV1 and MP157x-DK1/2 boards device tree, console is set to use UART4_TX on PG11
I suspect you have TF-A crashing at some point and UART console output could help.
I also recommend reading:
https://community.st.com/s/article/FAQ-STM32MP1-How-to-bring-up-STM32MP1
https://community.st.com/s/article/FAQ-STM32MP1-bring-up-troubleshooting-guide
Regards.
2023-06-09 05:47 AM - edited 2023-11-20 03:52 AM
Thanks PatrickF,
One more question!
I like to know where the TF-A-usb is running, Does it run on system RAM? or DDR.
I can see TF-A is been downloading to somewhere but do not know where.
Actually we are using 32-bit DDR2 RAM and 8x 4G-bit NAND, but MP157x only support 16-biy RAM. Can this be the problem?
Thanks in advance.
2023-06-09 06:59 AM
Hi @KNam.2 ,
TF-A USB is loaded inside SYSRAM as BootROM is not aware of any DDR settings.
Then once TF-A is started (you should start to get console output), it will initialize DDR in order to being able to load uBoot (FIP) at the end of the DDR.
TF-A binary is build using TF-A device tree you should tailor to your board.
please see also : https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout
At that stage, it is not an isue with NAND, but as you have no console output at all, you might have multiple issues:
For DDR settings/tests on a custom board, we strongly recommend using first CubeMX/DDRTools together with DDRFW-UTIL https://wiki.st.com/stm32mpu/wiki/STM32DDRFW-UTIL.
DDRFW-UTIL will be loaded instead of TF-A and allow to run some low level DDR test while allowing to modify default DDR settings in CubeMX.
Btw, I'm not sure your setup of using a 32-bits LPDDR and using only 16-bits could work (at least we did not try it). This will requires clever and custom settings to make it working.
Regards.