I add my own codes in nRF51-ble-bcast-mesh-sdk-8-support project,
then I find that if device_flash_init() is compile to this project,
the program cannot finish rbc_mesh_init(),
and stop at sd_rand_application_bytes_available_get() in rand_init(void).
Here is my device_flash_init() function
#define FLASH_BLOCK_SIZE 20
void device_flash_init(void)
{
uint8_t *block_list=NULL;
uint32_t retval, retval_addrgroup;
retval = pstorage_init();
if(retval != NRF_SUCCESS)
{ nrf_gpio_pin_set(LED_0);
}
param_addrgroup.block_size = FLASH_BLOCK_SIZE;
param_addrgroup.block_count = 1;
param_addrgroup.cb = flash_operation_cb;
retval_addrgroup = pstorage_register(¶m_addrgroup, &handle_addrgroup);
if(retval_addrgroup !=NRF_SUCCESS)
{
nrf_gpio_pin_set(LED_0);
}
pstorage_block_identifier_get(&handle_addrgroup, 0, &block3_addrgroup);
block_list = malloc(FLASH_BLOCK_SIZE);
if(block_list!=NULL)
{
memset(block_list,0,FLASH_BLOCK_SIZE);
pstorage_load(block_list, &block3_addrgroup, FLASH_BLOCK_SIZE, 0);
get_device_addrgroup(block_list);
free(block_list);
}
else
{block_list=NULL;}
}
can you one give me some clues? THANK YOU!