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

nrf_soc functions implementation

Hi everyone!

I'm using the nrf_soc API for get random numbers from the rng and erase and write the flash memory.

In my code, I include the nrf_soc.h file, in the header, and also the nrf_soc.c in my project. I'm using Keil.

I realised, that the nrf_soc.c file, only implements the sd_app_evt_wait function, this is the code:

/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */

#include <stdlib.h>
#include "nrf_soc.h"
#include "nrf_error.h"

uint32_t sd_app_evt_wait(void)
{
    __WFE();
    return NRF_SUCCESS;
}

Do I have to implement the rest of the functions (I think I haven't)? Where are the right document tho download the complete nrf_soc API? The code of my aplication is the following:

//includes para el Soft Device
#include "softdevice_handler.h"
#include "ble.h"

#include "nrf_drv_spi.h"
#include "app_util_platform.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "nrf_log.h"
#include "boards.h"
#include "app_error.h"
#include "nordic_common.h"
#include "finger_print_commands.h"
#include <stdint.h>
#include <string.h>
//defines para el Soft Device
#define CENTRAL_LINK_COUNT        1			/**< Number of central links used by the application. When changing this number remember to adjust the RAM settings*/
#define PERIPHERAL_LINK_COUNT     0
static void on_ble_evt(const ble_evt_t * const p_ble_evt){
}
static void ble_evt_dispatch(ble_evt_t * p_ble_evt){
}
static void ble_stack_init(void){
}
int main(){	
	//activar el Soft Device
	ble_stack_init();
	
	//borrar una pagina de la flash
	error = 0xff;
	do{
		error = sd_flash_page_erase(0x7f);
	}while(error != NRF_SUCCESS);
	
	//leer datos de la flash borrada
	dato = 0x0;
	*direccion = 0x7f000;
	dato = *direccion;
}
Related