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

Flashing NRF51822 with S130 and (almost) complete SDK

We're using the NRF51822 and the S130 with V9.0 SDK, and we're using most of the features of the SDK for our Firmware; but I'm running into a problem flashing the device on the Keil IDE.

We're able to flash both the S130 to the device and the Firmware to the device using our GCC toolchain, but not Keil. When I attempt to, I receive this error:

nrfjprog.exe --program "Y:\src\myco-firmware\Objects\firm_s130.HEX" --verify Parsing hex file. Reading flash area to program to guarantee it is erased. ERROR: The area to write is not erased.

Using the information from this Nordic Question, I set the following:

IROM1 Start: 0x1C0000  (selected as Start up)
IROM1 Size: 0x24000

IRAM1 Start: 0x20002800
IRAM1 Size 0x1800

image description

What are the correct settings? I'd like to flash it via the Keil so I can step into it (since running the S130 with old firmware (that is known good off of SDK V7.0) or the new firmware (ported to SDK 9.0) results in the board not working at all.

###Update

After speaking with someone from Nordic; I changed the ROM1/RAM1 settings to reflect the s130 example for the ble_app_beacon. I still can't download the flash using Keil, and I get this error:

JLink info:
------------ DLL: V5.02f, compiled Oct  2 2015 20:51:34 Firmware: J-Link V9 compiled Sep 18 2015 19:53:12 Hardware: V9.30 S/N : 59302260  Feature(s) : GDB   
* JLink Info: Found SWD-DP with ID 0x0BB11477
* JLink Info: Found Cortex-M0 r0p0, Little endian.
* JLink Info: FPUnit: 4 code (BP) slots and 0 literal slots
* JLink Info: CoreSight components:
* JLink Info: ROMTbl 0 @ F0000000
* JLink Info: ROMTbl 0 [0]: F00FF000, CID: B105100D, PID: 000BB471 ROM Table
* JLink Info: ROMTbl 1 @ E00FF000
* JLink Info: ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS
* JLink Info: ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT
* JLink Info: ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB
* JLink Info: ROMTbl 0 [1]: 00002000, CID: B105900D, PID: 000BB9A3 ??? ROMTableAddr = 0xF0000003   
Target info:
------------ 
Device: nRF51822_xxAC 
VTarget = 2.632V 
State of Pins:  TCK: 0, TDI: 0, TDO: 0, TMS: 1, TRES: 1, TRST: 0 
Hardware-Breakpoints: 4 
Software-Breakpoints: 8192 
Watchpoints:          2 J
TAG speed: 1000 kHz   
Erase Failed! Error: Flash Download failed  -  "Cortex-M0" 
Flash Load finished at 17:40:43

I am, however, able to download the flash file for the ble_app_beacon S130 example.

Here are the RAM/ROM settings suggested for the S130:

image description

Parents
  • what are the versions of softdevice and chip your are using? nrfjprog will not allow you to write on dirty pages, you need to erase chip, program softdevice and then program the application. Everything will be flashed correctly if softdevice and application are not overlapping. If they do, then nrfjprog will give error like the one you mentioned.

    Keil on the other part will be able to write on application dirty pages, this means that an application can be flashed to already flashed memory without the need of explicit erase operation. This is because the flash algorithm provided by nordic for Keil will internally erase necessary flash pages. On the other hand this is not the same if Keil sees that the application is trying to write to the softdevice flash area. It will then fail.

Reply
  • what are the versions of softdevice and chip your are using? nrfjprog will not allow you to write on dirty pages, you need to erase chip, program softdevice and then program the application. Everything will be flashed correctly if softdevice and application are not overlapping. If they do, then nrfjprog will give error like the one you mentioned.

    Keil on the other part will be able to write on application dirty pages, this means that an application can be flashed to already flashed memory without the need of explicit erase operation. This is because the flash algorithm provided by nordic for Keil will internally erase necessary flash pages. On the other hand this is not the same if Keil sees that the application is trying to write to the softdevice flash area. It will then fail.

Children
No Data
Related