@@ -72,10 +72,10 @@ static int delete_and_verify_items(struct bm_zms_fs *fs, uint32_t id)
72
72
73
73
return 0 ;
74
74
error1 :
75
- LOG_INF ("Error while deleting item rc=%d" , rc );
75
+ LOG_ERR ("Error while deleting item rc=%d" , rc );
76
76
return rc ;
77
77
error2 :
78
- LOG_INF ("Error, Delete failed item should not be present" );
78
+ LOG_ERR ("Error, Delete failed item should not be present" );
79
79
return -1 ;
80
80
}
81
81
@@ -85,25 +85,25 @@ static int delete_basic_items(struct bm_zms_fs *fs)
85
85
86
86
rc = delete_and_verify_items (fs , IP_ADDRESS_ID );
87
87
if (rc ) {
88
- LOG_INF ("Error while deleting item %x rc=%d" , IP_ADDRESS_ID , rc );
88
+ LOG_ERR ("Error while deleting item %x rc=%d" , IP_ADDRESS_ID , rc );
89
89
return rc ;
90
90
}
91
91
wait_for_ongoing_writes ();
92
92
rc = delete_and_verify_items (fs , KEY_VALUE_ID );
93
93
if (rc ) {
94
- LOG_INF ("Error while deleting item %x rc=%d" , KEY_VALUE_ID , rc );
94
+ LOG_ERR ("Error while deleting item %x rc=%d" , KEY_VALUE_ID , rc );
95
95
return rc ;
96
96
}
97
97
wait_for_ongoing_writes ();
98
98
rc = delete_and_verify_items (fs , CNT_ID );
99
99
if (rc ) {
100
- LOG_INF ("Error while deleting item %x rc=%d" , CNT_ID , rc );
100
+ LOG_ERR ("Error while deleting item %x rc=%d" , CNT_ID , rc );
101
101
return rc ;
102
102
}
103
103
wait_for_ongoing_writes ();
104
104
rc = delete_and_verify_items (fs , LONG_DATA_ID );
105
105
if (rc ) {
106
- LOG_INF ("Error while deleting item %x rc=%d" , LONG_DATA_ID , rc );
106
+ LOG_ERR ("Error while deleting item %x rc=%d" , LONG_DATA_ID , rc );
107
107
}
108
108
wait_for_ongoing_writes ();
109
109
@@ -125,7 +125,7 @@ void bm_zms_sample_handler(bm_zms_evt_t const *p_evt)
125
125
nvm_is_full = true;
126
126
return ;
127
127
}
128
- LOG_INF ("BM_ZMS Error received %d" , p_evt -> result );
128
+ LOG_ERR ("BM_ZMS Error received %d" , p_evt -> result );
129
129
} else {
130
130
LOG_WRN ("Unhandled BM_ZMS event ID %u" , p_evt -> id );
131
131
}
@@ -167,7 +167,7 @@ int main(void)
167
167
for (i = 0 ; i < CONFIG_BM_ZMS_ITERATIONS_MAX ; i ++ ) {
168
168
rc = bm_zms_mount (& fs );
169
169
if (rc ) {
170
- LOG_INF ("Storage Init failed, rc=%d" , rc );
170
+ LOG_ERR ("Storage Init failed, rc=%d" , rc );
171
171
goto idle ;
172
172
}
173
173
wait_for_init ();
@@ -188,7 +188,7 @@ int main(void)
188
188
LOG_INF ("Adding IP_ADDRESS %s at id %u" , buf , IP_ADDRESS_ID );
189
189
rc = bm_zms_write (& fs , IP_ADDRESS_ID , & buf , strlen (buf ));
190
190
if (rc < 0 ) {
191
- LOG_INF ("Error while writing Entry rc=%d" , rc );
191
+ LOG_ERR ("Error while writing Entry rc=%d" , rc );
192
192
goto idle ;
193
193
}
194
194
wait_for_ongoing_writes ();
@@ -205,7 +205,7 @@ int main(void)
205
205
LOG_INF ("Adding key/value at id %x" , KEY_VALUE_ID );
206
206
rc = bm_zms_write (& fs , KEY_VALUE_ID , & key , sizeof (key ));
207
207
if (rc < 0 ) {
208
- LOG_INF ("Error while writing Entry rc=%d" , rc );
208
+ LOG_ERR ("Error while writing Entry rc=%d" , rc );
209
209
goto idle ;
210
210
}
211
211
wait_for_ongoing_writes ();
@@ -217,14 +217,14 @@ int main(void)
217
217
if (rc > 0 ) { /* item was found, show it */
218
218
LOG_INF ("Id: %d, loop_cnt: %u" , CNT_ID , i_cnt );
219
219
if ((i > 0 ) && (i_cnt != (i - 1 ))) {
220
- LOG_INF ("Error loop_cnt %u must be %d" , i_cnt , i - 1 );
220
+ LOG_ERR ("Error loop_cnt %u must be %d" , i_cnt , i - 1 );
221
221
goto idle ;
222
222
}
223
223
}
224
224
LOG_INF ("Adding counter at id %u" , CNT_ID );
225
225
rc = bm_zms_write (& fs , CNT_ID , & i , sizeof (i ));
226
226
if (rc < 0 ) {
227
- LOG_INF ("Error while writing Entry rc=%d" , rc );
227
+ LOG_ERR ("Error while writing Entry rc=%d" , rc );
228
228
goto idle ;
229
229
}
230
230
wait_for_ongoing_writes ();
@@ -243,7 +243,7 @@ int main(void)
243
243
LOG_INF ("Adding Longarray at id %d" , LONG_DATA_ID );
244
244
rc = bm_zms_write (& fs , LONG_DATA_ID , & longarray , sizeof (longarray ));
245
245
if (rc < 0 ) {
246
- LOG_INF ("Error while writing Entry rc=%d" , rc );
246
+ LOG_ERR ("Error while writing Entry rc=%d" , rc );
247
247
goto idle ;
248
248
}
249
249
wait_for_ongoing_writes ();
@@ -258,7 +258,7 @@ int main(void)
258
258
}
259
259
260
260
if (i != CONFIG_BM_ZMS_ITERATIONS_MAX ) {
261
- LOG_INF ("Error: Something went wrong at iteration %u rc=%d" , i , rc );
261
+ LOG_ERR ("Error: Something went wrong at iteration %u rc=%d" , i , rc );
262
262
goto idle ;
263
263
}
264
264
@@ -275,25 +275,25 @@ int main(void)
275
275
/* Calculate free space and verify that it is 0 */
276
276
free_space = bm_zms_calc_free_space (& fs );
277
277
if (free_space < 0 ) {
278
- LOG_INF ("Error while computing free space, rc=%d" , free_space );
278
+ LOG_ERR ("Error while computing free space, rc=%d" , free_space );
279
279
goto idle ;
280
280
}
281
281
if (free_space > 0 ) {
282
- LOG_INF ("Error: free_space should be 0, computed %u" , free_space );
282
+ LOG_ERR ("Error: free_space should be 0, computed %u" , free_space );
283
283
goto idle ;
284
284
}
285
285
LOG_INF ("Memory is full let's delete all items" );
286
286
/* Now delete all previously written items */
287
287
for (uint32_t n = 0 ; n < id ; n ++ ) {
288
288
rc = delete_and_verify_items (& fs , n );
289
289
if (rc ) {
290
- LOG_INF ("Error deleting at id %u" , n );
290
+ LOG_ERR ("Error deleting at id %u" , n );
291
291
goto idle ;
292
292
}
293
293
}
294
294
rc = delete_basic_items (& fs );
295
295
if (rc ) {
296
- LOG_INF ("Error deleting basic items" );
296
+ LOG_ERR ("Error deleting basic items" );
297
297
goto idle ;
298
298
}
299
299
@@ -302,15 +302,16 @@ int main(void)
302
302
*/
303
303
free_space = bm_zms_calc_free_space (& fs );
304
304
if (free_space < 0 ) {
305
- LOG_INF ("Error while computing free space, rc=%d" , free_space );
305
+ LOG_ERR ("Error while computing free space, rc=%d" , free_space );
306
306
goto idle ;
307
307
}
308
308
LOG_INF ("Free space in storage is %u bytes" , free_space );
309
309
310
310
/* Let's clean the storage now */
311
311
rc = bm_zms_clear (& fs );
312
312
if (rc < 0 ) {
313
- LOG_INF ("Error while cleaning the storage, rc=%d" , rc );
313
+ LOG_ERR ("Error while cleaning the storage, rc=%d" , rc );
314
+ goto idle ;
314
315
}
315
316
316
317
LOG_INF ("BM_ZMS sample finished Successfully" );
0 commit comments