Skip to main content
Visitor II
August 5, 2025
Question

STM32N6570-DK: LCD flickers when boot from flash

  • August 5, 2025
  • 1 reply
  • 397 views

Hello,

I have an application that shows image from camera from time to time on the screen. This app flashed at 0x7010'0000 and works well when I run FSBL in dev mode from debugger.

But if I flash this FSBL at 0x7000'0000 and switch to flash boot app works in general (according to uart output and ethernet activity) but screen flickers.

Sometimes correct image appears for very short time.

What can cause the problem?

(FSBL is almost unmodified Projects/STM32N6570-DK/Templates/Template_FSBL_XIP)

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    August 5, 2025

    Hello @p5n 

    If your app or framebuffer is in XIP flash, and the cache is not set up for non-cached access, you may see stale or inconsistent data.

    p5nAuthor
    Visitor II
    August 5, 2025

    Do you mean MPU settings? App is in nor flash, framebuffer in PSRAM, I have separate non-cacheable segment in .ld file which is also configured in MPU, but PSRAM is not configured in MPU

     /* create an attribute configuration for the MPU */
     attr_config.Attributes = INNER_OUTER(MPU_WRITE_BACK | MPU_NON_TRANSIENT | MPU_RW_ALLOCATE);
     attr_config.Number = MPU_ATTRIBUTES_NUMBER0;
    
     HAL_MPU_ConfigMemoryAttributes(&attr_config);
    
     /* Create a region associated with memory address 0x70000000 */
     /*Normal memory type, code execution allowed */
     default_config.Enable = MPU_REGION_ENABLE;
     default_config.Number = MPU_REGION_NUMBER0;
     default_config.BaseAddress = 0x70000000;
     default_config.LimitAddress = 0x78000000-1;
     default_config.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
     default_config.AccessPermission = MPU_REGION_ALL_RO;
     default_config.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
     default_config.AttributesIndex = MPU_ATTRIBUTES_NUMBER0;
     HAL_MPU_ConfigRegion(&default_config);
    
     /* create an attribute configuration for the MPU */
     attr_config.Attributes = INNER_OUTER(MPU_NOT_CACHEABLE);
     attr_config.Number = MPU_ATTRIBUTES_NUMBER1;
    
     HAL_MPU_ConfigMemoryAttributes(&attr_config);
    
     /* Create a non cacheable region */
     /*Normal memory type, code execution unallowed */
     default_config.Enable = MPU_REGION_ENABLE;
     default_config.Number = MPU_REGION_NUMBER1;
     default_config.BaseAddress = __NON_CACHEABLE_SECTION_BEGIN;
     default_config.LimitAddress = __NON_CACHEABLE_SECTION_END;
     default_config.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
     default_config.AccessPermission = MPU_REGION_ALL_RW;
     default_config.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
     default_config.AttributesIndex = MPU_ATTRIBUTES_NUMBER1;
     HAL_MPU_ConfigRegion(&default_config);

     

    Technical Moderator
    August 6, 2025

    Hello @p5n 

    it's always better to have PSRAM area declared as executable Never.