How do I build a solid understanding of how to develop STM32xxx applications?
I've been slowly learning how to develop apps using STM32L4R9 and STM32F4xx MCUs. I just went through a really painful experience trying to develop an app that talks to a UART device and logs data to the SD card on the STM32L4R9-Discovery board that reinforces the fact I just don't know enough of the basics. Using VisualGDB and/or STM32CubeIDE, I have successfully written polled, interrupt and DMA UART apps based on various example I found on the web using HAL. I was also able to get the STM32 CubeMX FatFs_uSD_Standalone example working in a separate app. But it took 4 hours to combine a UART app and the SD app into one app that could get data from a UART connected device and log it to the SD card. I had 2 fundamental problems. 1) Finding all the right .h and .c files and including them in the right places. 2) figuring out how to initialize all the clocks, the UART and the SD interface so they didn't interfere with each other. Even though I got it working, I still don't feel like I have the basic background knowledge I need. I don't mind putting in the time to build up this background but I haven't found an effective process yet.
So my basic question is how do I, and how did you experts, build up the basic knowledge so getting the infrastructure of a new app up and running isn't so painful and I can concentrate on programming the actual functionality the app needs? Books, classes, consultants, or is it really just this painful?