2410 5th of bare board debugging notes (unorganized and possibly incorrect)

Source: Internet
Author: User

Continue before connection

The Flash Programming Algorithm in the MDK Toolkit can be used to operate the nor or NAND. The NAND on the Development Board is k9f 1208 64 mb nand.
The Flash algorithm that comes with MDK does not include any. You can add a new programming algorithm for k9f1208, but put it in the ../flash directory.

The level of the project written in Flash is as follows:
Device description
Flashdev. c
Program functions
Flashprg. c
Flashhw. c

The hierarchy is clear, but I have a question:
I can see that both flashdev. C and flashprg. C contain a header file flashos. h.
The flashos. H mainly contains global variable settings, data structure establishment, and function declaration for some NAND operations.
When we use the flash download function on MDK, why does MDK use ulink2 to operate NAND? In this process
What mechanism does MDK use to call functions of NAND to operate on NAND?
My guess: the MDK uses the flashos. h file. This flashos. H is directly linked to the MDK. How can this problem be solved.


I have rewritten the nandflash programming algorithm again, But now I find that there is still a flash timeout error message. After using the LED Positioning method, I found that
The checkblock_hw () function in the findblock () function has a problem, and it never returns nand_ OK,
However, no problems were found after reading checkblock_hw (ADDR,The NAND of sumeda ensures that the 1stblock starting with the block is definitely not a bad block.

Added the serial port display function to provide more debugging information for me to locate the problem;


The problem has been solved. After analysis, there must be a problem with the built-in flash programming algorithm, because nandflash can ensure that block0 must be a good block.
,
That is to say, the 517th bytes of the page0 or page1 of block0 must be 0xff, but the block0 is still a bad block. Obviously there is a problem, through comparison
Datasheet finds that the built-in program processes nfdata as a 32-bit register, but in fact nfdata is 16-bit and the low 8-bit value is valid. Therefore, you need to use nfdata
After processing according to this idea, it is normal to burn and write NAND.


(But there is a problem. When I use full chip erase, The Flash timeout error occurs when a certain address is reached)

However, my trojan program is not running normally after being burned to NAND. It is always on (and should be flashing regularly). It is estimated that the cause is a problem in the startup code ??? (The process of moving RW and Zi data to ram is missing)
Let's analyze:
Vectors ldr pc, reset_addr // after power-on, place the Reset vector at the 1st position pointed by the PC pointer
Ldr pc, undef_addr
Ldr pc, swi_addr
Ldr pc, pabt_addr
Ldr pc, dabt_addr
NOP; reserved Vector
Ldr pc, irq_addr
Ldr pc, fiq_addr
If the debugging is performed in SDRAM (0x30000000) and the PC points to 0x30000000 after startup, put the Reset vector address on 0x30000000 and the UNDEF vector address on 0x30000004, and so on (this sentence seems wrong ).

Intvtaddress equ 0x33ffff20

Once the debug status is entered, SP = 0x31000480? Why is this value?

When debugging in the MDK, it is found that this tool has a disadvantage, because during the debugging in Ram, you need to design a debugging configuration script in advance, which requires the axf file, however, if the path of its axf file is incorrectly set, there will be no error prompts during compilation and debugging. This is for users

This is not a problem. It usually takes time to locate the error? We hope the MDK can be improved.

Now you are debugging UART. Now you must first use the test program in 2410. uart0 and 1 on the Development Board are running normally.
[
1. On this basis, read the UART program to understand the principle (what mode is used ).

2. Sort out the UART module as part of the SDK in the future.

3. added the UART input response function, such as pressing P to start programming.
4. master its variable parameter functions"


Uart_printf (...)"(Online digest:

Http://blog.csdn.net/ZhouHM/archive/2004/04/07/14721.aspx)

]

As far as I know, I have written boot to NAND on the Development Board. there are several bin methods. The MDK automatic method is only one of them. Now I want to write nandflash by running the nandpro program in SDRAM, uart0 is used to print the process information during the burning process.
After the check is OK, print "NAND (k9f 1208) program done OK"
Currently, a problem occurs. When you check whether the first block is a bad block, the returned result is actually a badblock. This is definitely an error. I/O is not configured properly.

By carefully checking the code, you can still find the cause and continue to find the cause ......
The cause of this problem has been found. It turns out that all the NAND control registers have forgotten the configuration and the operation is OK !!!

But I am a little pleased that 2410init. S + led. after the binfile generated by C program is downloaded to block0 of NAND, it can be run (from ulink2, but this program is very small, 1.55kb )~.. ~

Then I felt like putting 2410 of Mon. bin (34kb) is downloaded to NAND. During verification, the contents missmatch error is prompted at 0x4000. Note that the 0x4000 address is 16384 = 512*32, is there any connection between them? To be checked

Is there any defect in Flash programming algorithms when using MDK to burn a binfile larger than a block size? Or does the MDK software limit the burning function? Nnd

After a week, I fail to call 2410. Now I am back !!! Now, the company does not have a development board at hand. You can only find it. Debugging depends on UART Printing program information.
The serial port settings are also added to the programming algorithm and a macro definition is added.
When the serial port is added, if





Void
Uart_printf (char * FMT,...) Variable Parameter Function, the compilation times the error "l6967e: entry point (0x00000000)
Points to a thumb instruction but is not a valid thumb code
Pointer "does not know why,
So this variable parameter function is not added for the moment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.