Hello how are you?
I don't speak English very well but I have a doubt about using mesh and nfc simultaneously.
I'm using the Nordic-Thingy52-mesh-demo example - (Nordic-Thingy52-mesh-demo - https://github.com/NordicPlayground/Nordic-Thingy52-mesh-demo) on Nordic Thingy: 52 SDK v2.1.0 with Nordic nRF5 SDK for Mesh v1.0.1
I was able to join the nfc library with the example and I want to read the mesh network id, but when initializing the nfc and mesh network gives an error:
<t: 100900>, nrf_mesh_node_config.c, 108, Softdevice assert: 4097: 148964: 1
When used separately, they work without problems.
code:
int main(void)
{
uint32_t err_code;
err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);
NRF_LOG_INFO(NRF_LOG_COLOR_CODE_GREEN"===== Thingy mesh demo node started! =====\r\n");
nrf_gpio_cfg_input(BUTTON, NRF_GPIO_PIN_PULLUP);
if(nrf_gpio_pin_read(BUTTON) == 0){
uint8_t erase_page_num = 1 + ACCESS_FLASH_PAGE_COUNT + DSM_FLASH_PAGE_COUNT + NET_FLASH_PAGE_COUNT;
uint32_t vptr_end = FLASH_MANAGER_RECOVERY_PAGE;
uint32_t vptr= FLASH_MANAGER_RECOVERY_PAGE - erase_page_num*FDS_PHY_PAGE_SIZE*sizeof(uint32_t);
for(; vptr_end >= vptr ; vptr += FDS_PHY_PAGE_SIZE*sizeof(uint32_t))
{
nrf_nvmc_page_erase(vptr);
}
NRF_LOG_INFO("Provisioning information erased\r\n");
NVIC_SystemReset();
}
__LOG_INIT(LOG_SRC_APP, LOG_LEVEL_INFO, LOG_CALLBACK_DEFAULT);
// Initialize.
APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
err_code = app_timer_init();
APP_ERROR_CHECK(err_code);
board_init();
thingy_init();
sensor_init();
mesh_stack_init();
create_timers();
nrf_drv_gpiote_in_config_t gpiote_in_config;
gpiote_in_config.is_watcher = false;
gpiote_in_config.hi_accuracy = false;//true;
gpiote_in_config.pull = NRF_GPIO_PIN_NOPULL;
gpiote_in_config.sense = NRF_GPIOTE_POLARITY_TOGGLE;//NRF_GPIOTE_POLARITY_HITOLO;
//nrf_delay_ms(1000);
err_code = nrf_drv_gpiote_in_init(11, &gpiote_in_config, gpiote_Button_handler);
nrf_drv_gpiote_in_event_enable(11, true);
uint8_t data[247];
uint8_t tam = 247;
err_code = drv_nfc_init();
APP_ERROR_CHECK(err_code);
if (err_code != NRF_SUCCESS)
{
NRF_LOG_ERROR("nfc init failed - %d\r\n", err_code);
return err_code;
}
err_code = drv_nfc_string_record_add(THINGY_NFC_APP_ANDROID_NAME_DEFAULT, THINGY_NFC_APP_ANDROID_NAME_LEN);
APP_ERROR_CHECK(err_code);
err_code = drv_nfc_enable();
APP_ERROR_CHECK(err_code);
err_code = drv_nfc_raw_data_get(data, &tam);
APP_ERROR_CHECK(err_code);
/* Start sensing NFC field */
err_code = nfc_t2t_emulation_start();
APP_ERROR_CHECK(err_code);
for (;;)
{
app_sched_execute();
if (!NRF_LOG_PROCESS())
{
power_manage();
}
}
}
error:
<t: 328>, main.c, 446, Initializing and adding models <t: 70297>, nrf_mesh_node_config.c, 108, Softdevice assert: 4097:148964:1
how do I initialize the two and read the ID mesh after provisioning?
Thank you in advance.