Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 9 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
2 Answers
10 years, 9 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 :)
10 years, 9 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
Hello,
the library should be generic, so problems whihc you are having are with the demo which is for another target.
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,
posted by Martin Kojtal 28 Jan 20140xc0170
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