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

NVM usage in nrf51422

I'm currently want to use the NVM with ble device, when I tried to send values from the mobile app to be stored to the NVM, it doesn't work, I guessed that the problem that it didn't recieve the data but it's not that , the problem appear when I use the nvm memory functions, I don't know the reason for that & how to overcome this problem.

  • There's nowhere near enough information in this question for anyone to be able to help you. You don't say what isn't working, you don't post even a single line of code showing what you're doing, haven't said if you get error messages, nothing.

  • I didn't get any errors or even warnings, what I got that when I try to write values sent from the mobile to the NVM in nrf51422 development kit, it caused to lost the connection & I get an error 133 (0x85): GATT ERROR while if I sent values and don't try to store in the nvm it works fine with me

  • still no code - just some sketchy 'I write values and it doesn't work'. Nobody can help you if you don't provide some reasonable details of exactly what you're doing and where it's failing.

    Are you in the error handler? I'm guessing since the connection breaks you may well be, which would mean you did get an error and APP_ERROR_CHECK() failed and called the error handler. Have you put a breakpoint in there?

    If you're not there, where are you? Hit break in the debugger, are you in the hardfault handler, some other fault handler?

  • first of all, thank you for trying helping me, I solved a part of my problem by using the sd_flash_write function, it works & I doesn't loose the connection, another problem appeared that I can't read the data written again, I'll post this part of code in an answer just a minute

  •            void edit_speed_ID(uint8_t speed)
               {		
           //pattern_ID_3();
            uint32_t value, err_code;
           value=0x00000000 | speed;
             err_code=sd_flash_write(address,(uint32_t *) & value,1);
           APP_ERROR_CHECK(err_code);
               flag=false;
               //	flash_init();
                }
    

    in the main function

    	if (flag==false)
    	{
    	speed = * address;
    	//speed = 5 *speed;
    	}
    

    and flag is global identifier.

Related