Http://blog.chinaunix.net/uid-27106528-id-3478821.html
Use the struggling UCOS + ucgui routine in the project to find undefine symbol _ use_two_region_memory and so on. After checking, we find that it is a startup of our own.
File, replace it with the v3.5 Startup File, and change the pendsv_handler and javasick_handler. Then, no error is reported,
The premise of porting ucgui is that it has the LCD Driver function, which can light up the LCD screen, and implement the painting point and obtain the color value of the specified point. Generally, the display supplier will provide the corresponding driver function. The initialization function void LCD _init (), the screen point function void LCD _drawpoint (X, Y, color), and the method for obtaining the color value of the specified point (X, y) function. The key to porting is to match these three functions with the interface functions provided by ucgui.
Open lcddummy in Gui \ lcddriver. in the c file, find the int LCD _l0_init (void) initialization function, LCD _l0_setpixelindex (int x, int y, int pixelindex), unsigned int LCD _l0_getpixelindex (INT X, int y) read the color value function and fill in the LCD Driver function, for example:
The definition of the LCD configuration must be modified based on the selected screen size and color depth. There are many instructions on the network, which are not repeated here.
Make a record of some issues I encountered in Keil uvision4.
During compilation, the. \ output \ TFT touch screen. axf: Error: l6218e: Undefined symbol exit (Referred From jerror. O) error occurs.
I found some answers on the network, saying that the microlibrary cannot be used in the compilation configuration options, for example:
After removing this option, I found that the compilation was successful. Download to the development version, always cannot run, debugging found that the hardware error handling interrupt void hardfault_handler (void) was started.
So I selected the micro-database and went to ucgui/JPEG/jerror. in C, locate exit (exit_failure) in the error_exit (j_common_ptr Cinfo) function, comment out this line, and use return to return directly.
Re-compile and pass. Download to the Development Board to run properly.
Summary: I used the demo of the Struggle routine UCOS + ucgui. After I used printf, I chose LDR r0, =__ main without using microlib, single-step debugging may fail at full speed. then I chose use microlib and found many errors, such as _ use_two_region_memory. I found that the struggling startup file was written by myself. Then I changed the v3.5 Startup File, and because it was transplanted UCOS, I changed pendsv_handler and javasick_handler according to his startup file, the error just disappeared, but another ucgui-related error was reported because the ucgui was transplanted,
The exit in/JPEG/jerror. C is undefined, and the line is commented out directly, and the return is successful. Now printf can be used normally.