2024-11-10 07:04 PM
Hello awesome people of the STM community!
I'm working on a GUI project for the STM32H750B-DK, currently following the board bring up steps. I know that I could just use the generated code by TouchGFX template for the STM32H750B-DK. However, I have a few reasons for avoiding this:
Bellow is my process so far
This was copied from the TouchGFX Generated .ioc so i would not expect any problems here, I think the only thing I changed was the layer background color. However, the datasheet for the display driver OTA5180A has slightly different values for the timings in section 10.1.1, or am I miss reading something? Most notably the horizontal back porch is set to 3 while the minimum specified in the datasheet is 8. So I'm not sure I understand the functions of these values or how they are calculated, all I think I know is they have some effect on the frame rate. Then in the firmware I add all appropriate code as listed in the TouchGFX board bring up documentation.
However, the screen stays white, don't even get the background color, I have used CLions memory viewer to make sure that the frame buffer is getting filled which it is. So my best guess is that the LTDC pointer to the framebuffer it is not getting set correctlly but I'm unsure how to check this or fix it. As I mentioned above I'm also getting some strange framerates.
Problem #2
Having been stuck with problem #1 for a few hours I decided to to try load the frame buffer in external RAM, that also did not work. I have an even smaller understanding of the FMC then the LTDC. I set it up with the values used in the GFX generated .ioc plus set up the block in the memory management tool but my debugger was unable to access the location, nor was code able to interact with the memory location without a hard fault.
My guess here is timing issues so I had a look at the datasheet (IS42S32400J-6B) and MX example, the only thing that stood out to me was that the Write Recovery timings were different, but in a way that cubeMX says is incorrect.
CubeMX says that RowCycleDelay - RowToColumnDelay - RowPrechargeDelay <= WriteRecoveryTime, however the example provided by CubeMX does not respect that, unless I've made a mistake somewhere? I've looked at the timings in datasheet for the IS42S32400J-6B. Those timings confused me even more, I'm unsure what some of the timing parameters are because they use slightly different names.
2024-11-10 10:05 PM
Hey Michael,
As a relatively new engineer myself (3 years) I spent countless hours learning how to do it on my own from scratch and I have a YouTube channel on doing everything at the register level. I will tell you that if I could go back in time and instead learn how to use the tools available to me, not reinventing the wheel, not favoring any toolchain, and learning how to write good firmware and application code, I would do it in a heart beat.
When I got my first job it wasn't up to me to decide what IDE we use for the project, its the boss's call. I had to play catch up really fast because all I knew was how to make things from scratch. I did not know how to work with other engineers code and projects, because you will hardly be in a situation where the company has zero code base and zero of the project done, its always building off of their own previous work and existing code base. Learning how to read others code and gracefully implement your changes in to theirs is a much more useful skill.
Some companies use IAR because it comes with many certifications, for them that means they do not have to jump through hoops to get their code certified.
Some use STM32CubeIDE because it is what we officially support and I had to do the same to be inline with my colleagues and commit to the common code base.
Companies want to make money and time to market is critical, doing things from scratch does not help that cause.
Out of the many customers I support everyone one of them starts their project from a working example and builds on it.
And yes there are circumstances when you will have to do a TouchGFX board bring up from scratch, but staying inline as close as possible with what the chip vendor supports (STM32CubeIDE/IAR) will always get you faster support, and for companies support is also critical.
As for the settings in CubeMX I would obviously suggest sticking to what we know works and was tested, save yourself the time of trying to test why the datasheet numbers might not be the best option or maybe are wrong, or maybe there is an errata, or the calculations are not as straightforward as plugging in datasheet values.
I suggest looking at simpler examples in the Repository folder of your installation for guidance.
and I highly encourage the use of FreeRTOS with TouchGFX.
I have planned an upcoming video series here for ST on board bring up but its on the backburner for now, low bandwidth on my day to day.
Remember we are ALL standing on the shoulders of giants before us and there is no shame in that.
Regards,
Eddie