AI Deck Flashing Issues

Discussions about the AI-deck
GriffinBonner
Beginner
Posts: 12
Joined: Thu Oct 08, 2020 2:45 pm

AI Deck Flashing Issues

Post by GriffinBonner »

Hello,

I am trying to flash the wifi_jpeg_streamer example to the AI deck and I am having some issues with the debugger. I have followed all of the documentation and I can see the debugger when running lsusb:

Bus 002 Device 029: ID 15ba:002a Olimex Ltd. ARM-USB-TINY-H JTAG interface

I have run the command to export the debugger .cfg as described in the documentation and I am getting this error when I try to flash the AI deck. I have installed everything according to the gap_sdk including the gap8 openocd. Any guidance is appreciated.

make image flash io=host
gapy --target=ai_deck --platform=board --work-dir=/home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/BUILD/GAP8_V2/GCC_RISCV --config-ini=/home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/config.ini run --image --binary=/home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/BUILD/GAP8_V2/GCC_RISCV/test
gapy --target=ai_deck --platform=board --work-dir=/home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/BUILD/GAP8_V2/GCC_RISCV --config-ini=/home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/config.ini run --flash --force --binary=/home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/BUILD/GAP8_V2/GCC_RISCV/test
Flashing image with command:
gap8-openocd -c "gdb_port disabled; telnet_port disabled; tcl_port disabled" -c "script interface/ftdi/olimex-ltd-arm-usb-tiny-h.cfg; script target/gap8revb.tcl; script tcl/flash_image.tcl; script tcl/jtag_boot.tcl; gap_flash_raw_hyper /home/bitcraze/projects/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/BUILD/GAP8_V2/GCC_RISCV/target.board.devices.flash.img 48160 /home/bitcraze/projects/gap_sdk/tools/gap8-openocd-tools; exit;"
Open On-Chip Debugger 0.10.0+dev-00001-g43c0b412 (2021-05-25-17:19)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:26: Error: Can't find interface/ftdi/olimex-ltd-arm-usb-tiny-h.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 26
Traceback (most recent call last):
File "/home/bitcraze/projects/gap_sdk/tools/gapy/gapy", line 162, in <module>
main()
File "/home/bitcraze/projects/gap_sdk/tools/gapy/gapy", line 152, in main
operationFunc(args, config)
File "/home/bitcraze/projects/gap_sdk/tools/gapy/run.py", line 146, in operationFunc
raise RuntimeError('Runner has failed with value: %d' % status)
RuntimeError: Runner has failed with value: -1
make: *** [/home/bitcraze/projects/gap_sdk/tools/rules/pulp_rules.mk:229: flash] Error 1
kimberly
Bitcraze
Posts: 771
Joined: Fri Jul 06, 2018 11:13 am

Re: AI Deck Flashing Issues

Post by kimberly »

Hi!

We need a bit more information about your problem:
- Which version of the gap_sdk are you using?
- And could you also provide a link to the documentation you used?
GriffinBonner
Beginner
Posts: 12
Joined: Thu Oct 08, 2020 2:45 pm

Re: AI Deck Flashing Issues

Post by GriffinBonner »

I am using Release version 3.9.1 of the Gap SDK. To build the gap_sdk I followed the README.md file in following repository:

https://github.com/GreenWaves-Technolog ... /README.md

I built the gap_sdk and installed openocd and everything described in the above documentation. I cloned the AIdeck_examples repository and followed the instructions in the README.md to source the relevant configs/ai_deck.sh script and exported the debugger .cfg as described. The problems have been occuring when I am trying to build and flash the examples, specifically the wifi_png_streamer example following the following documentation:

https://github.com/bitcraze/AIdeck_exam ... treamer.md
kimberly
Bitcraze
Posts: 771
Joined: Fri Jul 06, 2018 11:13 am

Re: AI Deck Flashing Issues

Post by kimberly »

Hi!

The aideck examples are only tested out on the SDK version 3.8.1 as mentioned in the documentation: https://github.com/bitcraze/AIdeck_exam ... treamer.md. We have currently a [github ticket ](https://github.com/bitcraze/AIdeck_examples/issues/41) open to update them but unfortuntely we did not find the time yet. I would suggest to downgrade the SDK or to try out the dockerfile provided
GriffinBonner
Beginner
Posts: 12
Joined: Thu Oct 08, 2020 2:45 pm

Re: AI Deck Flashing Issues

Post by GriffinBonner »

I took your advice and built the gap_sdk from the dockerfile successfully, however I am running into a strange issue when I am trying to run the wifi_jpeg_streamer example following the documentation given in this link:

https://github.com/bitcraze/AIdeck_exam ... er-gap8.md

