Nordic nRF51 Examples and CrossWorks

Comments

12 comments

  • Avatar
    Michael Johnson

    You should be able to set the Placement project property to Flash_S120.

    0
    Comment actions Permalink
  • Avatar
    Chrisw
    What do you mean?
    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    There's a project property "Section Placement" for nRF51 projects it has entries Flash_S110, Flash_S120, Flash_S210 - there are some words on this in the CPU support package documentation.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    There is a requirement to erase all before the soft device is loaded - did you do that?

    0
    Comment actions Permalink
  • Avatar
    Chrisw

    I am getting the soft device loaded no problem. And I can load the app binary. But when I load the app binary it blows away the soft device because it is loaded at 0x0000 in stead of 0x1800. What I was wonder is what is the best way to compile app to load at 0x1800 instead of 0x000 and not erase entire chip. I found a macro that seems to do this but I can't find it in the CrossWorks documentation.

    0
    Comment actions Permalink
  • Avatar
    Chrisw

    Turns out this is the trick. I had to add the following two macros:

     

    FLASH_START=0x18000

    RAM_START=0x20002000

     

    to get the binary to start at 0x18000

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    The Section Placement property "Flash_S120" etc will do this for you - that's what it's for.

    0
    Comment actions Permalink
  • Avatar
    Chrisw

    @Michael,

     

    Sorry, I am still not getting what you are saying. I googled and put "Flash_S120" in CrossWorks Help but I get no results.

     

    I removed "FLASH_START=0x18000" & "RAM_START=0x20002000" from "Section Placement Macro" and selected "Flash_S110" from  "Section Placement". When I do this the resulting ELF file is created with address 0x16000 instead of 0x18000.

     

    Also I see this in the output when I try and run the binary which indicates an offset of "0x16000" instead of "0x18000". The value 0x16000 is the value from Nordic SDK 7.x but I am using Nordic SDK 8.0.

     

    Preparing target for download
    Loading target script file nRF51_Target.js
    Executing script FLASHReset()
    Programming
    Programming 0.1 KB of .vectors addresses 00016000 — 000160bf
    Programming 0.4 KB of .init addresses 000160c0 — 00016273
    Programming 13.8 KB of .text addresses 00016274 — 000199cf
    Programming 0.6 KB of .rodata addresses 000199d0 — 00019c63
    Programming 0.0 KB of .data addresses 00019c64 — 00019c7b
    Compare
    Compare completed in 138 ms
    Erase
    Erase completed in 74 ms
    Program
    Programming failed @ address 0x00000000 (block verification error)
    Program completed in 108 ms
    JLINKARM_EndDownload Error during program/erase phase
    Program completed in 529 ms
    Verifying ‘nrf51422_xxac_s110.elf’ on SEGGER J-Link
    Verifying
    Verifying 0.1 KB of .vectors addresses 00016000 — 000160bf
    Verifying completed in 143 ms — 108,279 bytes/sec
    Verifying completed in 266 ms — 3 bytes/sec

     

    I am using: 

    CrossWorks for ARM
    Release 3.3.1.2014121602.22877
    Mac OS x86

     

    If I put it back to "Section Placement=Flash" and define "Section Placement Macro" with the to macros above it works. Can you help me understand what I am doing wrong?

    My project file is attached with the configuration "Flash_S110" set.

    The file "wrong_nrf51422...elf" is built with  "Flash_S110" set and crashes at launch

    The file "good_nrf51422...elf" is built with Section Placement Macro set to FLASH_START, RAM_START.

     

    Do I need to redefine "Flash_S120" somewhere?

     

    Thank you for your help.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    That would explain it - the numbers are in the propertyGroups.xml file. Looks like I need to define SDK versions of these placements.

    0
    Comment actions Permalink
  • Avatar
    Chrisw

    @Michael,

     

    I searched my entire harddrive for "propertyGroups.xml". Where is that file located?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    If you look at the properties displayed in the project explorer there's a property called "Property Groups File", you can right click on this and select "Open" to see the file in the text editor.

    Alternatively you can navigate to the packages directory using File | Open Studio Folder | Packages Folder.

    0
    Comment actions Permalink
  • Avatar
    Chrisw

    @Michael,

     

    I guess I just have really bad luck. This does nothing: "File | Open Studio Folder | Packages Folder".

     

    It's OK I will just keep using the macros until the app can be updated.

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.