Use IAR to debug mini2440 favorites
Use IAR to debug mini2440 and prepare to play streaking first
I used IAR debugging environment when I used to develop lpc2214. I felt very good. At that time, I was wrong about this development environment.
Because the LPC can configure the JTAG pin as a normal Io
I accidentally set him to I/O at the time, causing IAR to fail to execute in a single step. I thought the environment was not good. At that time, due to blocking the JTAG port, the JTAG port was unavailable after the download. I used serial ports to erase Flash files and then burned the files. Later I recalled that it was a bit silly (I mistakenly thought the chip was encrypted at the time, can only be erased via serial port), at that time there is no need to use serial port erasure program. In fact, the JTAG port is shielded and the ISP enable pin of the chip is shorted. Then the Chip starts from the internal bootloader, and then flashloader can download the program.
When developing LPC, note that if memmap settings are incorrect, when an interruption occurs, it will jump to a wrong place, causing the interruption and debugging to fail. For this reason, I suspected that IAR could not be debugged. Later I found that I was totally wrong.
Later, I got into touch with some of Samsung's films and learned about the role of MAC files. Mac files are files used to configure arm registers before compiled binary files are downloaded to hardware, for example, if 2440 has an on-chip SDRAM Controller and the SDRAM register is disabled by default after power-on, the program cannot be downloaded to ram If You Want To debug the program in Ram. Therefore, you must configure the SDRAM Controller before downloading the file.
I first ran a RAM program in Ram. The Mac file is as follows:
Execuserflashinit ()
{
_ Writememory32 (0x00000000, 0x53000000, "Memory ");
_ Writememory32 (0 xffffffff, 0x4a000008, "Memory ");
_ Writememory32 (0x000007ff, 0x4a00001c, "Memory ");
_ Writememory32 (0x00000000, 0x53000000, "Memory ");
_ Writememory32 (0x000055aa, 0x56000050, "Memory ");
_ Writememory32 (0x00000007, 0x4c000014, "Memory ");
_ Writememory32 (0x00ffffff, 0x4c000000, "Memory ");
_ Writememory32 (0x00061012, 0x4c000004, "Memory ");
_ Writememory32 (0x00040042, 0x4c000008, "Memory ");
_ Writememory32 (0x22111120, 0x48000000, "Memory ");
_ Writememory32 (0x00002f50, 0x48000004, "Memory ");
_ Writememory32 (0x00000700, 0x48000008, "Memory ");
_ Writememory32 (0x00000700, 0x4800000c, "Memory ");
_ Writememory32 (0x00000700, 0x48000010, "Memory ");
_ Writememory32 (0x00000700, 0x48000014, "Memory ");
_ Writememory32 (0x0007fffc, 0x48000018, "Memory ");
_ Writememory32 (0x00018005, 0x481_1c, "Memory ");
_ Writememory32 (0x00018005, 0x48000020, "Memory ");
_ Writememory32 (0x008e0459, 0x48000024, "Memory ");
_ Writememory32 (0x00000032, 0x48000028, "Memory ");
_ Writememory32 (0x00000030, 0x481_2c, "Memory ");
_ Writememory32 (0x00000030, 0x48000030, "Memory ");
}
Set the starting address in the ICF file to the address of SDRAM, and then the program can be downloaded, run, and debugged.
We haven't figured out how to use flashloader to download files to external flash. By referring to LPC debugging, we found that, whether downloaded to flash on or off-chip Flash, flashloader must first download a program. the out file is downloaded to the ram of the film, which is similar to the hjtag. When hjtag is downloaded, You need to specify the starting address of Ram. The download principles of these two tools are the same, to add program B to flash, you must first download a compiled binary program A to the internal RAM of the film, use the program a to download program B to flash.
IAR flashloader provides a lot of film a programs, such as LPC Series A programs, but for 2440 there is no such program, you need to write, if you do not implement it yourself, you can use hfalsher of hjtag for writing.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/dog0138/archive/2008/11/18/3321361.aspx