When I try to build and run the example on RAM as described, I am able to connect to the gap8 device through the JTAG debugger, but the program halts at an arbitrary point before the transmission is started. For example, sometimes the program halts after displaying "Allocated Memory for Image" and sometimes even after displaying "Opened Streamer" but I have not yet been able to view the stream successfully with the "viewer.py" script which is perpetually "connecting" when running this example. I have attached an example of the output that hangs when I try to run from device RAM below:

Launching execution with command:
gap8-openocd -c 'gdb_port disabled; telnet_port disabled; tcl_port disabled' -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f target/gap8revb.tcl -f tcl/jtag_boot_entry.tcl -c 'gap8_jtag_load_binary_and_start "/module/data/BUILD/GAP8_V2/GCC_RISCV/test" elf 0x1c000080'
Open On-Chip Debugger 0.10.0+dev-gb84d97ec4 (2021-05-29-16:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter speed' not 'adapter_khz'
DEPRECATED! use 'adapter driver' not 'interface'
Warn : Interface already configured, ignoring
TARGET create
Info : core 0 selected
0
Info : gap8_adv_debug_itf tap selected
Info : adv_dbg_unit debug unit selected
Info : Option 7 is passed to adv_dbg_unit debug unit
GAP8 INIT TARGET
Info : clock speed 1500 kHz
Info : JTAG tap: gap8.cpu tap/device found: 0x149511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x1)
GAP8 examine target
Init jtag
Initialising GAP8 JTAG TAP
Info : adv debug unit is configured with option BOOT MODE JTAG
Info : adv debug unit is configured with option ADBG_USE_HISPEED
Info : gdb port disabled
Loading binary through JTAG
Info : tcl server disabled
Info : telnet server disabled
Entering main controller...
Allocated Memory for Image
GriffinBonner
Beginner
Posts: 12
Joined: Thu Oct 08, 2020 2:45 pm

Re: AI Deck Flashing Issues

Post by GriffinBonner »

I am able to flash the wifi_jpeg_streamer example to the AI deck successfully, and I can see the wifi network "Bitcraze AI-Deck Example." I am unable to view the image stream, running "viewer.py" brings up a black window and reports the following in the terminal:

viewer.py:100: DeprecationWarning: Gtk.Widget.override_background_color is deprecated
self.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(0, 0, 0, 1))
Connecting to socket on 192.168.4.1:5000...

I am unsure how to proceed at this point because I have not even been able to get the example working when using docker and following all of the documentation. Please let me know if there are any glaring mistakes in my approach, because I do not know what to try at this point. Out of the box the AI-Deck came flashed properly with the streaming example, but even then I was unable to connect with the python script.
tobias
Bitcraze
Posts: 2152
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AI Deck Flashing Issues

Post by tobias »

Looks like it can't connect. Did you connect your PC to the "Bitcraze AI-Deck Example" Access Point?
GriffinBonner
Beginner
Posts: 12
Joined: Thu Oct 08, 2020 2:45 pm

Re: AI Deck Flashing Issues

Post by GriffinBonner »

I am connecting to the access point on my PC. I am using the Bitcraze Virtual Machine with VirtualBox and I have set up a network adapter. I have attached a picture of my virtualbox settings (virtualbox_settings.png). I have attached a picture of the output of viewer.py which reports "connected" but does not show any output from the camera (viewer_socket_connected.png). I have attached a picture of the output of the "wifi_jpeg_streamer" example when running from RAM which still hangs at "Allocated Memory for Image" (wifi_jpeg_streamer.png). I am not sure what is causing this problem, but everything seems to be working properly aside from the network issues connecting to my virtual machine, I am able to successfully flash all of the examples, the problems arise when running examples that involve a network connection. I am going to try to try this from a native install of Ubuntu 18.04 to see if the primary cause is the network adapter between my virtual machine and PC. Have any similar issues been reported when running from a virtual machine? Please let me know if you have any suggestions or need more information.

Thank you,
Griffin
Attachments
wifi_jpeg_streamer.png
viewer_socket_connected.png
virtualbox_settings.png
tobias
Bitcraze
Posts: 2152
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AI Deck Flashing Issues

Post by tobias »

My guess is that it is a some form of security problem with the wifi and possibly running it though the VM. We have had it working though the VM but it was a while ago so possibly something has changed.
tobias
Bitcraze
Posts: 2152
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AI Deck Flashing Issues

Post by tobias »

I now got time to test it and it is no problem for me to get it to connect using the VM. I did not do anything special other then increasing the video memory to get it to start.

So probably some access/security issue. Do both green LED on the AI-deck blink when you power it on. Also when it is connected the LED1 should start blinking faster.
Post Reply