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

How to Write flash , Read flash and delete flash from one location only.

Hello All,

I am working on the Nrf52810 board with sdk 14.2.

I have implemented the read ,write , delete feature in my code.

Now it is creating new entry for repeating/creating new record read write function each .

I wanted to read / write / delete in same location or (restrict in one location)

Here is my mainc file please check below.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* Copyright (c) 2014 - 2017, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Please suggest how to read/write in same location without creating new record.

here is my debug output please check

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<info> app: Writing Record ID = 2
<info> app: Start searching...
<info> app: Found Record ID = 1
<info> app: Data =
<info> app: 0
<info> app: A2
<info> app: A3
<info> app: A4
<info> app: 22
<info> app: 2D
<info> app: C
<info> app: 20
<info> app: Found Record ID = 2
<info> app: Data =
<info> app: Heart Rate Sensor example started.
<info> app: Fast advertising.
<info> app: Writing Record ID = 3
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Waiting for your valuable response.

Regards,

Rohit