Hi,
In my project, I need turn on/off the hfxo, I found when i configure the hfxo, the nfc is not working. Here is my code:
Hi,
In my project, I need turn on/off the hfxo, I found when i configure the hfxo, the nfc is not working. Here is my code:
Hi!
I see you have this in the code:
case GPS_CLOSE:
LOG_INF("close gps module");
sim66md_power(0);
gps_power_lock = false;
clock_control_off(clock_dev, CLOCK_CONTROL_NRF_SUBSYS_HF);
LOG_INF("HFCLK stopped.");
break;
If you remove, "clock_control_off(clock_dev, CLOCK_CONTROL_NRF_SUBSYS_HF);" line, does the nfc work as expected then?
Hi!
Could you try to explain what you are trying to do here? Why start NFC and stop HFXO on case GPS_CLOSE?
Also did you call e.g. nfc_t4t_setup() ?
You should also check the return code from nfc_t4t_emulation_start() and nfc_t4t_emulation_stop().
e.g.
int err;
err = nfc_t4t_emulation_start();
if (err) {
LOG_ERR("Failed to start NFC T4T emulation, (err: %d)", err);
}
Due to low power requirements, I need to dynamically enable and disable HFXO. When I turn on the GPS, I enable HFXO, and before enabling HFXO, I disable the NFC function to prevent NFC from being in an unknown state after switching to HFXO. Before turning off HFXO, I first restore the NFC functionality. Additionally, nfc_t4t_emulation_start always returns successfully as long as it is not called repeatedl
I also noticed that the function nfct_field_timer_config(uint8_t irq_priority) at line 383 in the file D:\Nordic\v2.5.1\modules\hal\nordic\nrfx\drivers\src\nrfx_nfct.c uses timer2. When I change the HFCLK clock source, it should affect timer2, which could lead to NFC not functioning properl
static inline nrfx_err_t nfct_field_timer_config(uint8_t irq_priority)
{
nrfx_err_t err_code;
nrfx_timer_config_t timer_cfg = NRFX_TIMER_DEFAULT_CONFIG(FIELD_TIMER_FREQUENCY_HZ);
timer_cfg.interrupt_priority = irq_priority;
err_code = nrfx_timer_init(&m_timer_workaround.timer,
&timer_cfg,
nfct_field_timer_handler);
if (err_code != NRFX_SUCCESS)
{
return err_code;
}
nrfx_timer_extended_compare(&m_timer_workaround.timer,
NRF_TIMER_CC_CHANNEL0,
nrfx_timer_us_to_ticks(&m_timer_workaround.timer,
NRFX_NFCT_TIMER_PERIOD),
NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
true);
return err_code;
}