Skip to content

Commit b29fa51

Browse files
committed
memory/spi-mem: add spi memory api calls to protect the memory
This adds api calls to lock/unlock and write a protected area of the memory.
1 parent 53b30bd commit b29fa51

File tree

6 files changed

+722
-32
lines changed

6 files changed

+722
-32
lines changed

src/bootloader/startup.c

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
#include "bootloader.h"
16+
#include "memory/spi_mem.h"
1617
#include "mpu_regions.h"
1718
#include "platform_config.h"
1819
#include "platform_init.h"
@@ -55,6 +56,7 @@ int main(void)
5556
#ifdef BOOTLOADER_DEVDEVICE
5657
qtouch_init();
5758
#endif
59+
spi_mem_protected_area_lock();
5860
bootloader_jump();
5961

6062
const uint8_t* hww_data = NULL;

src/firmware.c

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "firmware_main_loop.h"
1818
#include "hardfault.h"
1919
#include "memory/bitbox02_smarteeprom.h"
20+
#include "memory/spi_mem.h"
2021
#include "platform/platform_config.h"
2122
#include "platform_init.h"
2223
#include "qtouch.h"
@@ -36,6 +37,8 @@ int main(void)
3637
qtouch_init();
3738
common_main();
3839
bitbox02_smarteeprom_init();
40+
spi_mem_test();
41+
spi_mem_protected_area_lock();
3942
firmware_main_loop();
4043
return 0;
4144
}

0 commit comments

Comments
 (0)