Monday, October 23rd 2017, 10:36pm 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.

si.s

Beginner

Date of registration: Dec 11th 2015

Posts: 1

1

Monday, February 8th 2016, 11:19am

[SOLVED] Preventing J-Link to flash all the MCU flash pages while debugging

I am using J-Link to program and debug my MCU unit,
I want the last two pages of the STM32F334 MCU to be used for storing and updating users settings , they users can update and change the settings and the MCU should keep them when it is not powered.

For my debugging and testing purpose I am using J-link to test and debug the MCU code, and despite the fact that I implicitly mentioned in the linker file the code flash origin and its size as
rom (rx) : ORIGIN = 0x08000000, LENGTH = 0x0000f000 every time I debug with J-Link it will zeros and destroys those flash pages that are used for storing the user settings.

How can I implicitly (command line argument) prevent the J-Link to write over certain flash address [In my case Range:0x0800F000-0x0800FFFF --> Two 2K pages should not be altered by J-Link]

which option fields in the following eclipse J-Link debugger configuration should be modified.
Note: I can not write protect those flash pages since the MCU firmware must store the user's parameters in those pages during test+debug.
Thanks :(
si.s has attached the following images:
  • J-link_fp1.jpg
  • J-link_fp2.jpg

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,514

2

Tuesday, February 9th 2016, 9:04am

Hi,

J-Link only touches the flash pages that are written by the debugger (here Eclipse + GDB).
If they are zeroed it means Eclipse is downloading zeroes to this region.
Sounds like your linker file is not correct.

You should specify the section as "NOLOAD" in your linker file if you do not want Eclipse / GDB to load it on debug session start:
ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9…node/ld_21.html


Best regards
Alex