LPC2200 series Bootloader Implementation process:

Source: Internet
Author: User

Space

LPC2200 Series Bootloader implementation process:

There are similar implementations on the Internet, with NXP's official offer, this easy to obtain, on the Lpcware website can download the latest version, relatively speaking, this is a relatively complete project. And Zlg, AN070701, I looked at it, as if it was boot, and application in a project, this for me, not quite suitable, I want to do is two independent project, a boot, an app, but the above approach principle is the same, and there are many online users to do their own transplant , I also downloaded some to see, mostly directly or indirectly using NXP, or ZLG program. After comparison, I decided to use NXP's example.

bootloader principle is boot boot, first determine whether there is a firmware need to upgrade from the serial port, if there is a serial port to download the firmware, the download is complete, the firmware through the IAP burned in the 0x00010000flash address, and then jump to 0x00010000 address, Executes the application.

Basic principles are this, understand the principle, can be easily changed from the network port, from the SD card, start the application, the whole transplant process is smooth, unexpected smooth, I drop off the bottom transceiver function after the transplant, soon can use, but I am not satisfied with the "official boot" Serial transceiver is a blocking way, as if very backward, I use the LPC1788 on the non-blocking mode of receiving and sending. However, the official boot function is relatively perfect, there are a few commands, using a good.

after half a month, suddenly found a very hidden problem, when I add a second network on the LPC2294, the time of the crash, the unit tracking also followed, but still can not find the problem. Search on the Internet, found that a few people have encountered a similar problem, "through the custom bootloader start the application, not the timing of the crash", the phenomenon is similar to the performance of a number of printf (), my This is plus a second network port driver crashes; But there is one thing in common " Have used a custom bootloader ", the process of locating the problem is" painful and long ", first I am sure my application is not a problem: I directly put my application burned in the address of 0x00000000, start the board, no panic, from this basically concluded that my application is not a problem.

but basically the problem locked on boot, but the boot is officially given, there should be no problem, since the use, I rarely doubt the official online program, such as NXP, I only have to study. So I press the program of a classmate on the net, the 0x00000000-0x00010000 this range of flash space to fill 0x00, the application burned in 0x00010000 place, (Note: Interrupt vector table also to be copied to the SRAM (0x40000000) place), For a long time, I was wondering if there was a problem with the interrupt vector table. So the board on the power, the first implementation of the 64k NOP instruction, until the 0x00010000 application, so testing, or no problem, this means that my interrupt vector table remapping to SRAM is no problem, so that you can basically judge the boot out of the problem, The above ideas are basically friends of the line of thought, I do here, suddenly have a sense of inspiration, is not boot to the app jump when there is a problem, immediately test, sure enough to find the problem, in the power-on reset when the LPC2294 is the kernel is in the SVC state, and Boot jump to the app, in the USR state, this usr state, a lot of register operation is not valid, compared to the design of stacking and so on invalid operation, the end result in the app just started a piece of assembly code is not executed correctly, this for the subsequent crash buried the foreshadowing.

It's really nice to find such a hidden mistake, thanks to netizens for doing so much research,

once again, God always gave me a favor when I was about to give up.

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.