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

FDS on app not working when loading app using a bootloader

Hello,

I am having an odd issue when loading an app that uses FDS with softdevice, if I load the app without a bootloader the FDS library seems to work just fine but if I use the bootloader to load the app the FDS library is stuck at the fds_init method, Is there a way to get a workaround of this, I am using sdk 15.0.0.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
include "flashconfig.h"
#include <stdint.h>
#include <stdbool.h>
#include "fds.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include <string.h>
#include "SoftwareSerial.h"
/* File ID and Key used for the configuration record. */
#define CONFIG_FILE (0xF010)
#define CONFIG_REC_KEY (0x7010)
extern char const *fds_err_str[];
/* A dummy structure to save in flash. */
typedef struct
{
uint32_t boot_count;
char device_name[16];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
#ifndef FLASHCONFIG_H_
#define FLASHCONFIG_H_
#include <stdint.h>
#include <stdbool.h>
void flashconfig_begin();
bool flashconfig_setESN(char* newESN);
char* flashconfig_getESN();
#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I load the app using the bootloader the app is always crashing at this point.

Fullscreen
1
2
3
4
5
rc = fds_init();
APP_ERROR_CHECK(rc);
/* Wait for fds to initialize. */
wait_for_fds_ready();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Do you have an idea of what could it be causing it?

The main function is like this:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdbool.h>
#include <stdint.h>
#include "nrf.h"
#include "nrf_drv_timer.h"
#include "bsp.h"
#include "app_error.h"
#include <string.h>
#include "flashconfig.h"
int main(void)
{
NRF_POWER->TASKS_CONSTLAT = 1;
et_code_t err_code = nrf_drv_clock_init();
APP_ERROR_CHECK(err_code);
flashconfig_begin();
flashconfig_getESN();
return 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX