forked from espressif/esp-idf
		
	Merge branch 'bugfix/soft_reboot_psram' into 'master'
Fix rebooting when external RAM is active See merge request !1207
This commit is contained in:
		@@ -24,6 +24,7 @@
 | 
			
		||||
#include "rom/cache.h"
 | 
			
		||||
#include "rom/uart.h"
 | 
			
		||||
#include "soc/dport_reg.h"
 | 
			
		||||
#include "soc/gpio_reg.h"
 | 
			
		||||
#include "soc/efuse_reg.h"
 | 
			
		||||
#include "soc/rtc_cntl_reg.h"
 | 
			
		||||
#include "soc/timer_group_reg.h"
 | 
			
		||||
@@ -298,6 +299,17 @@ void IRAM_ATTR esp_restart_noos()
 | 
			
		||||
    Cache_Read_Disable(0);
 | 
			
		||||
    Cache_Read_Disable(1);
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_SPIRAM_SUPPORT
 | 
			
		||||
    //External SPI RAM reconfigures some GPIO functions in a way that is not entirely undone in the boot rom.
 | 
			
		||||
    //Undo them manually so we reboot correctly.
 | 
			
		||||
    WRITE_PERI_REG(GPIO_FUNC0_IN_SEL_CFG_REG, 0x30);
 | 
			
		||||
    WRITE_PERI_REG(GPIO_FUNC1_IN_SEL_CFG_REG, 0x30);
 | 
			
		||||
    WRITE_PERI_REG(GPIO_FUNC2_IN_SEL_CFG_REG, 0x30);
 | 
			
		||||
    WRITE_PERI_REG(GPIO_FUNC3_IN_SEL_CFG_REG, 0x30);
 | 
			
		||||
    WRITE_PERI_REG(GPIO_FUNC4_IN_SEL_CFG_REG, 0x30);
 | 
			
		||||
    WRITE_PERI_REG(GPIO_FUNC5_IN_SEL_CFG_REG, 0x30);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // Flush any data left in UART FIFOs
 | 
			
		||||
    uart_tx_wait_idle(0);
 | 
			
		||||
    uart_tx_wait_idle(1);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user