Before getting to the end of your post, while tinkering with/analysing the SYSTEM file (using unsquashfs), I figured the same thing you said last… just using the compiled image and modifying the sdcard/hdd configuration should do the trick… and then I was at the end… so now I was in my head saying: DUH, dummy!
Amazing work… Maybe I’ll get the time to try it this weekend… work always gets in the way of fun…
Also, you say you’re adding support for the legacy Allwinner kernel to the current Lakka version. Does that mean that METADATA_CSUM will still have to be disabled on your upcoming release?
Hello!
I finally got to boot the Banana Pro in the discussed configuration (boot from 1GB sdcard - one partition - and a 64GB ssd - two partitions). Also I had to modify uEnv.txt to bypass EDID because it kept losing the HDMI signal.
Tested a SNES rom and all works as it should on the emulation part.
Now here is the not so good part: module ap6210 is not loaded/present. So WiFi is not working. I did manage to ssh with the Ethernet port.
I will try a debian image just to make sure that the onboard WiFi module is working and will come back with a reply.
So… I tested the wifi using the sd-card image provided on this page: https://sd-card-images.johang.se/boards/bananapro.html . The ap6210 WiFi is working as it should after installing firmware-brcm80211. Had to jump some hoops by using the Ethernet port before I got at that point.
So, me thinks it is something with the Banana Pi M1 image. I think that I may need to recompile it after all…?
For me it’s definitely some progress after this board has been sitting on the shelves for a couple of years. And I was just reminded that the Ethernet port supports Gigabit.
Found https://github.com/libretro/Lakka-LibreELEC/issues/144
Will test and come back with results.
Any way to debug this? I’ll check if I can find some boot logs…
I managed to find some instructions on ap6210 and I took a look at the ap6210_module.patch in the source, searched string “_para,” and found some pointers on what it expects from the script.bin
After that I tried some settings in the fex file and issued the command modprobe for some modules found here. Wifi or bluetooth are still a no go
modprobe hci_uart
modprobe gpio_sunxi
modprobe rfcomm
modprobe hidp
modprobe sunxi-ir
modprobe bcmdhd
modprobe: ERROR: could not insert 'bcmdhd': No such device
modprobe ap6210
Segmentation fault
------------------------------------------------------------------------------
dmesg
[ 34.952922] Bluetooth: Core ver 2.16
[ 34.956512] NET: Registered protocol family 31
[ 34.961841] Bluetooth: HCI device and connection manager initialized
[ 34.965686] Bluetooth: HCI socket layer initialized
[ 34.969720] Bluetooth: L2CAP socket layer initialized
[ 34.973865] Bluetooth: SCO socket layer initialized
[ 34.984571] Bluetooth: HCI UART driver ver 2.2
[ 34.988395] Bluetooth: HCI H4 protocol initialized
[ 34.992319] Bluetooth: HCI BCSP protocol initialized
[ 34.995977] Bluetooth: HCILL protocol initialized
[ 34.999939] Bluetooth: HCIATH3K protocol initialized
[ 73.655042] Bluetooth: RFCOMM TTY layer initialized
[ 73.659271] Bluetooth: RFCOMM socket layer initialized
[ 73.661989] Bluetooth: RFCOMM ver 1.11
[ 81.444788] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 88.411666] input: sunxi-ir as /devices/virtual/input/input3
[ 88.415920] IR Initial OK
[ 113.058859]
[ 113.058864] failed to power up wifi chip, retry again (4 left) **
[ 113.058869]
[ 115.058945]
[ 115.058949] failed to power up wifi chip, retry again (3 left) **
[ 115.058954]
[ 117.058970]
[ 117.058974] failed to power up wifi chip, retry again (2 left) **
[ 117.058979]
[ 119.058998]
[ 119.059002] failed to power up wifi chip, retry again (1 left) **
[ 119.059007]
[ 119.066411]
[ 119.066420] failed to power up wifi chip, max retry reached, exits **
[ 119.066425]
[ 159.539602] [ap6210] select wifi ap6210
[ 159.544890] [ap6210] Initializing ap6210.
[ 159.553813] [ap6210] platform device registered successfully.
[ 159.561352] [ap6210] Using ap6210 configuration.
[ 159.672105] [mmc-msg] sdc3 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[ 159.675710] [mmc-msg] sdc3 power on
[ 159.702632] [mmc-msg] sdc3 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[ 159.707730] [mmc-msg] sdc3 set round clock 400000, src 24000000
[ 159.767524] [ap6210] WLAN placed in POWER ON
[ 159.790014] [mmc-err] smc 3 err, cmd 52, RTO
[ 159.794158] [mmc-err] smc 3 err, cmd 52, RTO
[ 159.802514] [mmc-msg] sdc3 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[ 159.813529] [mmc-msg] sdc3 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[ 159.818591] [mmc-err] smc 3 err, cmd 8, RTO
[ 159.827259] [mmc-msg] sdc3 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[ 159.840883] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 159.849657] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 159.855915] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 159.863152] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 159.884884] [mmc-msg] sdc3 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[ 159.893339] [mmc-msg] sdc3 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[ 159.898558] [mmc-msg] sdc3 set round clock 42857143, src 600000000
[ 159.962131] [mmc-msg] sdc3 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B
[ 159.971591] mmc1: new high speed SDIO card at address 0001
[ 159.978707] [ap6210] Linux Kernel SDIO/MMC Driver
[ 159.986405] [ap6210] bcmsdh_probe: Host irq is not defined
[ 159.991602] bcmsdh_sdmmc: probe of mmc1:0001:2 failed with error 1
[ 160.015615] bcmdhd: exports duplicate symbol bcmsdh_probe (owned by ap6210)
[ 160.021599] bcmdhd: exports duplicate symbol bcmsdh_probe (owned by ap6210)
[ 160.050088] bcm4330: exports duplicate symbol bcmsdh_probe (owned by ap6210)
[ 160.057748] bcm4330: exports duplicate symbol bcmsdh_probe (owned by ap6210)
[ 171.990595] [ap6210] dhd_module_init: sdio_register_driver timeout or error
[ 171.997719] Unable to handle kernel NULL pointer dereference at virtual address 00000014
------------------------------------------------------------------------------
lsmod
Module Size Used by
ap6210 623291 1
sunxi_ir 4084 0
hidp 17795 0
rfcomm 58901 0
hci_uart 24920 0
bluetooth 263514 5 hidp,hci_uart,rfcomm
8021q 18691 0
garp 5645 1 8021q
stp 1890 1 garp
llc 4764 2 stp,garp
mali 113597 2
ump 56474 3 mali
Hello, sadly I cannot help to debug this right now, as I’m not at home until the end of next week and do not have access to my dev machine.
However, my suggestion would be to find a fex file for your Banana Pro that is known to work with the Wifi chip. Where did you get your current fex file from? I would suggest not using the one for the Banana Pi, try to use one that’s made for the Banana Pro. Usually, these are provided somewhere on the manufacturer’s website.
It’s a good idea to compare another working image to this one, but make sure that it’s using the same 3.4 Allwinner kernel, as this will make debugging much easier. If it’s using a newer mainline kernel, too many things have changed. In that case, it would be better to use an older image that’s using the Allwinner vendor kernel. For example, I could find some old Banana Pro images here:
Banana Pro Images, Documents,Quick start Download | LeMaker single board computers Community
Do any of these images have working Wifi for you?
Then, compare the dmesg of the working image with the dmesg from this image, especially if the following error message is still there:
failed to power up wifi chip, retry again
Does this ap6210 module ship with the Allwinner kernel or does it come from a patch?
Lastly, could it be that the firmware is missing? I don’t know if Lakka 2.1 included the firmware for this driver. Check the driver source if there are any paths where it expects the firmware to be, then check if the files are present.
So… I tested Raspbian_For_BananaPro_v1412.img (kernel 3.4.103) provided by Lemaker and after adding ap6210 into /etc/modules, the wifi works as it should. I tried to find patches/sources for their compiled ap6210.ko driver but could not find any.
The /usr/lib/firmware/ap6210 contents are the same in both images (mounted SYSTEM squash partition from Lakka and the root partition of Raspbian_For_BananaPro_v1412.img and did a file compare)
In the process, I found https://linux-sunxi.org/Cubietruck/AP6210 witch has the same ap6210_module.patch used for Lakka 2.1-rc5 (kernel 3.4.104). What Lakka 2.1-rc5 does not seem to have is the ap6210_defconfig.patch.
They say that “the second patch (ap6210_defconfig.patch) disables the BCMDHD driver and configures the AP6210 driver instead”… witch I think it may trigger the ap6210 module to load as it should (with the fex mods adaptation of [wifi_para] instead of [sdio_wifi_pro_para] in the Lemaker Banana Pro fex).
For now I’ll pause from going further (got other things to attend to) but I’ll resume and try to add that second patch to the Lakka 2.1-rc5 source and try to recompile… we will see how that goes.
Still figuring things out… so the ap6210_defconfig.patch did not work… Of course it didn’t … the patch was not for the intended sun7i_defconfig file.
I did find the Lemaker’s modifications for the Banana Pro’s ap6210 wifi module here. All I need to do now is try some patches on the specified files and then recompile… this will be fun.
Back again: I made a duplicate of the Bananapi folder as Bananapro and used the original script.fex. Then I modified the ap6210_module.patch and included the patches made by Lemaker for the ap6210. Also made some patches accordingly to the linux.arm.conf and linux-noump-drm-3.4-test.arm.conf.
With those done I tried to compile (using the command for Bananapro) but got stuck at this step:
a - src/debugfs.o
a - src/util.o
a - src/linklist.o
a - src/mod_file.o
a - src/mod_path.o
a - src/log.o
ranlib src/libpopulatefs.a
/home/user/Downloads/lakka-2.1-source/build.Lakka-Bananapro.arm-8.2-devel/toolchain/bin/host-gcc src/main.o -o src/populatefs -L./src -Wl,-rpath,/home/user/Downloads/lakka-2.1-source/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -L/home/user/Downloads/lakka-2.1-source/build.Lakka-Bananapro.arm-8.2-devel/toolchain/lib -Wl,-Bstatic -lpopulatefs -Wl,-Bdynamic -lext2fs -lm -lcom_err -lpthread
make[1]: Leaving directory ‘/home/user/Downloads/lakka-2.1-source/build.Lakka-Bananapro.arm-8.2-devel/populatefs-95cc98b’
fatal: not a git repository (or any of the parent directories): .git
make: *** [Makefile:12: image] Error 128
I installed Ubuntu Ubuntu 20.04.3 LTS to compile
Linux ubuntu 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Any ideas?
What package was it trying to build? Sorry, the log is too short. Please post a longer version into a pastebin (the last 1000 lines should be enough). If you’re able to determine the package that can’t be built, trigger a manual build of it (Lakka/scripts/build packagename
instead of make image
) and post the full log here.
You can also go into the build folder and sort by modified date, then go into the last package it was trying to build and examine the sources. If they’re empty or unusually small, this can sometimes mean that the download location for a package is broken or has moved.
It’s a little late and I have work tomorrow but till I can get to it again, I pasted the output here
First, in lakka-2.1-source/packages/tools/populatefs/package.mk there is this:
PKG_URL=“https://github.com/lipnitsk/$PKG_NAME/archive/v${PKG_VERSION}.tar.gz”
instead of what maybe should be
PKG_URL=“https://github.com/lipnitsk/$PKG_NAME/archive/${PKG_VERSION}.tar.gz”
Regardless, I think that populatefs builds just fine.
Second, I went in the image script and added some echo commands and it seems that the problem is at this line:
GIT_HASH=$(git rev-parse HEAD)
What is “git rev-parse HEAD” suppose to do?
A few lines in the script that follow look like this:
$SCRIPTS/build populatefs:host
BUILD_DATE=`date +%Y%m%d%H%M%S`
GIT_HASH=$(git rev-parse HEAD)
if [ "$LIBREELEC_VERSION" = "devel" ]; then
if ! GIT_BUILD=$(git rev-list --count HEAD 2>/dev/null)
then
GIT_BUILD=$(git rev-list HEAD | wc -l)
fi
GIT_ABBREV=$(git log -1 --pretty=format:%h)
DEVEL_VERSION=$LIBREELEC_VERSION
LIBREELEC_VERSION=$LIBREELEC_VERSION-$BUILD_DATE-r$GIT_BUILD-g$GIT_ABBREV
echo "$LIBREELEC_VERSION" > $BUILD/BUILD_FILENAME
fi
Hello, could we please discuss build problems at another place, please open an issue on my GitHub page: Issues · asdf288/Lakka-LibreELEC (github.com)
Here is another hint: Change the first line of the Lakka scripts you want to debug to #!/bin/bash -x
(in this case, the script is probably scripts/image
). This is very helpful because it will show the command that it tries to execute before it errors out. Further reading: bash - How to echo shell commands as they are executed - Stack Overflow
For those in need, I’ll leave here a link to the forum post Lakka image for Banana Pro (wifi fix) where you will also find a compiled image.
Hi,
Were you able to finish adding support for the latest Lakka version ?
I really look forward to installing the latest Lakka version on my Banana Pi m1
Thank you very much !
Hello,
I will look into it this weekend, my hard drive died, I need to restore the backups. But anyway, I wouldn’t be too excited for it, there isn’t a big difference. All it would bring is a new version of Retroarch and some of the emulators, but do not expect any performance gains.
Well thank you very much any way !
I’m currently working on setting up Armbian with Retropie.
It took yestersay around 10 hours to compile using the setup script (selecting generic-x11) and barely works now. Lots of random crashes and poor performance even for 8 bits consoles (well scrolling issues, which I know is the worst for computers)
I’m trying to buy a Rasberry Pi 4 at a reasonnable price but it looks like it’s as buying an RTX nowadays…
I have now added Banana Pi support to the current development version of Lakka (v3.x). It is still using the legacy kernel until better drivers are available (chances are this will never happen), but the userspace components have been updated to the current Lakka version. You can find the download link in my first post.
Great, thank you very much !
Would you mind uploading a NTSC script.bin? I just dug this up and want to breathe some life into the device.