- To learn ARM assembly development by recreating an existing project, enhancing my skills in low-level programming and embedded systems.
- To develop a secret manager HSM capable of storing sensitive information such as passwords, IDs, encryption keys, and any digital indentity data. The project will primarily be developed in ARM assembly, with fallback to C when necessary.
- STM32L452RE-P (Nucleo)
- ST25R3916 (NFC Controller)
- EEPROM (Component yet to be determined)
- Other security components (to be added)
- Toolchain:
arm-none-eabi
- Debugging:
OpenOCD
,GDB
- Connect the Nucleo board to the pc.
- Flash and debug the firmware using two terminal windows:
$ openocd -f interface/stlink.cfg -f target/stm32l4x.cfg /* connect to the stlink */ $ arm-none-eabi-gdb /* start gdb sever (with preset commands set in .gdbinit) */ (gdb) ni /* go to the next instruction in the program */
Get comfortable with programming the Nucleo-L452RE-P in ARM assembly.
-
Learn how functions work in arm asm:
- Write a simple delay(ms) function. (Done)
- Write a function to enable a LED. (Done)
- Write a function to disable a LED. (Done)
-
Develop Blinky:
- Write ARM assembly code to control an LED on the Nucleo board. (Done)
- Configure GPIO registers in assembly to blink the LED. (Pending)
-
Establish a full memory map header file of the mcu
Gain understanding of GPIO control and ARM assembly basics, setting a foundation for more complex hardware interactions.
Implement a serial communication interface between the Nucleo-L452RE-P and your PC for debugging and data exchange.
-
Understand UART Communication:
- Learn UART protocol basics: baud rate, data bits, stop bits, and parity.
- Study UART registers on the STM32L452RE and how to configure them.
-
Write UART Driver in Assembly:
- Configure UART peripheral registers and set up an interrupt or polling mechanism for sending/receiving data.
- Test serial communication with a terminal emulator (
minicom
,screen
).
Gain familiarity with serial communication, register-level programming, and interrupt handling.
Establish communication with a security EEPROM (e.g., Microchip ATECC608A or STMicroelectronics M24LR64-R) using I2C.
-
Learn I2C Protocol:
- Study I2C (start/stop conditions, addressing, read/write operations).
- Learn how to configure I2C peripherals on the STM32L452RE.
-
Develop I2C Driver in Assembly:
- Write assembly code to initialize and communicate with an I2C device (EEPROM).
- Implement read/write operations to/from the EEPROM.
Learn I2C communication, register-level hardware configuration, and EEPROM interaction.
Establish communication with the ST25R3916 NFC controller to perform basic read/write operations.
-
Understand NFC Communication:
- Study NFC protocols (ISO14443, ISO15693) and the ST25R3916 functionality.
- Learn how to communicate with the NFC controller via SPI or I2C.
-
Develop SPI/I2C Driver for NFC:
- Write ARM assembly code to initialize and communicate with the NFC controller.
-
Perform NFC Operations:
- Implement basic NFC read/write commands for tags or data transmission.
Understand NFC protocols, develop SPI/I2C communication, and handle complex peripherals.
Implement secure data storage and key management functions for the HSM.
-
Memory Management and Data Structures:
- Implement data structures in assembly for storing secrets (passwords, keys, etc.).
-
Encryption and Decryption:
- Learn symmetric and asymmetric cryptographic algorithms (AES, RSA).
- Implement encryption/decryption using hardware cryptography from EEPROM or in assembly.
-
Access Control:
- Implement password-protected access to stored data, ensuring only authorized users can retrieve secrets.
Securely store and retrieve data, implement encryption, and understand key management.
Integrate NFC to manage identities and secure communication within the HSM.
-
Store and Retrieve Identity Information:
- Interface EEPROM and NFC to store/retrieve identity cards, passwords, or encryption keys.
-
Implement Security Protocols:
- Use encryption, authentication, and NFC capabilities to secure data transmission.
-
Optimize Assembly Code:
- Optimize your assembly code for size and speed, optionally using C for complex logic.
Achieve a full HSM with identity management and secure NFC communication.