Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Driver] juj fbcp ili9341
#1
Before start warning: If you don't think you are able to do this, don't do it.
Pre-compiled binary are available for FPZ/CM3 and maintain by Mootikins : https://github.com/Mootikins/FreeplayILI9341

I will try to summary the whole discussion with Slow Catalyst (https://forum.freeplaytech.com/showthread.php?tid=4931).
I will add as much additional information as possible in case someone other need it.


Clone juj driver repo thru SSH :
Code:
cd /home/pi/Freeplay/
git clone https://github.com/juj/fbcp-ili9341


Edit '/boot/config.txt' (Comment mean add # at beginning of the line):
Comment all "dtoverlay=waveshare32b"
Comment dtparam=spi=on


Disable all services:
Code:
sudo systemctl stop fbcpCropped.service
sudo systemctl stop fbcpOld.service
sudo systemctl disable fbcpCropped.service
sudo systemctl disable fbcpOld.service
reboot


Restart the device (no picture, it is normal), then edit '/home/pi/Freeplay/fbcp-ili9341/config.h':
Comment mean add // at beginning of the line, to uncomment, remove it.

ALL_TASKS_SHOULD_DMA //to uncomment, as Mootikins pointed out, the one not really needed
SAVE_BATTERY_BY_PREDICTING_FRAME_ARRIVAL_TIMES //to comment, framerate drop fix
DISPLAY_FLIP_ORIENTATION_IN_SOFTWARE //to comment, I don't remember why
SAVE_BATTERY_BY_SLEEPING_WHEN_IDLE //to comment, good catch kmacmart@darkcloud.ca


Edit '/home/pi/Freeplay/fbcp-ili9341/freeplaytech_waveshare32b.h':
This part is a bit tricky, juj driver doesn't support use of '/boot/freeplayfbcp.cfg'.
If you are running fullscreen, set all value to 0.
Otherwise take value for '/boot/freeplayfbcp.cfg':

DISPLAY_NATIVE_COVERED_TOP_SIDE is left border of the screen
DISPLAY_NATIVE_COVERED_LEFT_SIDE is top border of the screen
DISPLAY_NATIVE_COVERED_RIGHT_SIDE is bottom border of the screen so 240-FREEPLAY_SCALED_H-FREEPLAY_SCALED_OFFSET_Y
DISPLAY_NATIVE_COVERED_BOTTOM_SIDE is right border of the screen so 320-FREEPLAY_SCALED_W-FREEPLAY_SCALED_OFFSET_X


Compiling:
Follow Building and running section on juj repository, for cmake, as a test, you can use :

cmake -DARMV8A=ON -DFREEPLAYTECH_WAVESHARE32B=ON -DSPI_BUS_CLOCK_DIVISOR=6 -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON -DUSE_DMA_TRANSFERS=ON -DSTATISTICS=0 ..

Once started, you should get a output like this (took it from Slow Catalyst comment):
Code:
bcm_host_get_peripheral_address: 0x3f000000, bcm_host_get_peripheral_size: 16777216, bcm_host_get_sdram_address: 0xc0000000
BCM core speed: current: 250000000hz, max turbo: 400000000hz. SPI CDIV: 6, SPI max frequency: 66666667hz
Allocated DMA channel 2
Allocated DMA channel 5
Enabling DMA channels Tx:2 and Rx:5
DMA hardware register file is at ptr: 0x75b3b000, using DMA TX channel: 2 and DMA RX channel: 5
DMA hardware TX channel register file is at ptr: 0x75b3b200, DMA RX channel register file is at ptr: 0x75b3b500
DMA channel 0 has peripheral map 0 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 1 has peripheral map 0 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 2 has peripheral map 13 (is lite channel: 0, currently active: 1, current control block: (nil))
DMA channel 3 has peripheral map 5 (is lite channel: 0, currently active: 1, current control block: 0xff4fc520)
DMA channel 4 has peripheral map 0 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 5 has peripheral map 0 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 6 has peripheral map 13 (is lite channel: 0, currently active: 1, current control block: (nil))
DMA channel 7 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 8 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 9 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 10 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 11 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 12 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 13 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 14 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA TX channel 2 was assigned another peripheral map 13!
DMA TX channel was assigned another peripheral map!

if you see at the end "was assigned another peripheral map...", you will need to set DMA channels by hand, to do so, you need to choise channels with "is lite channel: 0, currently active: 0", in the example: 0,1,4,5 are available.

Add before '..' (don't miss to add spaces before/after), -DDMA_TX_CHANNEL=1 -DDMA_RX_CHANNEL=5

Then recompile and rerun to check if this work.

Important note: If you plan to use a emulator that use DMA (e.g. Reicast), please run it will the driver is still running into terminal to check if there is some possible conflicts. If the happen, the screen will goes black or white but not more update. Press Ctrl-C to kill the program then restart it with 'sudo /home/pi/Freeplay/fbcp-ili9341/build/fbcp-ili9341' to see what channels are still available.

If not picture on the screen, try another channels. If this goes anywhere, revert back all modifications in "/boot/config.txt" then run 'sudo /home/pi/RetroPie/retropiemenu/dispMenu.sh' to set back the right display driver.

If it work, two possibility :
- edit '/etc/rc.local' and add before the line containing 'shutdown_daemon.py', in a new line :
/home/pi/Freeplay/fbcp-ili9341/build/fbcp-ili9341

- run it as a service : https://forum.freeplaytech.com/showthrea...37#pid8737

Restart the device

I hope I didn't make any mistake, if so, post a reply and I will update the post Smile
Reply


Messages In This Thread
[Driver] juj fbcp ili9341 - by Porcinus - 07-20-2019, 03:26 AM
RE: [Driver] juj fbcp ili9341 - by Mootikins - 07-20-2019, 05:21 AM
RE: [Driver] juj fbcp ili9341 - by Porcinus - 07-20-2019, 05:32 AM
RE: [Driver] juj fbcp ili9341 - by Mootikins - 07-20-2019, 05:39 AM
RE: [Driver] juj fbcp ili9341 - by Porcinus - 07-20-2019, 05:49 AM
RE: [Driver] juj fbcp ili9341 - by Porcinus - 07-24-2019, 07:19 AM
RE: [Driver] juj fbcp ili9341 - by Porcinus - 07-24-2019, 12:20 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)