From acb7bd9fbec9683ee6494aaed090d56001cdb106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Redon?= Date: Mon, 12 Aug 2019 20:49:04 +0200 Subject: [PATCH] disable ERASE pin disabling the ERASE pin prevents accidental erase for the flash memory while the board is powered on (e.g. in case the user overcomes the weak 100 kOhm pull-down for more than 220 ms by touching or shorting the pin). the flash is still erasable using the ERASE pin during power up. it is only disabled after boot completed. Change-Id: Ic3332eb1d4247a07988b2fd841f40e79862d06a7 --- firmware/libboard/common/source/board_lowlevel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c index 82109386..b4d7d32c 100644 --- a/firmware/libboard/common/source/board_lowlevel.c +++ b/firmware/libboard/common/source/board_lowlevel.c @@ -127,6 +127,9 @@ extern WEAK void LowLevelInit( void ) SUPC->SUPC_SMMR = SUPC_SMMR_SMTH_3_0V | SUPC_SMMR_SMSMPL_CSM | SUPC_SMMR_SMRSTEN_ENABLE; + /* disable ERASE pin to prevent accidental flash erase */ + MATRIX->CCFG_SYSIO |= CCFG_SYSIO_SYSIO12; + /* enable both LED and green LED */ PIOA->PIO_PER |= PIO_LED_RED | PIO_LED_GREEN; PIOA->PIO_OER |= PIO_LED_RED | PIO_LED_GREEN;