This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Programming the upper 512k FLASH of a nrf52840

 Hi, 

I’m new to this dev environment and hoping I may get some help.

I’m building my backup application binary and want to store it in the upper ½ of flash on my nRF52840.

I have not been able to program the upper 512k of a 1M internal flash on a nrf52840 (0x80000 to 0xFFFFF) 

I have confirmed I have a die with 1 Megabyte of internal flash  from reading the FICR.

0x1000110 FLASH  == 0x400  which represents 1 Megabyte

I have no problems writing to the lower 512k, 0x000000 to 0x7FFFF.

I am seeing the same results on my Nordic Dev board which has exactly the same die.

I have been using JLink to erase and program my devices.

Perhaps some clues:

I am loading a binary (.bin) file of my image which is approx 130K in size.

When jlink programs my device using ‘loadbin’ in that area, it always reports ‘Verifying flash   [100%] Done’   but returns an ‘Unspecified error -1’ message.  Programming in the lower 512k is always successful and returns no errors.  Programming from a start address that crosses the 512K boundary produces a successful programming until 0x80000 which is all ff’s. Programming strictly into the upper 512K fails completely.

Jlink ‘verifybin’  reports that memory from 0x80000 and beyond is still 0xff  after programming.

The ACL Enable register (DISABLEINDEBUG) is 0 == ACL enabled in debug mode

I suspected the problem is the ACL.  The ACL registers (ADDR/SIZE/PERM) are all 0x0  but I am also NOT able to modify them either via test code, JLink nor nrfjprog; they always read back 0x00’s.   My code is not writing to these registers.   I saw some posts from others asking if the ACL registers are actually Write-Only (Ie: NOT readable) but have not seen confirmation of this.

Here are the versions of my tools:

  • nrfjprog version: 10.8.0
  • JLinkARM.dll version: 6.72
  • SEGGER J-Link Commander V6.72 (Compiled Apr 28 2020 10:53:07)
  • Newt Version: 1.7.0
  • nRF52840 Die Variant:  ‘0DAA’

Thank you for your help,

    Eric

Parents
  • Hello Eric,

    I was able to replicate this by selecting the wrong nRF52 variant Jlink commander (nrf52832_xxaa instead of nrf52840_xxaa). So please double check that you have indeed selected the correct device in your script. The ACL should not impact programming of the chip as it is enabled by the FW code after reset. You may try nrfjprog to test writes above 512K as well.

    e.g.,

    Best regards,

    Vidar

Reply
  • Hello Eric,

    I was able to replicate this by selecting the wrong nRF52 variant Jlink commander (nrf52832_xxaa instead of nrf52840_xxaa). So please double check that you have indeed selected the correct device in your script. The ACL should not impact programming of the chip as it is enabled by the FW code after reset. You may try nrfjprog to test writes above 512K as well.

    e.g.,

    Best regards,

    Vidar

Children
Related