-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arduino sketch does not work in branch thud #78
Comments
I don't know. What sketch is problematic? |
sorry, I am messed up. root@edison:~# ls /sketch compare to firmware 160606, poky 1.7.3 board I found that the arduino framework lib need be patched to use chardev interface to manipulate mux/pullup/gpio, this is beyond my ability :( I think I should give up arduino framework and looking for some python/nodejs libs as substitute. |
I never sketches. But are you sure the problem is with corelibs-edison? I think we are probably missing a server on edison, f.i. clloader. I removed this at a certain point as it didn't want to build, but it may be easier to fix than it seems. There are other servers removed too, compare thud to original. |
I just added a patch to my warrior branch that fixes However when installing the board installation fails as the absolute path to the sdk does not exist (/opt/poky-edison/... wrong version). Clicking on / shows (translated): So, you need to build the arduino SDK first (I think To go back to the known VID/PID we would need to fixup this file to the VID/PID expected. Further I found
which means this file needs to be patched to use libgpiod. Unfortunately I have no experience writing arduino sketches, so I can't do all the above, but I can provide suggestions if needed. Patches restoring Arduino sketch support are very welcome! |
I am glad to heard that the Arduino sketches might be got support. root@edison:~# uname -a Linux edison 5.4.0-edison-acpi-standard #1 SMP Sat Feb 15 19:22:41 UTC 2020 i686 i686 i386 GNU/Linux root@edison:~# ls /sketch/ root@edison:~# ps |grep sketch 2485 root 3768 S grep sketch root@edison:~# ls /opt/edison/ clloader launcher.sh sketch_reset sketch_reset.sh root@edison:~# systemctl status clloader ● clloader.service - Daemon to handle arduino sketches Loaded: loaded (/lib/systemd/system/clloader.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2020-02-15 17:20:12 UTC; 6min ago Main PID: 538 (launcher.sh) CGroup: /system.slice/clloader.service ├─ 538 /bin/sh /opt/edison/launcher.sh └─2710 usleep 200000 Feb 15 17:20:12 edison systemd[1]: Started Daemon to handle arduino sketches. to restore Arduino IDE's function, I will try to change gadget vid/pid to original 8087:0a9e, then manage to patch script to use libgpiod, and build a new sdk for Arduino library. I will report result late. |
@xlla that would be great! In the meanwhile I am messing with Zeus and starting to use btrfs as a file system so I need a bit of time to stabilize that before I can test your work. |
@htot after changed vid/pid, it still not present in Arduino IDE's port list. xlla$ lsusb Bus 020 Device 018: ID 0403:6001 Future Technology Devices International Limited FT232R USB UART Serial: A903BX28 Bus 020 Device 022: ID 8087:0a9e Intel Corporation USBArmory Gadget Serial: 0123456789abcdef xlla$ ls /dev/cu. (press Tab) cu.usbserial-A903BX28 no cu.usbmodem-xxx appeared. xlla$ lsusb Bus 020 Device 015: ID 0403:6001 Future Technology Devices International Limited FT232R USB UART Serial: A402EXFU Bus 020 Device 017: ID 8087:0a9e Intel Corporation Edison Serial: c2xxxxxxxxxxxxxx xlla$ ls /dev/cu. (press Tab) cu.usbserial-A402EXFU cu.usbmodem14213 I don't know wherever should be modified to let my os recognize the usb gadget as original Edison board's. current usb Name was "Intel Corporation USBArmory Gadget" instead of "Intel Corporation Edison". |
@andy-shev , thanks for your hard work to bring new version of u-boot to us. U-Boot 2020.01 (Feb 15 2020 - 18:23:23 +0000) CPU: Genuine Intel(R) CPU 4000 @ 500MHz DRAM: 980.6 MiB WDT: Started with servicing (60s timeout) MMC: mmc@ff3fc000: 0, mmc@ff3fa000: 1 Loading Environment from MMC... OK In: serial Out: serial Err: serial Net: No ethernet found. Hit any key to stop autoboot: 0 Target:blank Partitioning already done... Flashing already done... 11967552 bytes read in 516 ms (22.1 MiB/s) Valid Boot Flag Setup Size = 0x00004000 Magic signature found Using boot protocol version 2.0d Linux kernel version 5.4.0-edison-acpi-standard (oe-user@oe-host) #1 SMP Sat Feb 15 19:22:41 UTC 2020 Building b Starting version 241-214-gd1cc09a+ Kernel with acpi enabled detected Loading acpi tables this is log of u-boot 2019.04 U-Boot 2019.04 (Oct 28 2019 - 07:55:21 +0000) CPU: Genuine Intel(R) CPU 4000 @ 500MHz DRAM: 980.6 MiB MMC: mmc@ff3fc000: 0, mmc@ff3fa000: 1 Loading Environment from MMC... OK In: serial Out: serial Err: serial Saving Environment to MMC... Writing to redundant MMC(0)... OK Saving Environment to MMC... Writing to MMC(0)... OK Net: No ethernet found. Kernel command line: "root=/dev/mmcblk0p8 rootfstype=ext4 console=ttyS2,115200n8 earlyprintk=ttyS2,115200n8,keep loglevel=4 g_multi.ethernet_config=cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=8xxxxxxxxxxxxxxxxxc g_multi.dev_addr=02:00:86:0a:57:7c platform_mrfld_audio.audio_codec=dummy" |
Yeah, the whole gadget subsystem has been revised. The file configuring it now is here: |
I see it, in warrior |
I didn't quite get this. do you mean that in newer U-Boot you can't boot it because there is no kernel command line? Or it simple didn't appear on the console and everything is fine when you do |
@xlla AFAIK these lines As I said gadget vid/pid is set in conf-gadget.sh |
@andy-shev yes, It dit boot, just simple did not appear on console. |
|
reference to https://software.intel.com/en-us/installing-drivers-for-intel-edison-board-with-windows |
It's probably U-Boot configuration or U-Boot itself change... However, I don't see any changes in the code for this. |
now I can move on and try build arduino sdk, but encounter many errors: very long logs, Click to expand``` xlla@u18-1:~/develop/git/out/linux64/build$ bitbake arduino-toolchain Build Configuration: Initialising tasks: 100% |########################################################################################| Time: 0:00:04 Summary: 1 task failed:
|
I have manual replace content of poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb with http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-core/util-linux/util-linux_2.32.1.bb?h=warrior&id=bd374216048581bcb3ea54d69998342525cf2da5, and remove each line which contain "OLDHOST", now the errors was gone. |
Errors back again, :( ERROR: nativesdk-util-linux-2.32.1-r0 do_package: QA Issue: nativesdk-util-linux: Files/directories were installed but not shipped in any package: /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/partx /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/ldattach /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/readprofile /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/resizepart /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/uuidd /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/delpart /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/rfkill /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/addpart /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/rtcwake /opt/poky-edison/2.7.2/sysroots/x86_64-pokysdk-linux/usr/sbin/fdformat Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. nativesdk-util-linux: 10 installed and not shipped files. [installed-vs-shipped] ERROR: nativesdk-util-linux-2.32.1-r0 do_package: Fatal QA errors found, failing task. ERROR: nativesdk-util-linux-2.32.1-r0 do_package: ERROR: nativesdk-util-linux-2.32.1-r0 do_package: Function failed: do_package ERROR: Logfile of failure stored in: /home/xlla/develop/git/out/linux64/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-util-linux/2.32.1-r0/temp/log.do_package.11706 ERROR: Task (virtual:nativesdk:/home/xlla/develop/git/out/linux64/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb:do_package) failed with exit code '1' |
I don't have problems with U-Boot. Log file? |
@xlla the problems you see may be related to your host. I am building on:
Nevertheless I see if I run And when I run
It seems a small detail broke resulting in a missing .xz, shouldn't be to hard to fix. |
can you refer this mode +111 to fixed board installation problem, then try upload a simple test sketch ? I have do upload but failed, just stuck and timeout. |
directly execute "bitbake arduino-toolchain" or execute "make arduino-toolchain" all give out same errors. maybe I should update my build env. xlla@u18-1:~/develop/git$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic xlla@u18-1:~/develop/git$ uname -a Linux u18-1 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux but "bitbake edison-image -c populate_sdk" was success. |
i never installed the sdk through the sh script. Instead I manually make a link to the files that i already have (no need to have them 2x on the same machine). I do that as described here: https://edison-fw.github.io/meta-intel-edison/3-Building-the-SDK.html The problem is that the path contains the yocto version name and the Arduino sdk expects another. |
The only error I get is about the missing xz.
In my case succeeds to build sh installer, but with warnings about uninstallable packages. |
We are now try to restore the Arduino sketch compatibilities. (yes, the installed sdk is old, wrong version, and 2x disk space occupy, but we just want to check sketch upload procedure now. It can work well with original firmware edison, so it should upload sketch to our new firmware edison successfully too.) after that, you can choose "menu->File->Examples->04.Communication->SerialPassthrough", (choose this to avoid GPIO manipulation now) I am stuck in this point, after compile sketch, timeout when uploading. I am now try to compile kernel again to add acm usb gadget support, then configure a acm port and try to upload sketch again. |
? where is that set? Because you are on warrior, we already have this to change to correct arch. |
where is the create_devtools_package.sh. |
Good question. If you check out original, you will see it never existed (in the version published on https://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/) |
May I still stick to 32-bit version to avoid performance lose. |
Alright, I am still try to work out osx-version toolchain, so I had study Makefile carefully to see if I missed something. I thought maybe some clues in that script. after fixed a lot files, recipe odcctools2-crosssdk and osx-runtime was built. xlla@u18-1:~/develop/git/out/macosx/build$ bitbake arduino-toolchain Loading cache: 100% |#########################################################################################################################| Time: 0:00:00 Loaded 3286 entries from dependency cache. Parsing recipes: 100% |#######################################################################################################################| Time: 0:00:04 Parsing of 2216 .bb files complete (2215 cached, 1 parsed). 3287 targets, 310 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies ERROR: Nothing RPROVIDES 'nativesdk-glibc' (but virtual:nativesdk:/home/xlla/develop/git/out/macosx/poky/meta/recipes-core/glibc/glibc-locale_2.29.bb RDEPENDS on or otherwise requires it) nativesdk-glibc was skipped: PREFERRED_PROVIDER_virtual/nativesdk-libc set to nativesdk-osx-runtime, not nativesdk-glibc NOTE: Runtime target 'nativesdk-glibc' is unbuildable, removing... Missing or unbuildable dependency chain was: ['nativesdk-glibc'] NOTE: Runtime target 'nativesdk-bash' is unbuildable, removing... Missing or unbuildable dependency chain was: ['nativesdk-bash', 'virtual/nativesdk-libc-locale', 'nativesdk-glibc'] NOTE: Runtime target 'nativesdk-bash-completion' is unbuildable, removing... Missing or unbuildable dependency chain was: ['nativesdk-bash-completion', 'nativesdk-bash', 'virtual/nativesdk-libc-locale', 'nativesdk-glibc'] NOTE: Runtime target 'gdb-cross-canadian-i686' is unbuildable, removing... Missing or unbuildable dependency chain was: ['gdb-cross-canadian-i686', 'nativesdk-python3', 'nativesdk-util-linux', 'nativesdk-bash-completion', 'nativesdk-bash', 'virtual/nativesdk-libc-locale', 'nativesdk-glibc'] NOTE: Runtime target 'packagegroup-cross-canadian-edison' is unbuildable, removing... Missing or unbuildable dependency chain was: ['packagegroup-cross-canadian-edison', 'gdb-cross-canadian-i686', 'nativesdk-python3', 'nativesdk-util-linux', 'nativesdk-bash-completion', 'nativesdk-bash', 'virtual/nativesdk-libc-locale', 'nativesdk-glibc'] ERROR: Required build target 'arduino-toolchain' has no buildable providers. Missing or unbuildable dependency chain was: ['arduino-toolchain', 'packagegroup-cross-canadian-edison', 'gdb-cross-canadian-i686', 'nativesdk-python3', 'nativesdk-util-linux', 'nativesdk-bash-completion', 'nativesdk-bash', 'virtual/nativesdk-libc-locale', 'nativesdk-glibc'] Summary: There were 2 ERROR messages shown, returning a non-zero exit code. |
Sorry, can't help you with osx. But maybe there is info on the yocto site on how to build on osx? Maybe there is updated darwin stuff? |
after many days research, I had to give up Mac version toolchain, due to the lack of support and ancient source repo. |
That's good news. Too bad of the Mac version, I can't help there. Have you seen this: https://git.yoctoproject.org/cgit/cgit.cgi/meta-darwin/tree/README |
@htot while play with acpi-tables, I found it is still use configfs in acpi-tables-load. /opt/edison/sketch_reset -i 207 -o 215 -s /opt/edison/sketch_reset.sh to /opt/edison/sketch_reset -i 503 -o 511 -s /opt/edison/sketch_reset.sh |
Yes, you missed my reply. You need to change one of you U-Boot variable so that you will see "quiet skiptables debugshell=10" n the kernel command line. Really. And life is already easy :-), I created a test branch sketch_reset_v2 that patches sketch_reset to use libgpiod instead of sysfs. As you can see the code is now greatly simplified. Using The trick is to make |
I see, I have manage to put this arg in to the kernel command line. fw_setenv bootargs_debug 'quiet skiptables' then it did work. root@edison:~# systemctl status acpi-tables-load ● acpi-tables-load.service - ACPI tables load service Loaded: loaded (/lib/systemd/system/acpi-tables-load.service; enabled; vendor preset: enabled) Active: inactive (dead) since Sat 2020-02-15 17:20:08 UTC; 16s ago Process: 551 ExecStart=/usr/bin/acpi-tables-load (code=exited, status=0/SUCCESS) Main PID: 551 (code=exited, status=0/SUCCESS) Feb 15 17:20:07 edison systemd[1]: Started ACPI tables load service. Feb 15 17:20:08 edison acpi-tables-load[551]: gpioset: at least one GPIO line offset to value mapping must be specified Feb 15 17:20:08 edison systemd[1]: acpi-tables-load.service: Succeeded. but empty in journalctl. root@edison:~# journalctl -b | grep "Command line" root@edison:~# I can confirm it in screen connected to ttyUSB0 Linux kernel version 5.4.0-edison-acpi-standard (oe-user@oe-host) #1 SMP Sat Feb 29 18:08:20 UTC 2020 Building boot_params at 0x00090000 Loading bzImage at address 100000 (11950784 bytes) Magic signature found Kernel command line: "root=/dev/mmcblk0p8 rootfstype=ext4 console=ttyS2,115200n8 earlyprintk=ttyS2,115200n8,keep quiet skiptables g_multi.ethernet_config=cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=8452e52a5b73f5f38c917327f40a577c g_multi.dev_addr=02:00:86:0a:57:7c platform_mrfld_audio.audio_codec=dummy" Magic signature found |
Yes, libdpiod seems easy to monitor gpio pin edge signal than configfs. |
could you patch this edison_fab_c file to use libgpiod, then arduino sketch will reborn. I think we can make an intermediate table to translate those configfs line numbers to gpio chip name and line index, then use chardev functions to implement original invoke. |
Good
Just check
That doesn't seem right, I haven't seen that before.
sysfs
Yes you are confused, you are looking at the original code, not at the patched code. The patched code will be under (x86_64) |
Yes, the code you rewrite is simple and elegant! It works well. root@edison:~# ps |grep cll 675 root 2432 S /opt/edison/clloader --escape --binary --zmodem --disable-timeouts 680 root 3768 S grep cll root@edison:~# /opt/edison/sketch_reset -i SHLD_RESET0 -o SHLD_RESET1 -s /opt/edison/sketch_reset.sh -v Sketch Reset button pressed: Sketch Reset button released: Calling /opt/edison/sketch_reset.sh ^C root@edison:~# ps |grep cll 686 root 2432 S /opt/edison/clloader --escape --binary --zmodem --disable-timeouts 688 root 3768 S grep cll When I try to upgrate kernel to 5.5.0, recipe perf raise errors: | CC /home/xlla/develop/git/out/linux64/build/tmp/work/edison-poky-linux/perf/1.0-r9/perf-1.0/fs/fs.o | Traceback (most recent call last): | File "/usr/lib/python3.6/site.py", line 570, in | main() | File "/usr/lib/python3.6/site.py", line 556, in main | known_paths = addusersitepackages(known_paths) | File "/usr/lib/python3.6/site.py", line 288, in addusersitepackages | user_site = getusersitepackages() | File "/usr/lib/python3.6/site.py", line 264, in getusersitepackages | user_base = getuserbase() # this will also set USER_BASE | File "/usr/lib/python3.6/site.py", line 254, in getuserbase | USER_BASE = get_config_var('userbase') | File "/usr/lib/python3.6/sysconfig.py", line 607, in get_config_var | return get_config_vars().get(name) | File "/usr/lib/python3.6/sysconfig.py", line 550, in get_config_vars | _init_posix(_CONFIG_VARS) | File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix | _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) | ModuleNotFoundError: No module named '_sysconfigdata' | Makefile:185: recipe for target '/home/xlla/develop/git/out/linux64/build/tmp/work/edison-poky-linux/perf/1.0-r9/perf-1.0/bpf_helper_defs.h' failed |
Yes, @mwallnoefer reported that too. I had that too, I think I fixed that by doing -c cleansstate for linux-yocto and perf, but @mwallnoefer reports it didn't work for him. I did a clean build In your case your were building i686, but this branch sketch_reset_v2 is x86_64, so you need to do |
alright, I found it by eyes. root@edison:~# journalctl -b |grep "Kernel command" Feb 15 17:20:01 edison kernel: Kernel command line: root=/dev/mmcblk0p8 rootfstype=ext4 console=ttyS2,115200n8 earlyprintk=ttyS2,115200n8,keep quiet skiptables g_multi.ethernet_config=cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=8452e52a5b73f5f38c917327f40a577c g_multi.dev_addr=02:00:86:0a:57:7c platform_mrfld_audio.audio_codec=dummy root@edison:~# journalctl -b | grep "Command line" root@edison:~# |
I have manual apply patch 3a1a18ba9d28adb5562eabe9ec354f6d93154f5c from git.yoctoproject.org, but still error, I comment out perf and built. after merged with sketch_reset_v2.0 , I have change it back to i386_defconfig. |
perf was work now. |
I don't know the status of mraa. It has moved over to the eclipse foundation and development seems to have slowed down. The most recent work (in forks) seems to be done by you https://github.com/eclipse/mraa/network. |
Hi all I tried to follow all the exchanges so I can figure out how to solve the issue. Here few information about my setup My host is:
I followed the instructions here (https://edison-fw.github.io/meta-intel-edison/1.2-Setting-up.html ) and I was able to build images and to load them in the Edison board, to boot it, access by screen using /dev/ttyUSB0 and configure the wifi and so.
However I was unable to get my host recognize the port /dev/ttyACM3 to load the arduino codes. Everything worked fine with the original images of Edison board. I tired to apply the code echo 0x1d6b 0x0104 >/sys/bus/usb-serial/drivers/generic/new_id without any success (https://edison-fw.github.io/meta-intel-edison/4.4-hsu-i2c-spi.html). Correct me if I am wrong but someone managed to fix this and get it work. What is the branch used to make compile the images (master ?). Any patch applied ? Thank your for the effort to maintain updated images for Edison. |
I am waiting to receive patches from @xlla for this. I believe he was using warrior. What I would like to see most to start with is get the Arduino libraries to compile with the Edison SDK. The IDE and uploading / debugging can be replaced with other tools (KDevelop, Qt Creator). |
I just checked the serial over USB as described here and it still works:
Now goto gtkterm on host and connect to |
the Arduino Library need be patch to work with chardev. |
Sorry, I am busy on another project recently, so this task(patch arduino lib) had to postpone. |
I never used Arduino libs myself, so it is low priority for me. But we can take patches on incremental improvements, if you any. |
I am use arduino library, 1.6.7+1.0
after compile and upload sketch, it was running but not work as expect.
should I upgrade sysroot in packages/Intel/hardware/i686/1.6.7+1.0, and patch some file to work with chardev ?
since there are tons of arduino libraries, if we can still support arduino framework, then everything is easy.
The text was updated successfully, but these errors were encountered: