2044 views|0 replies

6579

Posts

0

Resources
The OP
 

F28335 Learning Series 1 - How to move FLASH to RAM and run [Copy link]

I have been studying 28335 for a while, and every time I have this feeling: "There are too few materials explaining F28335!" Especially when I encounter difficulties in using F28335, I often have to use Baidu, Google and other major search engines to find some scattered information. The Chinese materials of TI C2000 series DSP sold in stores are mostly 2407 and 2812, and there are no Chinese materials that fully explain 28335 (I don't know if I haven't found it, if you have, please leave me a message). I now have a reference book: <>, Electronic Industry Press, which talks about several modules of 28335. Comrades who have just started learning can refer to it. There are two main methods of learning, theoretical learning and practical learning. Before formally explaining the content of this section, I would like to emphasize that I have not introduced very complicated theoretical knowledge in these words, nor have I explained the principles in detail. I have only passed on a method that can help you solve the problem. Of course, I am not emphasizing that theoretical knowledge is not important, because if the theory and the method are introduced here, I am afraid that each aspect will not be explained clearly, and it seems to be more difficult. Theoretical knowledge always reminds me of a series of complex formulas. This section teaches you how to move the program running in FLASH of F28335 to RAM for operation. Anyone who has used or is currently using TI DSP knows that DSP programs can be run in RAM or in FLASH. There are certain differences between the two: (1) The former is connected to the emulator when the program is running, while the latter is disconnected from the emulator; (2) The former will lose the program when the power is off, while the latter will not; (3) The former runs faster, while the latter runs slower; (4) The space size of the two may be different (depending on the chip model); (5) The former has no limit on the number of burns, while the latter does; Therefore, running in RAM is suitable for the initial debugging of the project, which is convenient and quick. When the final program is fully debugged and made into a product for sale, the program can be burned into FLASH (in special occasions, such as when doing high-voltage experiments, you can consider burning the program into FLASH for debugging). Among the 5 points above, I emphasized the 3rd point. In an actual project, the running speed of the program is of great concern. I have compared the running of the program in FLASH and the running of the program in RAM for F28335. The running time of the same code in FLASH and RAM is as follows: Table 1 Differences between running programs in FLASH and RAM A section of program code Running time Running in RAM 5us Running in FLASH 25us As can be seen from the above table, running a program in RAM is nearly 5 times faster than running a program in FLASH (only for F28335, not necessarily applicable to other chips), so finding a method to increase the running speed of the program in FLASH is very helpful to improve the overall performance of the program. Through the efforts of many predecessors, we finally found a method: burn the program into FLASH, and move the program to RAM when power is on. This not only meets the requirements of not losing the program when power is off, but also meets the requirements of high program running speed, which can be said to kill two birds with one stone. After I encountered this problem, I was very interested in this method and wanted to give it a try. I looked for a lot of information (including theory and practice) and fumbled for a day without any clue. I could also burn it in with the TI FLASH routine, but the program was not executed correctly. I was a little discouraged at first, but I didn't give up. I continued to study for a day and found that the routines given by TI and some enthusiastic netizens on the Internet all moved the specified code to FLASH. It can be completed by: #pragma CODE_SECTION(function name, "memory entry address"); statement. It feels very simple, but I just can't debug it. Finally, I suddenly remembered that I couldn't do it this way and find a method that can move all programs to RAM. ... The ellipsis in the middle is the process of my struggle. I talked about it before I started. I wrote these words to share a method with everyone. As for the process of research and struggle, I won't describe it in detail, otherwise I'm afraid that I can't explain it clearly even if I say dozens of pages. Next, I will teach you step by step how to build a project that can move the program in FLASH to RAM when it is powered on. 1. Create a project; (how to create it is omitted) 2. Replace the "DSP2833x_SysCtrl.c", "DSP2833x_usDelay.asm" and "DSP2833x_CodeStartBranch.asm" files in the source file (source) of the project (if you are using the files provided by TI, these four files are the ones) with "DSP28xxx_SysCtrl.c", "DSP28xxx_usDelay.asm" and "DSP28xxx_CodeStartBranch.asm" respectively. In addition, add the "DSP28xxx_SectionCopy_nonBIOS.asm" file to the project; Note: "DSP28xxx_SysCtrl.c", "DSP28xxx_usDelay.asm", "DSP28xxx_CodeStartBranch.asm" and "DSP28xxx_SectionCopy_nonBIOS.asm" 3. Add CMD: "DSP2833x_Headers_nonBIOS.cmd" and "F2833x_nonBIOS_flash.cmd". If there are already CMDs in the project, replace them with these 2. Note: "DSP2833x_Headers_nonBIOS.cmd" and "F2833x_nonBIOS_flash.cmd" also 4. Compile and burn.

This post is from Microcontroller MCU
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

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