PWM-PPI(DMA) from Flash

Hi

I am using nrf52832 to push via PPI an array of PWM values, it works if the array is on the RAM but when I define the array as "const" (to put it in the flash) nothing comes out.

It is important for me to read from flash because the array is very big and I wish to save memory on the RAM

const uint16_t seq_values_a[AUD_BUF_LENGTH] = {0, 0, 1, 2, 3, 4, 5, 6, 

void func_audio_pwm_set_duty_cycle(void)
{

    static nrf_pwm_sequence_t const seq1 =
    {
        .values.p_common = (const nrf_pwm_values_common_t*)&seq_values_a,
        .length          = PWM_BUF_LENGTH,
        .repeats         = 1,
        .end_delay       = 0
    };

		static nrf_pwm_sequence_t const seq2 =
    {
        .values.p_common = (const nrf_pwm_values_common_t*)&seq_values_a,
        .length          = PWM_BUF_LENGTH,
        .repeats         = 1,
        .end_delay       = 0
    };
		
		nrfx_pwm_complex_playback(&PWM2, &seq1, &seq2, 1, NRFX_PWM_FLAG_SIGNAL_END_SEQ0 | NRFX_PWM_FLAG_SIGNAL_END_SEQ1 | NRFX_PWM_FLAG_LOOP);
}

any ideas?

Thanks

Ron

Related