hello Nordic
i am using nrf52840, sdk 16.0 working on ther peripheral ble_blinky example, working with Segger IDE (ses)
i have lines of code missing when i am debugging after changing from release to debug and other lines missing when i move from debug to release, can you explain the logic or rules behind ?
also for some reson a code that works well in release mode while debugging, crashed when switching to debug mode
it crashes in the channel init line :
ret_code_t err_code;
//nrf_drv_saadc_config_t audio_saadc_config;
nrf_saadc_channel_config_t audio_channel_config;
nrf_gpio_cfg_output(ARDUINO_13_PIN); // FOR DEBUG
//Configure SAADC
audio_saadc_config.resolution = NRF_SAADC_RESOLUTION_14BIT; //Set SAADC resolution to 12-bit. This will make the SAADC output values from 0 (when input voltage is 0V) to 2^12=2048 (when input voltage is 3.6V for channel gain setting of 1/6).
audio_saadc_config.oversample = NRF_SAADC_OVERSAMPLE_DISABLED; //DIABLED - //Set oversample to 4x. This will make the SAADC output a single averaged value when the SAMPLE task is triggered 4 times.
audio_saadc_config.interrupt_priority = APP_IRQ_PRIORITY_LOW; //Set SAADC interrupt to low priority.
audio_saadc_config.low_power_mode = NRFX_SAADC_CONFIG_LP_MODE;
//Configure SAADC channels:
audio_channel_config.reference = NRF_SAADC_REFERENCE_VDD4; //Set internal reference of fixed 0.6 volts
audio_channel_config.gain = NRF_SAADC_GAIN1_4; //Set input gain to 1/6. The maximum SAADC input voltage is then 0.6V/(1/6)=3.6V. The single ended input range is then 0V-3.6V
audio_channel_config.acq_time = NRF_SAADC_ACQTIME_10US; //Set acquisition time. Set low acquisition time to enable maximum sampling frequency of 200kHz. Set high acquisition time to allow maximum source resistance up to 800 kohm, see the SAADC electrical specification in the PS.
audio_channel_config.mode = NRF_SAADC_MODE_SINGLE_ENDED; //Set SAADC as single ended. This means it will only have the positive pin as input, and the negative pin is shorted to ground (0V) internally.
audio_channel_config.resistor_p = NRF_SAADC_RESISTOR_DISABLED; //Disable pullup resistor on the input pin
audio_channel_config.resistor_n = NRF_SAADC_RESISTOR_DISABLED;
audio_channel_config.burst = NRF_SAADC_BURST_ENABLED;
// err_code = nrf_drv_saadc_init(&audio_saadc_config, audio_saadc_callback);
// APP_ERROR_CHECK(err_code);
audio_channel_config.pin_p = AUDIO_PIEZO_ADC_INPUT_PIN;
err_code = nrf_drv_saadc_channel_init(0, &audio_channel_config);
APP_ERROR_CHECK(err_code);
hope to read from you soon
best regards
Ziv