This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pstorage_store

Hi there,

If I try to store a global variable in flash I can't store it. But when I declare this variable in the main function I can store it in flash. Can someone tell me the reason.

In this case, I can load Params_Data correctly from the flash:

int main(void) {     uint8_t destination[16];
			uint8_t ppp[16];
			uint8_t Params_Data[16]={0xaa,0xaa,0xaa,0xaa,0xbb,0xbb,0xbb,0xbb,0xcc,0xcc,0xcc,0xcc,0xdd,0xdd,0xdd,0xdd};
      int compteur=0;
		      // Initialisation
                            configuration_parameters_init();
			timer_init();
			ble_stack_init();
                        advertising_init();
			flash_init(&base_block_handle,20,1);
			ble_rssi_mac_init(&p_rssi_mac_s,data_notification);
			ble_write_config_init(&p_write_config_s,config_params);
			flash_clear_block(&base_block_handle,20);
			pstorage_store(&base_block_handle,Params_Data,16,0);
			pstorage_load(destination,&base_block_handle,16,0);
		

Thanks.

Parents Reply Children
Related