Hi,
We have an application built using sdk10 and sd110 on a nRF51822 chip using Segger Embedded Studio. The application works but it takes to long to start.
We have bootloader + application + sd!
/**@brief Function for application main entry. */ int main(void) { uint32_t err_code; NRF_POWER->RESET = 1; // Initialize. app_timer_init(); app_bluetooth_ble_stack_init(); app_memory_init(); //External Memory init (SPI) bool first_init = app_memory_system_on_first_time(); app_bluetooth_device_manager_init(first_init); app_bluetooth_gap_params_init(); app_bluetooth_advertising_init(); app_bluetooth_services_init(); app_bluetooth_conn_params_init(); // Start execution. app_bluetooth_advertising_start(); app_display_init(); //Initialize 8bit interface TFT display app_battery_init(); //Battery monitor init (ADC) app_touch_init(); //Touch sensor init (I2C) app_heart_sensor_init(); //HRS init (I2C) app_motor_init(); //Vibration Motor init (PWM) #ifdef DEBUG app_notification_init(); app_ui_flow_start(IDLE_VERTICE); //Idle screen set #else if (first_init) app_notification_init_secure(); else app_notification_init(); app_ui_flow_start(IDLE_VERTICE); if (first_init) app_ui_flow_start(FIRST_TIME_VERTICE); //First time screen set #endif app_motor_notify(INIT_MODE); //init vibration set (PWM init) // Enter main loop. for (;;) { power_manage(); } }
As we can see on my main() after all init sequence the vibration motor vibrates two times and goes off. The motor uses PWM and the Display uses a 8bit interface (nrf_gpio...)
The problem is that after the final vibration the application takes few seconds to realy work. If I wait few seconds (around 5 seconds) every thing works fine. Touch (I2C with a RDY pin) only works after few seconds.
If I request a screen just after the app_motor_notify(INIT_MODE); (see the code bellow), the screen function works but the motor does not vibrate.
app_motor_notify(INIT_MODE);
app_ui_flow_start(MAIN_SCREEN_VERTICE);
Does anyone have an idea about how to fix this slow initialization?