Skip to content

Ili9486 touch support#5

Open
Cyberdemon-23 wants to merge 14 commits intokpishere:masterfrom
neuromancer85:ili9486_touch_support
Open

Ili9486 touch support#5
Cyberdemon-23 wants to merge 14 commits intokpishere:masterfrom
neuromancer85:ili9486_touch_support

Conversation

@Cyberdemon-23
Copy link
Copy Markdown

@Cyberdemon-23 Cyberdemon-23 commented Nov 4, 2019

Rpi 3. waveshare 3.5 tft
I get errors during installation

`
cmake -DSPI_BUS_CLOCK_DIVISOR=16 -DWAVESHARE35B_ILI9486=ON ..
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Doing a Release build
-- Board revision: a22082
-- Detected this Pi to be one of: Pi 2B rev. 1.2, 3B, 3B+, CM3 or CM3 lite, with 4 hardware cores and ARMv8-A instruction set CPU.
-- Enabling optimization flags that target ARMv8-A instruction set (Pi 2B >= rev. 1.2, 3B, 3B+, CM3 or CM3 lite)
-- Scaling source image to view. If the HDMI resolution does not match the SPI display resolution, this will produce blurriness. Match the HDMI display resolution with the SPI resolution in /boot/config.txt to get crisp pixel perfect rendering, or alternatively pass -DDISPLAY_CROPPED_INSTEAD_OF_SCALING=ON to crop instead of scale if you want to view the center of the screen pixel perfect when HDMI and SPI resolutions do not match.
-- Preserving aspect ratio when scaling source image to the SPI display, introducing letterboxing/pillarboxing if HDMI and SPI aspect ratios are different (Pass -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON to stretch HDMI to cover full screen if you do not care about aspect ratio)
-- SPI_BUS_CLOCK_DIVISOR set to 16. Try setting this to a higher value (must be an even number) if this causes problems. Display update speed = core_freq/divisor. (on Pi3B, by default core_freq=400). A safe starting default value may be -DSPI_BUS_CLOCK_DIVISOR=40
-- USE_DMA_TRANSFERS enabled, this improves performance. Try running CMake with -DUSE_DMA_TRANSFERS=OFF it this causes problems, or try adjusting the DMA channels to use with -DDMA_TX_CHANNEL= -DDMA_RX_CHANNEL=.
-- Targeting WaveShare 3.5 inch (B) display with ILI9486
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/fbcp-ili9341/build

pi@raspberrypi:~/fbcp-ili9341/build $ make -j
Scanning dependencies of target fbcp-ili9341
[ 5%] Building CXX object CMakeFiles/fbcp-ili9341.dir/display.cpp.o
[ 10%] Building CXX object CMakeFiles/fbcp-ili9341.dir/hx8357d.cpp.o
[ 15%] Building CXX object CMakeFiles/fbcp-ili9341.dir/diff.cpp.o
[ 20%] Building CXX object CMakeFiles/fbcp-ili9341.dir/dma.cpp.o
[ 25%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9486.cpp.o
[ 30%] Building CXX object CMakeFiles/fbcp-ili9341.dir/XPT2046.cpp.o
[ 35%] Building CXX object CMakeFiles/fbcp-ili9341.dir/gpu.cpp.o
[ 40%] Building CXX object CMakeFiles/fbcp-ili9341.dir/fbcp-ili9341.cpp.o
[ 45%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ili9341.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mem_alloc.cpp.o
[ 60%] Building CXX object CMakeFiles/fbcp-ili9341.dir/keyboard.cpp.o
[ 55%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mailbox.cpp.o
[ 65%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mpi3501.cpp.o
[ 70%] Building CXX object CMakeFiles/fbcp-ili9341.dir/mz61581.cpp.o
[ 75%] Building CXX object CMakeFiles/fbcp-ili9341.dir/spi.cpp.o
[ 80%] Building CXX object CMakeFiles/fbcp-ili9341.dir/ssd1351.cpp.o
/home/pi/fbcp-ili9341/dma.cpp:129: warning: "VIRT_TO_BUS" redefined
#define VIRT_TO_BUS(block, x) ((uintptr_t)(x) - (uintptr_t)((block).virtualAddr) + (block).busAddress)

In file included from /home/pi/fbcp-ili9341/dma.cpp:8:
/home/pi/fbcp-ili9341/spi_kernel.h:7: note: this is the location of the previous definition
#define VIRT_TO_BUS(ptr) ((uintptr_t)(ptr) | 0xC0000000U)

[ 85%] Building CXX object CMakeFiles/fbcp-ili9341.dir/st7735r.cpp.o
[ 90%] Building CXX object CMakeFiles/fbcp-ili9341.dir/statistics.cpp.o
[ 95%] Building CXX object CMakeFiles/fbcp-ili9341.dir/text.cpp.o
In file included from /home/pi/fbcp-ili9341/spi_kernel.h:3,
from /home/pi/fbcp-ili9341/dma.cpp:8:
/home/pi/fbcp-ili9341/spi.h:50:12: error: ‘DMAControlBlock’ does not name a type
volatile DMAControlBlock cb[2];
^~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp: In function ‘int InitDMA()’:
/home/pi/fbcp-ili9341/dma.cpp:218:56: error: ‘bcm2835’ was not declared in this scope
dma0 = (volatile DMAChannelRegisterFile*)((uintptr_t)bcm2835 + BCM2835_DMA0_OFFSET);
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:243:47: error: ‘SHARED_MEMORY_SIZE’ was not declared in this scope
dmaSourceBuffer = AllocateUncachedGpuMemory(SHARED_MEMORY_SIZE2, "DMA source data");
^~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp: In function ‘void DumpDMAState()’:
/home/pi/fbcp-ili9341/dma.cpp:352:13: error: ‘spi’ was not declared in this scope
DumpSPICS(spi->cs);
^~~
/home/pi/fbcp-ili9341/dma.cpp:352:3: error: ‘DumpSPICS’ was not declared in this scope
DumpSPICS(spi->cs);
^~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:352:3: note: suggested alternative: ‘DumpCS’
DumpSPICS(spi->cs);
^~~~~~~~~
DumpCS
/home/pi/fbcp-ili9341/dma.cpp: In function ‘void WaitForDMAFinished()’:
/home/pi/fbcp-ili9341/dma.cpp:375:17: error: ‘tick’ was not declared in this scope
uint64_t t0 = tick();
^~~~
/home/pi/fbcp-ili9341/dma.cpp:378:5: error: ‘usleep’ was not declared in this scope
usleep(100);
^~~~~~
/home/pi/fbcp-ili9341/dma.cpp:378:5: note: suggested alternative: ‘fseek’
usleep(100);
^~~~~~
fseek
/home/pi/fbcp-ili9341/dma.cpp:390:5: error: ‘usleep’ was not declared in this scope
usleep(100);
^~~~~~
/home/pi/fbcp-ili9341/dma.cpp:390:5: note: suggested alternative: ‘fseek’
usleep(100);
^~~~~~
fseek
/home/pi/fbcp-ili9341/dma.cpp: In function ‘void SPIDMATransfer(SPITask
)’:
/home/pi/fbcp-ili9341/dma.cpp:677:3: error: ‘spi’ was not declared in this scope
spi->cs = BCM2835_SPI0_CS_DMAEN | BCM2835_SPI0_CS_CLEAR | DISPLAY_SPI_DRIVE_SETTINGS;
^~~
/home/pi/fbcp-ili9341/dma.cpp:677:61: error: ‘DISPLAY_SPI_DRIVE_SETTINGS’ was not declared in this scope
spi->cs = BCM2835_SPI0_CS_DMAEN | BCM2835_SPI0_CS_CLEAR | DISPLAY_SPI_DRIVE_SETTINGS;
^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:678:30: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
uint32_t headerAddr = task->DmaSpiHeaderAddress();
^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
typedef struct SPITask SPITask;
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:679:72: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
headerAddr = BCM2835_SPI0_CS_TA | DISPLAY_SPI_DRIVE_SETTINGS | (task->PayloadSize() << 16); // The first four bytes written to the SPI data register control the DLEN and CS,CPOL,CPHA settings.
^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
typedef struct SPITask SPITask;
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:685:55: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
memcpy(dmaSourceBuffer.virtualAddr, headerAddr, task->PayloadSize() + 4);
^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
typedef struct SPITask SPITask;
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:692:19: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
txcb->len = task->PayloadSize() + 4;
^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
typedef struct SPITask SPITask;
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:703:19: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
rxcb->len = task->PayloadSize();
^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
typedef struct SPITask SPITask;
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:715:33: error: invalid use of incomplete type ‘SPITask’ {aka ‘struct SPITask’}
double pendingTaskUSecs = task->PayloadSize() * spiUsecsPerByte;
^~
In file included from /home/pi/fbcp-ili9341/dma.cpp:14:
/home/pi/fbcp-ili9341/dma.h:133:16: note: forward declaration of ‘SPITask’ {aka ‘struct SPITask’}
typedef struct SPITask SPITask;
^~~~~~~
/home/pi/fbcp-ili9341/dma.cpp:717:5: error: ‘usleep’ was not declared in this scope
usleep(pendingTaskUSecs-70);
^~~~~~
/home/pi/fbcp-ili9341/dma.cpp:717:5: note: suggested alternative: ‘fseek’
usleep(pendingTaskUSecs-70);
^~~~~~
fseek
/home/pi/fbcp-ili9341/dma.cpp:719:27: error: ‘tick’ was not declared in this scope
uint64_t dmaTaskStart = tick();
^~~~
/home/pi/fbcp-ili9341/dma.cpp:719:27: note: suggested alternative: ‘txcb’
uint64_t dmaTaskStart = tick();
^~~~
txcb
make[2]: *** [CMakeFiles/fbcp-ili9341.dir/build.make:102: CMakeFiles/fbcp-ili9341.dir/dma.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/pi/fbcp-ili9341/spi.cpp: In function ‘void sendNoOpCommand()’:
/home/pi/fbcp-ili9341/spi.cpp:285:15: error: ‘DISPLAY_NO_OPERATION’ was not declared in this scope
task->cmd = DISPLAY_NO_OPERATION;
^~~~~~~~~~~~~~~~~~~~
/home/pi/fbcp-ili9341/spi.cpp:285:15: note: suggested alternative: ‘DISPLAY_DITHER_T’
task->cmd = DISPLAY_NO_OPERATION;
^~~~~~~~~~~~~~~~~~~~
DISPLAY_DITHER_T
/home/pi/fbcp-ili9341/spi.cpp: In function ‘void
spi_thread(void
)’:
/home/pi/fbcp-ili9341/spi.cpp:515:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
make[2]: *** [CMakeFiles/fbcp-ili9341.dir/build.make:245: CMakeFiles/fbcp-ili9341.dir/spi.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/fbcp-ili9341.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
`

@kpishere
Copy link
Copy Markdown
Owner

kpishere commented Nov 5, 2019

Ah, I gave it a try and I get an error trying to build for the kedei display.

[ 4%] Building CXX object CMakeFiles/fbcp-ili9341.dir/XPT2046.cpp.o
In file included from /home/pi/fbcp-ili9341/XPT2046.h:42:0,
from /home/pi/fbcp-ili9341/XPT2046.cpp:27:
/home/pi/fbcp-ili9341/spi_user.h: In function ‘SPITask* AllocTask(uint32_t)’:
/home/pi/fbcp-ili9341/spi_user.h:221:9: error: ‘SPITask’ has no member named ‘sizeExpandedTaskWithPadding’
task->sizeExpandedTaskWithPadding = sizeExpandedTaskWithPadding;
^
CMakeFiles/fbcp-ili9341.dir/build.make:62: recipe for target 'CMakeFiles/fbcp-ili9341.dir/XPT2046.cpp.o' failed
make[2]: *** [CMakeFiles/fbcp-ili9341.dir/XPT2046.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/fbcp-ili9341.dir/all' failed
make[1]: *** [CMakeFiles/fbcp-ili9341.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants