Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DM_HttpServer DM_USBHost
Dependents: lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more
Fork of DMSupport by
Diff: Memory/InternalEEPROM.cpp
- Revision:
- 41:e06e764ff4fd
- Parent:
- 34:fc366bab393f
- Child:
- 42:bbfe299d4a0c
--- a/Memory/InternalEEPROM.cpp Wed Jun 10 09:54:15 2015 +0000
+++ b/Memory/InternalEEPROM.cpp Wed Oct 23 06:59:29 2019 +0000
@@ -123,20 +123,25 @@
void InternalEEPROM::init()
{
if (!_initialized) {
+
+ // The EEPROM peripheral is in ROM address space. Must allow
+ // writes to this address space.
+ mbed_mpu_manager_lock_rom_write();
+
// Bring EEPROM device out of power down mode
powerUp();
-
+
// Setup EEPROM timing to 375KHz based on PCLK rate
uint32_t clk = SystemCoreClock;
LPC_EEPROM->CLKDIV = SystemCoreClock / 375000 - 1;
-
+
// Setup wait states (ticks needed for 15ms, 55ms and 35ms)
uint32_t val;
val = ((((clk / 1000000) * 15) / 1000) + 1);
val |= (((((clk / 1000000) * 55) / 1000) + 1) << 8);
val |= (((((clk / 1000000) * 35) / 1000) + 1) << 16);
LPC_EEPROM->WSTATE = val;
-
+
_initialized = true;
}
}
