1. Encryption principle description
The LPC2100 series ARM7 microcontroller is the world's first ARM chip that can be encrypted. The method of encrypting it is to set the specified data at the specified address through the user program. PHILIPS stipulates that for the LPC2100 chip (except LPC2106/2105/2104), when the data at the FLASH address 0x000001FC on the chip is 0x87654321, the chip is encrypted. After the encryption is set, the JTAG debugging interface is invalid, and the ISP function only provides the functions of reading ID and erasing the entire chip. Note: Download the program with encryption settings to the internal FLASH of the chip, and the encryption will take effect after the next system reset.
2. Encryption program implementation
In order to implement encryption settings, users must ensure that data 0x87654321 is defined at 0x000001FC. Let's first analyze the program structure with encryption settings, as shown in Figure 1. Address 0x000000~0x00000020 is the exception vector table. If the LDR instruction jump is used in the vector table, each exception service entry address can be defined between 0x00000020~0x00000040; after the exception vector table and before the 0x000001FC address, this small space can be used to write some initialization code or FIQ interrupt handler; then use NOP instructions to fill until the 0x000001FC address, define data 0x87654321 at this address, and the user's other program code follows.
Exception Vector Table
Partial initialization code
or
FIQ interrupt handling
NOP
NOP
…
DCD 0x87654321
User Code
The implementation of the encryption program is in the startup code Startup.s file of LPC2100, as shown in Listing 1. The program first uses the IF pseudo-instruction to determine whether the EN_CRP global variable has been defined. If it has been declared, the code in Listing 1 (2) to (8) is compiled to perform encryption settings. Note: The EN_CRP global variable can be predefined in the assembler or declared using GBLA/GBLL at the beginning of the file.
Program Listing 1 (2) is used to determine whether the current code address exceeds 0x000001FC. If it exceeds, the INFO pseudo-instruction is used to display an error message, see Program Listing 1 (3). Program Listing 1 (5) to (7) are used to fill NOP instructions until 0x000001FC. Program Listing 1 (8) is to define data 0x87654321 at the address 0x000001FC to implement encryption settings.
0x00000000
0x00000020
0x000001FC
Program Listing 1 LPC2100 encryption program implementation code;
Exception Vector Table
…
…
IF
EF: EN_CRP (1)
IF . >= 0x1fc (2)
INFO 1,"nThe data at 0x000001fc must be 0x87654321.nPlease delete some source before this line." (3)
ENDIF (4)
CrpData WHILE . < 0x1fc (5)
NOP (6)
WEND (7)
CrpData1 DCD 0x87654321 (8)
ENDIF (9)
3. Encryptable targets in project templates
When a project created using the LPC2100-specific project template uses the RelInFLASH target, a program with encryption settings will be generated.
For the Thumb Executable Image for UCOSII (for lpc21xx) project template, when the ThumbRelInFLASH target is selected, a program with encryption settings will be generated.
Previous article:Design of X86 decoding SOC architecture based on ARM embedded platform
Next article:Dynamic Configuration of Interrupt Vector Table in ARM Embedded System
Recommended ReadingLatest update time:2024-11-16 22:45
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【National Technology N32G430】Review ~ Light up the digital tube and serial port printing, ADC
- How to receive 0x00 in serial communication
- Take a look: Ulead Oscilloscope and Macosim Oscilloscope Actual Video (Transferred)
- EEWORLD University ---- Matlab Simulink Communication System Simulation
- OMRON EE-SPX613 working principle and action signal indicator
- Seeking to solve the USB interface interference problem of Explorer
- Wireless technologies related to 802.11ax
- Prize Registration | Avnet invites you to participate in the 2022 International Industrial Expo! (November 30-December 4, Shanghai)
- LPS22 MakeCode extension (driver)
- [15th Anniversary] Points Exchange - The last round of chip currency exchange, chip points are officially launched!