2020-11-09 02:40 AM
Is it possible to boot over UART on the STM32MP157C-DK2?
I set the BOOT pins as following:
BOOT0 - OFF
BOOT1 - OFF
I am using the FT232 UART-USB Adapter and have connected the following pins:
Here is the CubeProgrammer command and its output:
´´´
$ STM32_Programmer_CLI -c port=/dev/ttyUSB0
-------------------------------------------------------------------
STM32CubeProgrammer v2.5.0
-------------------------------------------------------------------
Serial Port /dev/ttyUSB0 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
stop-bit = 1,0, flow-control = off
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
´´´
Am I doing something wrong?
Regards,
Aleksandar
2020-11-09 03:02 AM
The chosen pin should be in the short list of UART pins available for boot. Those used here are not in this list.
See pin list on https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_code_overview#UART_Boot
Btw, DK2 could directly be used in UART boot on UART4 when using USB cable connected on STLINK port (CN11).
Note that currently 'single' UART boot is limited to load TF-A then uBoot only. No flashing is currently possible (need some uBoot changes to avoid conflict with uBoot Console). Stay tuned for a new ecosystem release soon.
2020-11-09 06:00 AM
Hello Patrick,
thanks for the answer. I have changed to the following pins (GPIO expansion connector).
According to the link you sent me, the pins PB12 and PB10 should be available for serial boot (USART3). However, the output from the CubeProgrammer is the same. Any thoughts?
2020-11-09 06:11 AM
That's should be ok.
With only USB supply and USART3 connected (USB device not connected), you should have LD6 red led blinking fast.
Then red led should stop blinking when CubeProgrammer connect to the DK2.
Check you are using the right /dev/tty port.
2020-11-09 06:23 AM
Hi Patrick,
No USB device connected, just USART3 and the USB supply. The LED6 is blinking but also LED4 (with lower frequency than LED6).
I am using the right /dev/tty port (here the output of CubeProgrammer).
$ STM32_Programmer_CLI -l uart
-------------------------------------------------------------------
STM32CubeProgrammer v2.5.0
-------------------------------------------------------------------
===== UART Interface =====
Total number of serial ports available: 1
Port: ttyUSB0
Location: /dev/ttyUSB0
Description: FT232R USB UART
Manufacturer: FTDI
However the error is still there.
2020-11-09 06:34 AM
Maybe add a pull-up on USART3_TX (e.g. 10K). Until the BootROM detected the right activity on USART3_RX, the related TX is open, and this floating signal might create wrong detection of first character on your FTDI interface.
Another debug step is then to check the activity on the pins.
2020-11-09 11:36 PM
The CubeProgrammer is sending out the correct data (0x7F), however no response from the CPU. Also when the board is booting from the SD card (it boots successfully), there is no boot output on USART3. Is it okay or I should see the boot output?
Regards
2020-11-10 01:05 AM
Hi,
in SD-Card boot, there is nothing expected on USART3.
In your trials using USART3, did you see LD6 red led stop toggling ?
After the fail, without resetting the board, could you try to use (need OpenSTLinux v2.0.0 SDK), with ST-Link connected (need to be connected before the trials to avoid unwanted board reset)
PC$ ./openocd -f board/stm32mp15x_dk2.cfg -c 'init;cortex_a smp off;halt;dump_image traces.bin 0x2ffc1c00 2048;resume;shutdown'
and analyze the trace.bin generated using https://wiki.st.com/stm32mpu/wiki/STM32MP15_ROM_trace_analyzer
Regards,
Patrick
2020-11-11 01:50 AM
Hello Patrick,
I have used the following setup for the ROM trace:
Here is the first command (STM32CubeProgrammer):
´´´
PC$ STM32_Programmer_CLI -c port=/dev/ttyUSB0
-------------------------------------------------------------------
STM32CubeProgrammer v2.5.0
-------------------------------------------------------------------
Serial Port /dev/ttyUSB0 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
stop-bit = 1,0, flow-control = off
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
´´´
And here is the ROM trace.
´´´
PC$ python3 rom-trace-analyzer.py traces.bin
< @ 00007461 | [INFO] - BOOTCORE_BootRomMaskVer ( 0x00000000 ) >
< @ 00008741 | [INFO] - BOOTCORE_BootRomVer ( 0x0000020E ) >
< @ 00009910 | [INFO] - BOOTCORE_FreezeIWDG12Clocks >
< @ 00011322 | [INFO] - BOOTCORE_HwResetPOR >
< @ 00022772 | [INFO] - BOOTCORE_ChipModeSecOpen >
< @ 00025143 | [INFO] - BOOTCORE_LogicalResetSystem >
< @ 00026910 | [INFO] - BOOTCORE_BootActionColdBootProcess >
< @ 00084001 | [INFO] - BOOTCORE_BootCfgOtpWordValue ( 0x00000000, 0x00000000 ) >
< @ 00085445 | [INFO] - BOOTCORE_BootPinsFirstSelSerial >
< @ 00086529 | [INFO] - BOOTCORE_OtpPrimarySrcForceNothing >
< @ 00087594 | [INFO] - BOOTCORE_OtpSecondarySrcForceNothing >
< @ 00088566 | [INFO] - BOOTCORE_BootPinsOverridesOtp ( 0x00000001 ) >
< @ 00089791 | [INFO] - BOOTCORE_OtpBootSrcDisableMaskVal ( 0x00000000 ) >
< @ 00090922 | [INFO] - BOOTCORE_OtpBootUartInstanceDisableMaskVal ( 0x00000000 ) >
< @ 00093245 | [INFO] - BOOTCORE_BootCfgAfmuxOtpWord1Value ( 0x00000000 ) >
< @ 00094603 | [INFO] - BOOTCORE_BootCfgAfmuxOtpWord2Value ( 0x00000000 ) >
< @ 00096023 | [INFO] - BOOTCORE_BootCfgAfmuxOtpWord3Value ( 0x00000000 ) >
< @ 00097513 | [INFO] - BOOTCORE_BootCfgHseValue ( 0x00000000 ) >
< @ 00100490 | [INFO] - BOOTCORE_EnabledSrcMaskVal ( 0x00000640 ) >
< @ 00101845 | [INFO] - BOOTCORE_BootModeNOBOOTCSTANDBY >
< @ 00640349 | [INFO] - BOOTCORE_StartupWaitTime ( 0x00002700 ) >
< @ 00641914 | [INFO] - BOOTCORE_ReOpenDebugValue ( 0x00000000 ) >
< @ 00644147 | [INFO] - BOOTCORE_Pll12StartNotDisabledByOtpBit >
< @ 00646177 | [INFO] - BOOTCORE_Pll1Started >
< @ 00650163 | [INFO] - BOOTCORE_Pll1Locked >
< @ 00651537 | [INFO] - BOOTCORE_Pll2Started >
< @ 00656089 | [INFO] - BOOTCORE_Pll2Locked >
< @ 00657674 | [INFO] - BOOTCORE_CkMpuSsSwitchedOnPll1 >
< @ 00659154 | [INFO] - BOOTCORE_CkAxiSsSwitchedOnPll2 >
< @ 00659735 | [INFO] - BOOTCORE_Pll12StartReqStatusPllStarted >
< @ 00674539 | [INFO] - BOOTCORE_HseDigBypassDetected >
< @ 00679998 | [INFO] - BOOTCORE_HseFrequencyDetected ( 0x00000018 ) >
< @ 00680419 | [INFO] - USB_Init >
< @ 00750893 | [INFO] - BOOTCORE_PllUsbLocked >
< @ 04342328 | [INFO] - UART_PeripheralSerialBootLoopStart >
´´´
The weird thing I found is the last output, UART_PeripheralSerialBootLoopStart, it seems as the serial boot has started but cannot connect to the UART?
PS:
Regards
2020-11-12 12:00 AM
Hi,
is present because of enumeration of USB DFU port (when you plan to use CubeProgrammer on the usbX).
is present because UART4 is used by ST-Link when you use CubeProgrammer on the ST-Link related /dev/ttyXXX.
LD6 should stop blinking.
It should work similarly with other UARTs, and so for USART3 PB10/PB12 pins. Did you check adding a pull-up on USART3_TX line ?
Regards.