mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-27 10:24:04 +00:00
esp32: Add KConfig option to disable ROM Console fallback on first boot
This commit is contained in:

committed by
Angus Gratton

parent
881aa43b69
commit
1e22bcdfde
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#include "esp_efuse.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#define EFUSE_CONF_WRITE 0x5A5A /* efuse_pgm_op_ena, force no rd/wr disable */
|
||||
#define EFUSE_CONF_READ 0x5AA5 /* efuse_read_op_ena, release force */
|
||||
@@ -19,6 +20,8 @@
|
||||
#define EFUSE_CMD_PGM 0x02
|
||||
#define EFUSE_CMD_READ 0x01
|
||||
|
||||
static const char *TAG = "efuse";
|
||||
|
||||
void esp_efuse_burn_new_values(void)
|
||||
{
|
||||
REG_WRITE(EFUSE_CONF_REG, EFUSE_CONF_WRITE);
|
||||
@@ -45,3 +48,13 @@ void esp_efuse_reset(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void esp_efuse_disable_basic_rom_console(void)
|
||||
{
|
||||
if ((REG_READ(EFUSE_BLK0_RDATA6_REG) & EFUSE_RD_CONSOLE_DEBUG_DISABLE) == 0) {
|
||||
ESP_EARLY_LOGI(TAG, "Disable BASIC ROM Console fallback via efuse...");
|
||||
esp_efuse_reset();
|
||||
REG_WRITE(EFUSE_BLK0_WDATA6_REG, EFUSE_RD_CONSOLE_DEBUG_DISABLE);
|
||||
esp_efuse_burn_new_values();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user