2022-03-17 06:53 AM
Hello everyone,
I've been trying to integrate a simple TouchGFX project into STM32CubeIDE (so that I can add my own code to it), it's supposed to print simple graphics on the screen of a STM32L4R9I-EVAL board, but I stumbled upon an issue in the LDTC initialization : I can't write the LTDC configuration in the correct registers. In HAL_LTDC_Init, the LTDC registers are supposed to be initialized with parameters (e.g. the display size goes in AWCR), but when monitoring them through the debugger's memory monitor at address 0x40016800, I only see zeros... Note that earlier it was all 0x2220, I have no idea why it changed. Also, I can see that other peripherals don't have this issue because there are non-zero bytes near address 0x40000000 (the start of memory-mapped peripherals).
I attach 3 screenshots at different points in the program's execution (using breakpoints), to show that the value of register AWCR does not change despite being written into. Plus 2 screenshots showing the memory monitor.
This is the code generated by CubeMX, I have not modified it. I also attach the full project. I created it from STM32CubeIDE as a C++ project. The CubeMX configuration is copied from the TouchGFX project, so they are identical.
Any help will be appreciated !
2022-03-21 04:20 AM
> not change anything to the state of the LTDC registers (nor RCC)
If RCC_APB2RSTR.LTDCRST is still 1, it's still the source of your problem, wherever it comes from.
JW
2022-03-21 06:20 AM
It is not 1 anymore. Sorry I forgot to mention that ^^
2022-03-21 08:00 AM
I don't know, then, sorry.
JW
2022-03-21 08:01 AM
Thanks for trying to help anyway !
2022-03-21 12:09 PM
Try start new project and use only cube generated LTDC init as first test.
Steps for CUbeIDE:
2022-03-24 02:47 AM
I folled your steps, and indeed the LTDC registers were properly initialized.
Si I started adapting the CubeMX config to the one of the project, to see at which point it starts malfunctionning : It seems to work fine until I try to integrate TouchGFX.
However I can't figure out how I had integrated TouchGFX last time, it's so intricate I can't make it compile... But I guess the problem arose from TouchGFX the first time too.