10 years, 3 months ago.

FRDM-KL25Z

I am using FRDM-KL25Z board to drive mikroTFT LCD module. I download .ZIP package from this webpage http://mbed.org/users/dreschpe/code/SPI_TFT_ILI9341/ and load the package to project and it won't compile.

first it complains that P5, P6 ... not defined

I added this in main

"PinName p5, p6, p7, p8, p9, p10;" I am not sure I did this correctly. this is my first time use this platform.

SPI_TFT_ILI9341 TFT(p5, p6, p7, p8, p9, p10,"TFT"); mosi, miso, sclk, cs, reset, dc

then it complain Error: "No space in execution regions with .ANY selector matching graphics.c.KL25Z.o(.data). " Error: Sections of aggregate size 0x49e8 bytes could not fit into .ANY selector(s).

has anyone run this project through this Freescale platform.

any suggestion and advice are welcome and appreciated dsun@asantesolutions.com

Hello,

the library should be generic, so problems whihc you are having are with the demo which is for another target.

SPI_TFT_ILI9341 TFT(p5, p6, p7, p8, p9, p10,"TFT"); // mosi, miso, sclk, cs, reset, dc

You have to change above code to pinNames for KL25Z (like PTA15, PTB4, .. etc). Find MOSI, MISO and other SPI pins, redefine the parameters and you should be good to go.

Regards,
0xc0170

posted by Martin Kojtal 28 Jan 2014

thank you for fast response.

update code and same error message the TFT is connected to SPI pin 11-14/

SPI_TFT_ILI9341 TFT(PTD6, PTD7, PTD5, PTD4, PTA20, PTA13,"TFT"); mosi, miso, sclk, cs, reset, dc

Error: No space in execution regions with .ANY selector matching graphics.c.KL25Z.o(.data).

Error: Sections of aggregate size 0x49e8 bytes could not fit into .ANY selector(s).

the comment posting is interesting, what you post is not what you see.

posted by david sun 28 Jan 2014

2 Answers

10 years, 3 months ago.

The first one is indeed what 0xc0170 said, you have to define which pins you use in your specific setup.

Problem 2 means there is no space to store data, specifically in the SRAM. The problems is graphics.c (also mentioned in the error). It is a bitmap, and it takes more memory than the KL25Z has SRAM. The good news: there is no reason why that should be in the SRAM. Put in the graphics.c file 'const' at the beginning, so const unsigned char. This tells the compiler it will never change, and it will be placed in flash memory, of which you have alot more (still this code is also pretty flash hungry, but enough is enough). Then that problem should be fixed.

If you try to compile you get another one. (As you notice, this one was made for another board, in principle the code works between mbed boards, but there are restrictions you sometimes run into). It complains about localfilesystem, something the LPC1768 does have, and the KL25Z doesn't have. Double click it, and it goes to a function. Remove everything in the function (that one writes in image from the localfilesystem, which you don't have). Nicest is to completely remove the function from the .cpp and the .h file, but it will do if you simply change it into:

int SPI_TFT_ILI9341::BMP_16(unsigned int x, unsigned int y, const char *Name_BMP)
{
  return 0;
}

Then it compiles, if it works is something you have to check :)

Accepted Answer

Hi Eric

have to bother you again, the image it loaded from the P1. couldn't show up on display correctly. it is a white box on the display, but not a graphic or an image. I guess need update he format of the array, any suggestions.

thanks,

David

posted by david sun 29 Jan 2014

Without having it myself this is a hard one. Try adding const to the extern unsigned ... definition of the image in the main file. Maybe it isn't correctly getting it because of that.

posted by Erik - 29 Jan 2014
david sun
poster
10 years, 3 months ago.

Hi Erik

you know what after I make graphics.c const, it compiles. and the could be problem didn't show up. I will make hardware connections and see if the display light up.

thanks for help

You are correct, I imported his test program, but that doesn't have the latest version of his library. In the later version he added KL25Z support for the library itself (this error was outside the library). You apparantly did have a more recent version where that was fixed.

posted by Erik - 28 Jan 2014

it works, the board light up. thank you very much.

posted by david sun 29 Jan 2014