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

It stopped working after adding the TWI code to the BLE communication code

Hello

I am currently trying to combine BLE, SPI and TWI programs into one.
I used SDK 15.0.0 and confirmed that each program works properly with keil.
However, since keil has a 32k byte limit, I will put these programs together in Embedded studio.
Based on "app_ble_blinky", add "fatfs" and TWI communication code.

I was able to combine BLE communication and SPI communication, but if TWI communication is used additionally, the program will not work.
Specifically like the code below

nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
  err_code = nrf_drv_timer_init(&TIMER_TWI, &timer_cfg, timer_twi_event_handler);
  APP_ERROR_CHECK(err_code);
  time_ticks = nrf_drv_timer_ms_to_ticks(&TIMER_TWI, time_ms);

  nrf_drv_timer_extended_compare(
       &TIMER_TWI, NRF_TIMER_CC_CHANNEL0, time_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
  nrf_drv_timer_enable(&TIMER_TWI);

It is a TIMER setting for TWI rather than TWI, but if this code is inserted, subsequent programs will not work.
This is working fine with this code if you previously checked with keil to add TWI to fatfs.

Is it incompatible with BLE communication and TIMER?

Thank you.

Parents Reply Children
No Data
Related