Skip to main content
Visitor II
December 5, 2023
Question

Running into restricted memory issues with STM32H742VIT6?

  • December 5, 2023
  • 2 replies
  • 2298 views

Hello,

I'm having issues with software behaving inconsistently and freezing when I add certain lines, try to access certain variables, etc.  I suspect maybe it has something to do with the restricted flash regions in the MCU.  Is there any way around this?  Can I "democratize" the whole flash and eliminate all of these restrictions somehow?

Here are my ROM/RAM settings in my project in Keil, if it is helpful for answering my question: options_target.png

Thanks to anyone who can help make my project compile and run according to my actual code!
-Brian

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    December 5, 2023

    Hi @briankaz ,

    Which version of Keil do you use?

    I think that the issue is due to breakpoints. 

    Could you please try to disable this behavior by following the instructions provided  here.

    I hope this help you.

    Kaouthar

    briankazAuthor
    Visitor II
    December 5, 2023

    Hello, I am using Keil uVision V5.29.0.0.

    I am confused about how to use this SBC command.  Do I include it somewhere in the target settings for the project?  Or write it at the top of main.c?

    Thanks,
    -Brian

     

    Technical Moderator
    December 5, 2023

    Hi @briankaz ,

    For Flash example: SBC 0x08000000, 0x0807FFFF, 0 // Disable usage of SW Breakpoints for the address range.

    This command should be added to an INI file and configured for inclusion in the "Options for Target" dialog in the Debugger tab.

    Please take a look to this post.

    Thank you.

    Kaouthar

    Technical Moderator
    December 5, 2023

    Hello @briankaz ,

    What do you mean by "the restricted flash regions in the MCU" ? which regions you are referring to? and what are you trying to do?

    briankazAuthor
    Visitor II
    December 5, 2023

    Hello,

    I am referring to this in the reference manual:
    "Flash memory enhanced protections, activated by option bytes
    – Read protection (RDP), preventing unauthorized Flash memory dump to safeguard sensitive application code
    – Write-protection of sectors (WRPS), available per bank (128 Kbyte sectors)
    – Two proprietary code readout protection (PCROP) areas (one per user Flash bank). When enabled, this area is execute-only.
    – Two secure-only areas (one per user Flash bank). When enabled this area is accessible only if the STM32 microcontroller operates in Secure access mode."
    Maybe this doesn't apply to me since I didn't activate any option bytes...
    I'm also a bit confused about where these RAM address settings come from in the project settings:

    IRAM1: Start 0x20000000 Size 0x20000
    IRAM2: Start 0x24000000 Size 0x80000
    I meant maybe the MCU is sometimes trying to write/read RAM where it's not allowed?
    Thanks!
    -Brian