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

Crossworks HRM Example

Hi, I'm having a bit of trouble getting the broadcast or HRM example to work. I'm using crossworks and after my last question, removed the retarget.c file and the code compiled without errors. However upon trying to download the code to my PCA 10028 board I would get an error with regards to discrepancies in memory. After some investigation I assumed this was due to the fact that due to some improper configuration on my part I was trying to download code over the S210 Softdevice. I edited the memory map file for the board to account for the soft device making the following changes.

MemorySegment name="FLASH" access="ReadOnly" start="0x0000D000" size="0x33000" /

...

MemorySegment name="RAM" start="0x20000900" size="0x3700" /

The start location for Flash was changed from 0x00000000 to 0x0000D000 and the size was reduced by 52kb, the RAM start location was changed from 0x20000000 to 0x20000900 and the size was reduced by a corresponding amount. The code for both the broadcast and HR examples now downloads on to the board but neither appears to detect the ANT+ Heart Rate Monitor I'm wearing. Nothing prints to my debug terminal and I'm at a bit of a loss as to why. Have I edited the memory map incorrectly? Is there something else I need to configure in my code? Alternatively does the demo not detect the type of ANT device I'm wearing (it's just a Garmin HR monitor from my bike computer). Any help is appreciated!

Parents
  • No don't touch those, those are chip definition macros. You need to tell Crossworks a number of things, where to build this piece of code, to download it without wiping the chip and where to start debugging. There was a post about this a few years ago which I cribbed from. However the forum search appears not to go back very far any more and I can't find the post now.

    So put the project back the way it was and then you need the following things defined (use the properties window at the 'project' level and the search box to find the properties you need), each of these lines is the name in the crossworks file, see below for the friendly GUI names

    • linker_section_placement_macros: FLASH_START=0x0d000;RAM_START=0x20000900
    • target_loader_erase_all: NO
    • debug_entry_point_symbol: nonexistant

    I have a few more but those are the important ones. The first (friendly name is 'Section Placement Macros') tells Crossworks where to build your code. The second one (friendly name is 'Erase All' and it's under the Flash properties) tells Crossworks not to just do a full chip erase on install. The last one is for debugging and I don't quite remember what happens if you don't define it, i think it tries to debug in the softdevice or something.

    I actually have a home-built hzq package which I recently updated for SDK 7.x (which was a royal PITA) which generates templates for Crossworks for Nordic with softdevice and different targets etc. It exposes those as properties you can change (eg change s110 to s120) and that sets up all the correct variables to build the code and have it install in the right place. If you want to try that out please contact me off-list and I'll send it to you and see if I can help you get started, I wrote it for me so there's a bit of set up required.

  • Thanks for the answer, I got that corrected when I wrote the Macro definitions on separate lines, seemed to stop the interpolation for some reason.

Reply Children
No Data
Related