2019-02-22 11:12 AM
I have a custom board based on STM32H753. It has SDRAM, SD card slot, a couple of I2C peripherals, some GPIOs going to LEDs and a handful more that go to CPLDs which interface to another part of the system.
I am not using generated HAL code or CubeMX or any of that. I'm going straight from the register specs. I'm trying to port some existing software to my board and don't want to pull in any more frameworks or third party code.
I'm having a hard time getting anything to work at all. First with I2C, I've brought up the peripherals, all seems to be good, but I don't get any movement on the IOs. I figured I was being dumb, so after burning a couple of days tearing my hair out, I set them up as GPIOs, hacked some bit-bang code together and had a working solution. Works well enough to move on for now.
Next, on to the SD card. Again, same issue. Everything is set up as far as I can tell. Nice, stable 250KHz clock out of the SD CK, but not a peep from CMD or any Dn line for any command issued with or without a card in the slot. GPIO is set up as AFR, clocks are on, power is on, everything internally seems fine. Writing to SDMMC_CMDR, the value takes, and after a short time, CPSM clears, but there's no externally visible sign of action. Again, setting the pins to GPIO and wiggling the pins with the CPU shows a nice, clean signal at the card slot. This is not a board or connectivity problem.
I'm using SDMMC1 with CMD as AF12 on PD2, D0-D3 as AF12 on PC8-11 and CK on PC12. Again, CK seems to be working.
At this point, I figure the problem is with me. I'm clearly being brain dead. At least I know enough to ask for help when I need it. I'm sure there's something I've missed.
FWIW, I did get FMC in muxed mode working with the CPLD, and a PWM output for a nice dimmable LED. If nothing else, I have an expensive night light.
Any obvious stuff that I should be looking at?
Cheers.
2019-02-22 11:40 AM
>>I am not using generated HAL code or CubeMX or any of that. I'm going straight from the register specs....
That's some Iron Man Uphill Skiing right there...
Not a huge fan of the HAL, but at least starting with it at top of the mountain I have gravity working for me rather than against me. Use the working examples as a secondary reference to the Reference Manual, and triangulate to the register implementation from there.