Skip to main content
Aksl
Associate III
March 17, 2022
Question

Unable to write into LTDC registers

  • March 17, 2022
  • 15 replies
  • 7491 views

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 !

This topic has been closed for replies.

15 replies

Aksl
AkslAuthor
Associate III
March 21, 2022

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

waclawek.jan
Super User
March 21, 2022

I don't know, then, sorry.

JW

Aksl
AkslAuthor
Associate III
March 21, 2022

Thanks for trying to help anyway !

MM..1
Super User
March 21, 2022

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
AkslAuthor
Associate III
March 24, 2022

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.