hi Nordic support team,
I cannot re-flash firmware for nrf52840 after ram off is implemented.
I recheck with other chip like nrf52833, it have the same result: \althrough it can connect to chip but can not re-flash firmware.
Do you have suggestion for re-program chip
This is my code:
void RAM_off( void )
{
#ifdef NRF51
NRF_POWER->RAMON |= (POWER_RAMON_OFFRAM0_RAM0Off << POWER_RAMON_OFFRAM0_Pos) |
(POWER_RAMON_OFFRAM1_RAM1Off << POWER_RAMON_OFFRAM1_Pos);
#endif //NRF51
#ifdef NRF52
NRF_POWER->RAM[0].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[1].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[2].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[3].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[4].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[5].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[6].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
NRF_POWER->RAM[7].POWERCLR = POWER_RAM_POWER_S0POWER_Msk | POWER_RAM_POWER_S1POWER_Msk;
#endif //NRF52
}
int main(void)
{
ret_code_t err_code;
uint8_t len = 0;
RAM_off();
while (true)
{
}
}