Sunday, May 20th 2018, 5:35pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

bearsh

Beginner

Date of registration: May 31st 2017

Posts: 11

1

Monday, May 14th 2018, 11:56am

[SOLVED] Ozone: Memory View: When deleting flash on the device, content doesn't change if region contains a const variable

I have the following situation:
  • a dedicated region in the linker script for configuration.

    Source code

    1
    2
    3
    4
    5
    6
    7
    8
    
    ...
    m_config            (RX)  : ORIGIN = 0x00007C00, LENGTH = 0x00000400
    ...
      .config :
      {
        __CONFIG_A_START = .;
        KEEP (*(.config*))
      } > m_config

  • declared and initialized const variable in this region

    C/C++ Source code

    1
    2
    
    __attribute__((section(".config"),aligned(4)))
    const uint8_t config[CONFIG_LENGTH] = { 0 };

  • a function deleting and reprogramming the config region at runtime

when stepping through the code, the memory view doesn't change when the device performs an erase on the associated flash sector, but it changes if I also delete another sector which doesn't contain such variables.
For me it seems Ozone always displays the content it reads in the elf file.

Thanks

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Monday, May 14th 2018, 3:29pm

Hello,

Thank you for your inquiry.
J-Link generally caches Flash contents due to performance reasons as it is usually not expected that ROM content would change during run time.
However in some cases as yours it is needed for debugging.
For this reason exec command ExcludeFlashCacheRange has been implemented. More information about this command can be found in the J-Link user manual.
To execute it in Ozone action Exec.Command can be used which is described in the Ozone user manual.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


bearsh

Beginner

Date of registration: May 31st 2017

Posts: 11

3

Monday, May 14th 2018, 4:29pm

Thanks Nino, that works!

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

4

Tuesday, May 15th 2018, 11:37am

Hi,

Great to hear that you are up and running again.
We will consider this thread as solved now.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/