cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257D custom board DDR4 bring-up: read training failure after CA/RxEn/WL pass

sergei.poselenov
Associate II

Hello all,

We are bringing up DDR4 memory on a custom STM32MP257D-based SOM. We have made significant progress but are now blocked on a specific PHY training failure that we cannot diagnose without access to the Synopsys PHY firmware streaming message documentation. We would appreciate any help interpreting the failure and identifying the root cause.

Board Overview

  • SoC: STM32MP257DAK3 (VFBGA424)
  • DRAM: 2× Alliance AS4C512M16D4A-62BIN (DDR4-3200, 8 Gbit × 16, 1.2V, VPP 2.5V)
  • Topology: 32-bit bus, 2 GB total, single rank, soldered down
  • PMIC: STPMIC25APQR (I²C7)
  • Reference HSE: 40 MHz crystal
  • Tool chain: STM32CubeMX 6.16.1, STM32CubeIDE 2.0.0, STM32DDRFW-UTIL, STM32CubeProgrammer 2.22

    Bring-up Status

    We are using STM32DDRFW-UTIL with verbose PHY messaging enabled (hdtctrl = 0x05, custom g_waitfwdone.c patched to decode major messages and dump streaming messages).

    Power Rails (all verified by HW measurement)

    • VDD_DDR: 1.20 V :white_heavy_check_mark:
    • VTT_DDR: 0.60 V :white_heavy_check_mark:
    • VREF_DDR: 0.60 V :white_heavy_check_mark:
    • VPP_DDR: 2.49 V :white_heavy_check_mark: (Note: ST BSP code uses 0x1E for LDO5 which produces 2.39 V; we changed to 0x20 to get 2.5 V per JEDEC spec)
    • VDDA18DDR / V1V8: 1.80 V :white_heavy_check_mark:

    Clock Configuration (matches STM32MP257F-DK reference)

    • HSE → PLL2: FBDIV=30, FREFDIV=1, POSTDIV1=1, POSTDIV2=2
    • PLL2 output = 600 MHz → MEMCLK = 1200 MHz (DDR4-2400 data rate)

    Software Configuration

    • STM32MP_DDR4_TYPE=1 in build
    • DDR controller registers (DDRC, ADDRMAP, DRAMTMG, DFITMG, INIT) match the EV1 reference template, with the expected ADDRMAP7 difference accounting for our 8 Gbit chip density vs EV1's 16 Gbit
    • All UIB/UIA/UIM PHY user input parameters match the EV1 reference values
    • UIS_SWIZZLE values match the mainline stm32mp2xx-ddr4-2x16Gbits-2x16bits-1200MHz.h template

    Initialization Sequence Progress (PHY firmware messages)

    Step 0 (DDR_RESET) and Step 1 (DDR_CTRL_INIT_DONE) complete successfully. During Step 2 (DDR_PHY_INIT_DONE), the PHY firmware reports:

[PHY-MSG] 0x00 - end of CA training              ✅
[PHY-MSG] 0x02 - end of read enable training     ✅
[PHY-MSG] 0x01 - end of write leveling coarse delay ✅
[PHY-STREAM] header=0x00470002, len=2            (RxClkDly_Tg0, msg[0]=msg[1]=0)
[PHY-STREAM] header=0x04020000, len=0            ← failure
[PHY-MSG] 0xFF - TRAINING FAILED​

We measured that DDR_RESETN goes high during step 3, confirming the PHY firmware is functional up to this point.

Key Observations

  1. We tested at both MEMCLK = 1200 MHz and MEMCLK = 800 MHz (via POSTDIV2=2 vs POSTDIV2=3 + regenerated config). The training fails at the identical point with identical error code at both frequencies. This appears to rule out signal integrity as the cause.
  2. CA training (msg 0x00), Read Enable training (msg 0x02), and Write Leveling coarse delay (msg 0x01) all complete successfully, suggesting the basic bus connectivity and clock/strobe alignment are good.
  3. The failure is in what appears to be the next training stage (DQS gate / Read DQ training).
  4. The PCB has a byte-lane swap on U7 (SoC byte 2 routes to U7 upper byte, byte 3 routes to U7 lower byte). Per ST community guidance, this should be transparent to DDR4 training, but we mention it for completeness.
  5. HW cannot perform continuity tests on DQ lines (all routed on internal PCB layers between BGA packages) and cannot scope the DDR clock (>600 MHz exceeds available equipment).

    Questions:

    1. What is the meaning of PHY streaming message ID 0x0402 (header=0x04020000)? We'd like to see the Synopsys DDR5/4 PHY Training Firmware Application Note's decoding for this code to understand which sub-step of which training stage failed.
    2. What is the meaning of the streaming message header=0x00470002 with both data values = 0 that immediately precedes the failure? Is this an expected intermediate result or already an error indication?
    3. Are there known issues or required PHY parameter overrides for the STM32MP257D in the VFBGA424 package using DDR4 32-bit topology with 2× 8 Gbit chips at MEMCLK = 1200 MHz?
    4. Are there specific recommended values for any of the following parameters that we may not have set correctly?
      • TRAIN2D (currently 0)
      • HARDMACROVER (currently 3)
      • DRAMBYTESWAP (currently 0 — though our PCB has byte swap on the second DRAM chip)
    5. Could the documented CubeMX 6.16.1 DDR_UIS_SWIZZLE reload bug affect DQ training behavior on DDR4, or is it strictly limited to the CA path (HwtSwizzle + DDR34_AC_SWIZZLE)?

    I'm attaching full UART boot logs for MEMCLK=1200MHz and 800MHz, generated stm32mp25-mx.dtsi (for 1200MHz).


    Regards,
    Sergei
1 REPLY 1
PatrickF
ST Employee

Hi @sergei.poselenov 

could you share you schematics (all DDR4 to STM32MP25 connections and surrounding components) ?

This might higlight issues Vs recommendation in AN5489.

According to provided .dtsi, your DDR4 connections are :

DDR4 case
STM32MP2 pin name Output signal
DDR_A0 CKE0 (CKE)
DDR_A1 -
DDR_A2 CS0N (CS_n)
DDR_A3 ODT0 (ODT)
DDR_A4 CLKP (CK_t)
DDR_A5 CLKN (CK_c)
DDR_A6 -
DDR_A7 -
DDR_A8 A3
DDR_A9 BA1
DDR_A10 A12 / BC_n
DDR_A11 RAS_n / A16 (DDR4)
DDR_A12 A6
DDR_A13 A0
DDR_A14 A2
DDR_A15 A8
DDR_A16 -
DDR_A17 ACT_n (DDR4 only)
DDR_A18 BG0 (DDR4 only)
DDR_A19 -
DDR_A20 WE_n / A14 (DDR4)
DDR_A21 BA0
DDR_A22 A4
DDR_A23 A10 / AP
DDR_A24 -
DDR_A25 A13
DDR_A26 A5
DDR_A27 A9
DDR_A28 A11
DDR_A29 A7
DDR_A30 CAS_n / A15 (DDR4)
DDR_A31 A1

 

Regards,

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Tip of the day: Try Sidekick STM32 AI agent, see here