8088 views|0 replies

71

Posts

0

Resources
The OP

Design of Encryption Fuse for MSP430 Microcontroller [Copy link]

Introduction The MSP430 series microcontroller is a 16-bit ultra-low power microcontroller launched by Texas Instruments (TI). It can operate under the conditions of 1.8~3.6 V voltage and 1 MHz frequency, and the current consumption is 0.1~400μA. In terms of computing speed, the MSP430 series microcontroller can achieve a 125 ns instruction cycle under the drive of an 8 MHz crystal oscillator. The 16-bit data width, 125 ns instruction cycle and multi-functional hardware multiplier can realize certain algorithms for digital signal processing (such as FFT, etc.). In terms of integration, the MSP430 series microcontroller integrates a large number of CPU peripheral modules into the chip, including the following modules: watchdog (WDT), analog comparator, serial port, hardware multiplier, LCD driver, 10-bit/12-bit/14-bit ADC, port 0~6, basic timer. Among them, timers A and B are equipped with multiple capture/compare registers, and can realize multi-channel PWM output at the same time; analog comparator and timer can cooperate to realize ADC conveniently; LCD drives up to 160 segments; hardware ADC module realizes 10-14 bits of high-speed and high-precision conversion at a rate of less than 10 μs, and provides sampling/holding and reference voltage at the same time; ports 0, 1, and 2 can receive external rising or falling edge interrupt input. There are many technical solutions for the development and debugging of MSP430 series microcontrollers, among which JTAG and BOOTSTRAP (referred to as "BSL") are the most convenient. For the simulation of the initial development of Flash-type MSP430 microcontrollers, only one PC and one JTAG controller are needed. Entering the product-level development stage, in order to protect the user code, after the protection fuse of Flash is burned, the microcontroller can no longer be accessed through the JTAG port. At this time, the user can only check or update the program in Flash through BOOT-STRAP. There is no need to worry about the user code being leaked. BOOTSTRAP provides 32-byte 256-bit password protection, which can fully ensure the security of the code. 1 Fuse encryption principle The MSP430 series microcontrollers use JTAG (actually called IEEE1149.1 or boundary scan) interface technology to access all the memories of the microcontroller, including program Flash, ROM, and RAM, and can erase, read, and write them. It can be used to download programs, monitor program usage and the usage of various variables and registers, and can modify them. The JTAG interface requires 4 signal lines, ground lines, and power lines. The JTAG interface brings great convenience to program debugging, simulation, and monitoring, greatly improves programming efficiency, and shortens the development cycle; but when the program test is completed and converted into a product to be launched on the market, the program code must be encrypted to prevent the leakage of the program code. The security of the JTAG interface is very poor. As long as the controller that meets the JTAG standard can read the program code, the JTAG function must be disabled. For the MSP430 series microcontrollers, the way to disable the JTAG function is to blow the encryption fuse inside the microcontroller. After the fuse is blown, the microcontroller can no longer use the JTAG function, thereby achieving the purpose of encrypting the program code. The MSP430 series microcontroller will detect the fuse through the TDI/TCLK terminal during power-on reset. When the fuse is intact, a current of 1 mA will flow between TDI/TCLK and ground. The fuse detection occurs on the first falling edge of the TMS terminal after the power-on reset. The fuse detection will be released on the second falling edge until the next power-on reset. The fuse detection will be performed again, that is, the fuse will be detected at every power-on reset. The fuse detection current will only flow through the TDI/TCLK terminal when the fuse detection mode is in effect. When the fuse current cannot be detected, the JTAG function will fail. This encryption method is hardware encryption. Once the fuse is blown, the JTAG function will be permanently invalid, and the microcontroller can no longer be accessed through the JTAG port, thereby ensuring the security of the code in the microcontroller. 2 Timing and method of fuse encryption The fuse of MSP430 microcontroller must be blown under specific conditions. Simply adding 6.5 V voltage to the TDI/TCLK terminal will not blow the fuse. It must be completed under certain timing and instructions. Below are the instructions and timing required to blow the fuse: IR_SHIFT("IR_CNTRL_SIG_16BIT") is to switch JTAG into 16-bit data receiving mode; DR_SHIFT_IN(0x7201) is to switch the TDO signal to TDI function, and the TDI signal is released to prepare for the connection of the fuse voltage Vpp; IR_SHIFT("IR_PREPARE_BLOW") is to set the MSP430 into the fuse blowing mode; MsDelay(1) is to delay 1 ms, and connect the fuse voltage Vpp to the TDI signal terminal at the same time; TR_SHIFT ("IR_BX_BLOW") is to execute fuse blowing; MeDelay (1) is to delay for 1ms, and disconnect the fuse voltage Vpp at the TDI terminal at the same time, the TDI signal terminal switches back to the TDI function, and the JATG state machine is reset. The fuse encryption is completed. 3 Design and implementation of the fuse encryptor The fuse encryptor can realize the programming, fuse burning and BSL download of the MSP430 Flash microcontroller. You can choose whether to blow the fuse in the chip after programming for encryption; you can set the password yourself to completely protect the chip content; you can perform complete erase programming and retention programming, and read the code in the target CPU through the BSL method. The hardware of the fuse encryptor uses MSP430F1111A as the system chip to realize the communication control of the target JTAG port, the loading and separation of the fuse voltage Vpp, and the control of the fuse blowing command in the target MSP430 microcontroller. In the power supply part, the fuse voltage Vpp and the 100 mA fuse current are realized by connecting a diode IN4001 in series between the 7806 three-terminal voltage regulator chip and the ground; the loading and separation of the fuse voltage Vpp are realized by the on-off of the relay, and 3 LEDs are used to indicate the status of the target microcontroller fuse being not blown, being blown, and blown. The software part uses C language to realize the data communication and command control between the fuse encryptor and the target microcontroller. The following is the main program of the encryption fuse: http://www.dzsc.com/data/uploadfile/20071011161149702.jpg http://www.dzsc.com/data/uploadfile/20071011161149497.jpg http://www.dzsc.com/data/uploadfile/20071011161149546.This encryption fuse has achieved very ideal results in practical applications. It can reliably and effectively fuse the fuse of the MSP430 series microcontroller, completely protecting the code security in the MSP430 microcontroller. The cost of the entire system is controlled at around 30 yuan, and it achieves very good economic and social benefits in actual use. Conclusion This system can be applied to the entire MSP430 series microcontroller, with powerful functions, reliable performance, low cost, and small size. It can completely replace the programmer currently priced at 1,000 to 2,000 yuan on the market, and has a very broad application prospect and promotion value. If you want to learn more about IC information, you may log on to China Electronics Market Network and have a look---
This post is from Microcontroller MCU

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    About Us Customer Service Contact Information Datasheet Sitemap LatestNews

    Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list