cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to write into LTDC registers

Aksl
Associate III

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 !

15 REPLIES 15

> 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

Aksl
Associate III

It is not 1 anymore. Sorry I forgot to mention that ^^

I don't know, then, sorry.

JW

Thanks for trying to help anyway !

MM..1
Chief II

Try start new project and use only cube generated LTDC init as first test.

Steps for CUbeIDE:

  1. add new STM project
  2. in wizard choice your MCU on custom board or in board selection
  3. in MCU config wizard choice CLOCK config properly
  4. enable peripherals ...
  5. close IOC and generate code
  6. build and test
Aksl
Associate III

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.