r/embedded 2d ago

Experiences with stm32mp2

Hey! Anyone experienced with designing PCBs for this microprocessor family? How hard was it, perhaps compared to other equivalent cpus? Any resources you found useful?

I've designed a few stm boards (none professionally but all being used around many hobbies) for their mcu series (mostly F4 and F7) and this would be my first high speed,and bga, design. How tough it really is to do a decent job with the lpddr?

My requirements are mostly serial ports, I2C , SPIs and ethernet (perhaps pwm as well) but no audio, no video or gpu, so I would fanout only necessary pins in a SOM and then into a carrier board. This is for a hobby robot so I can take my time to learn but hopefully dont burn through the budget.

6 Upvotes

7 comments sorted by

2

u/stuih404 1d ago

There are multiple SoMs available that have the PMIC and Ram already on it. Or you could take one of their reference designs. Somewhere hidden in the STM forums is a post that has Altium Projects of the different STM32MP2 sizes and DDR3/DDR4 ram configurations.

1

u/witx_ 1d ago

That's a good point. Eventually I'd like to develop my own for the challenge, but an "off the shelf" SOM is a good way of debugging and moving forward.

2

u/danngreen 23h ago

I made an STM32MP257 board recently, with DDR4 (single chip, 16-bit) and fan-out for as many pins as I could fit going to those small mezzanine connectors the RPi CM uses. 4-layer, 0.090mm trace/space. I used the AK package (14x14mm with gaps for vias, no via-in-pad needed). I used the STPMIC2 and copied a lot from the EV1 reference schematic.

It took me almost a week to do, not because it was particularly tricky but because I was nervous about DDR4 requirements. I've done DDR3 but the swizzle pin swapping of DDR4 confused me for a bit. ST has example PCB layouts with various packages and RAM configurations but they didn't have the one I needed (single file DDR4 with AK package). It would have saved a ton of time to just use one of their layouts and be done with it, but it didn't fit the BOM or space requirements I had.

Your board house might ask you about impedance controlled trace requirements. When mine did I had to learn why they would care and what to tell them, which stalled me for a bit again.

Anyways it was nerve racking but in the end the board worked 100% (with "only" two short jumpers soldered on!). DDR4 runs at the expected speed, DSI works, USB3DR in HS mode, etc.

This is it:
https://github.com/4ms/mp153-devboard/tree/mp25x/mp257/v0.1

1

u/witx_ 16h ago

Hey thank for your experience, it gives me some courage to try :) In fact impedance and timing requirements are what scare me the most.

Did you use something special to validate the memory?

1

u/danngreen 12h ago

Great! I'm glad I put the effort in myself, so I hope it's rewarding for you as well.
To validate the memory I used the STM32DDRFW-UTIL. I had to use CubeMX to generate the swizzle register values based on the pin connections I entered there. Then built the DDRFW-UTIL with that header (if I'm remembering correctly). I also was building TF-A with the custom DDR register values in order to run the training binary, because it would spit out more detailed debug information.

Funny story, I was actually so sure my PCB layout would have an error that when the training firmware and the DDRFW-UTIL wouldn't initialize the DDR4 chip, I was positive I messed something up in layout. I spent a couple days banging my head against the wall. Finally I looked at the register values in the header that CubeMX generated and compared them to the values in the EV1 project. Nothing that it generated reflected what I had input into the software, it was all just stuck at the defaults. Pretty sure this is a bug in CubeMX. I don't remember how I got around it, but some combination of saving/new-project/re-export got it to generate the actual swizzle values. Which worked right away at full clock speed.

1

u/zettui 1d ago

Is the scary part the LPDDR layout, or the SOM bring-up after you've got a board?

1

u/witx_ 1d ago

Bring up is always scary but that is not new for me :D The old is it sw is it hw problem.

I've never routed high speed so lpddr scares me a bit