Wednesday, January 24th 2018, 4:51am UTC+1

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.

FocusPaul

Beginner

Date of registration: Apr 4th 2012

Posts: 5

Location: Germany

1

Friday, November 14th 2014, 11:20am

Flash the GPNVM bits using Segger software (Atmel Cortex-M3)

Hello!

I'm trying to find a way to change the GPNVM bits of the Atmel Cortex-M3 chip AT91SAM3X.

Is is possible to do this with J-Flash/J-Link Commander software? (using a J-Link Pro).

Thank you,
Paule

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,516

2

Tuesday, November 18th 2014, 11:36pm

Hi Paule,

In general, this is possible.
This can be done via a relatively simple sequence of memory commands.
Could you please let me know which GPNVM bit you want to modify?
I will then check, if we can provide some sample code short term.


- Alex

FocusPaul

Beginner

Date of registration: Apr 4th 2012

Posts: 5

Location: Germany

3

Thursday, November 20th 2014, 7:20am

Hello Alex,

I'd like to re-program _all_ GPNVM bits on SAM3X8E (please see ch. 9.3.1.10 in PDF description on atmel page: http://www.atmel.com/Images/doc11057.pdf).

If you would be so kind to give me an example on one of those bits, I'm sure I'll be able to use this example for other bits.

Thank you for your help,

Paule

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,516

4

Thursday, November 20th 2014, 10:42am

Hi,

Via Commander:
Sample code for setting GPNVM bit 1 which is BMS => Boot from flash (1) or internal ROM (0)

C/C++ Source code

1
2
3
4
5
6
7
8
// FlashRegFCR = 0x400E0A04;
// FlashRegFSR = 0x400E0A08;
// FlashRegFRR = 0x400E0A0C;

// Set GPNVM bit to "boot from flash" (0x5A << 24) | (GPNVMBitNo << 8) | (Cmd_SetGPNVMBit << 0)
w4 0x400E0A04, 0x5A00010B
// Wait until bit has been programmed
sleep 20


via J-Flash: Can be done by WriteU32 + Delay instructions in the Init / Exit steps that can be found at Options -> Project Settings -> CPU

If you need an optimized version which does not use fixed delays but reads the status etc.,
we recommend to get the J-Link SDK and write your own small application with it.


Best regards
Alex