Fot error when running PMSIS helloworld example

Discussions about the AI-deck
Post Reply
shrutarv
Beginner
Posts: 5
Joined: Thu Dec 09, 2021 4:01 pm

Fot error when running PMSIS helloworld example

Post by shrutarv »

Hello,

I am following the tutorial in the link https://github.com/GreenWaves-Technologies/gap_sdk. I am getting an error when trying to run the helloworld program.
It is mentioned in the link "First connect your GAPuino to your PCs USB port". I have connected it but how to verify if I have connected it correctly? There should be an image showing how should one connect it.
Please have a look at the error below:

rm -f /home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/flash.img
CC helloworld.c
ASM startup_gap8.S
ASM gap8_iet.S
ASM cluster_core.S
ASM asm_util.S
ASM port_asm.S
CC gap8_it.c
CC system_gap8.c
CC gap_io.c
CC stdlib.c
CC errno.c
CC string.c
CC cl_malloc.c
CC cl_to_fc_delegate.c
CC fc_to_cl_delegate.c
CC cl_team.c
CC hyperbus_cl_internal.c
CC uart_cl_internal.c
CC cl_dma_irq.c
CC fc_event.c
CC fll.c
CC gpio.c
CC pad.c
CC pmu.c
CC pmu_internal.c
CC pwm.c
CC pwm_internal.c
CC rtc.c
CC rtc_internal.c
CC timer.c
CC hyperbus.c
CC hyperbus_internal.c
CC cpi.c
CC cpi_internal.c
CC dmacpy.c
CC dmacpy_internal.c
CC i2c.c
CC i2c_internal.c
CC i2s.c
CC i2s_internal.c
CC spi.c
CC spi_internal.c
CC uart.c
CC uart_internal.c
CC flash.c
CC partition.c
CC flash_partition.c
CC md5.c
CC fs.c
CC lfs.c
CC lfs_util.c
CC pi_lfs.c
CC read_fs.c
CC semihost.c
CC host_fs.c
CC ota.c
CC ota_utility.c
CC updater.c
CC bootloader_utility.c
CC ai_deck.c
CC camera.c
CC himax.c
CC hyperflash.c
CC hyperram.c
CC spiram.c
CC spiflash.c
/tmp/ccEQ0bqg.s: Assembler messages:
/tmp/ccEQ0bqg.s:120: Warning: Geänderte Sektionsattribute für .data werden ignoriert
CC ram.c
CC alloc_extern.c
CC pi_log.c
CC event_kernel.c
CC cl_l1_malloc.c
CC fc_l1_malloc.c
CC l2_malloc.c
CC malloc_external.c
CC malloc_internal.c
CC pi_malloc.c
CC mem_slab.c
CC device.c
CC pmsis_task.c
CC pmsis_backend_native_task_api.c
CC port.c
CC printf.c
CC list.c
CC queue.c
CC tasks.c
CC timers.c
CC event_groups.c
CC stream_buffer.c
CC FreeRTOS_util.c
gapy --target=ai_deck --platform=board --work-dir=/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS run --image --binary=/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test
gapy --target=ai_deck --platform=board --work-dir=/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS run --flash --binary=/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test
gapy --target=ai_deck gen_flash_image --boot-loader /home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test -o /home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/flash.img
gapy --target=ai_deck --platform=board --work-dir=/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS run --exec-prepare --exec --binary=/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test
Launching execution with command:
gap8-openocd -d0 -c 'gdb_port disabled; telnet_port disabled; tcl_port disabled' -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f target/gap8revb.tcl -f tcl/jtag_boot_entry.tcl -c 'gap8_jtag_load_binary_and_start "/home/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test" elf 0x1c000094'
Open On-Chip Debugger 0.10.0+dev-gb84d97ec4 (2021-12-01-09:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 0

DEPRECATED! use 'adapter speed' not 'adapter_khz'
DEPRECATED! use 'adapter driver' not 'interface'
TARGET create
0
GAP8 INIT TARGET
Error: no device found
Error: unable to open ftdi device with vid 15ba, pid 002b, description 'Olimex OpenOCD JTAG ARM-USB-OCD-H', serial '*' at bus location '*'

Traceback (most recent call last):
File "/home/Dokumente/crazyswarm/gap_sdk/utils/gapy/gapy", line 162, in <module>
main()
File "/home/Dokumente/crazyswarm/gap_sdk/utils/gapy/gapy", line 152, in main
operationFunc(args, config, system)
File "/home/Dokumente/crazyswarm/gap_sdk/utils/gapy/run.py", line 184, in operationFunc
raise RuntimeError('Runner has failed with value: %d' % status)
RuntimeError: Runner has failed with value: -1
/home/Dokumente/crazyswarm/gap_sdk/rtos/freeRTOS/vendors/gwt/rules/freeRTOS_rules.mk:407: recipe for target 'run' failed
make: *** [run] Error 1
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Fot error when running PMSIS helloworld example

Post by kimberly »

hi!

This line is important:

Code: Select all

Error: unable to open ftdi device with vid 15ba, pid 002b, description 'Olimex OpenOCD JTAG ARM-USB-OCD-H', serial '*' at bus location '*'
It is saying that it can not find the jtag programmer of which you need to connect your aideck to. Please check out
this doc about jtag programming in our example documentation about the AIdeck. Connecting through the USB of the crazyflie does not flash the aideck.
shrutarv
Beginner
Posts: 5
Joined: Thu Dec 09, 2021 4:01 pm

Re: Fot error when running PMSIS helloworld example

Post by shrutarv »

Hi,

I am using 'Olimex ARM-JTAG-20-10'. I have connected one end of the JTAG (2×5 pin 1.27mm) to the AI deck as shown in the image in the link you sent. The other end of the JTAG (20 pin) is connected to 'ST-LINK/V2, B2018 15'. The ST LINK is connected to the USB port of the computer using a cable. The crazyflie drone is powered using a battery. When the drone is powered on, one green light on AI deck blinks.

When I execute command lsusb on my ubuntu 18.04 machine, I get the below output:

Bus 002 Device 004: ID 05e3:0743 Genesys Logic, Inc. SDXC and microSDXC CardReader
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 089: ID 0483:3748 STMicroelectronics ST-LINK/V2
Bus 001 Device 006: ID 1915:7777 Nordic Semiconductor ASA
Bus 001 Device 005: ID 1915:7777 Nordic Semiconductor ASA
Bus 001 Device 004: ID 1915:7777 Nordic Semiconductor ASA
Bus 001 Device 092: ID 17fc:c09f
Bus 001 Device 002: ID 046d:c312 Logitech, Inc. DeLuxe 250 Keyboard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I am using ubuntu native install on a computer. I also have a 'debug adapter' from Bitcraze, but I don't know how to use it with the AI deck as menitoned in the link you shared.
Attachments
lsusb output
lsusb output
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Fot error when running PMSIS helloworld example

Post by kimberly »

So the programmer you use is not the Olimex OpenOCD JTAG ARM-USB-OCD-H as indicated in the error code. You will need to inidicate the right file for you programmer with the define GAPY_OPENOCD_CABLE as indicated in the getting started instructions

However, an STLink v2 will not work on the Gap8 as said here in the jtag instructions, as the stlink can only work on cortex core, which the Gap8 on the aideck is not. You will need to buy the olimex programmer we advise in that documentation. A jlink programmer could work to if you have one, but we have seen problems with it for programming the Nina module.

The bitcraze debug adapter can function the same way as the Olimex ARM-JTAG-20-10 adapter, but since you already have the latter you wouldn't need it.
shrutarv
Beginner
Posts: 5
Joined: Thu Dec 09, 2021 4:01 pm

Re: Fot error when running PMSIS helloworld example

Post by shrutarv »

error_log.txt
(4.45 KiB) Downloaded 352 times
Hello,

I purchased the Olimex ARM-USB-TINY-H programmer and have connected one end to the USB port of my computer using a USB B cable and the other end to the JTAG. I choose 'gapuino_v3' board. When I try to run the HelloWorld I am getting an error, which is attached txt file. When I run lsusb command I can see the 'Olimex Ltd. ARM-USB-TINY-H JTAG interface' in the output.

As per your previous message I should run below command first:
'export GAPY_OPENOCD_CABLE=interface/ftdi/olimex-arm-usb-tiny-h.cfg'
But as per the documentation this comes after setting up SDK. However, I ran this command but still I am getting the attached error.

Please help me resolve the error.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Fot error when running PMSIS helloworld example

Post by kimberly »

Hmm this is a bit weird that it wouldn't recognize your programmer. Your log mentioned:

Code: Select all

Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
but there is no description of it ? When you do lbusb, is that with the same vid and pid numbers?


We are not sure if this is perhaps an error in the latest version of the gap sdk, so perhaps it would be good to downgrade it and check again. We also have the docker container option that might be handier to switch between gap sdk versions.
shrutarv
Beginner
Posts: 5
Joined: Thu Dec 09, 2021 4:01 pm

Re: Fot error when running PMSIS helloworld example

Post by shrutarv »

Hi,

I think I had attached the incorrect error file by mistake. Sorry for that. Please find attached the correct error file and output from lsusb. Please have a look and help me resolve the error. I am following the instructions in the below link:
https://github.com/GreenWaves-Technologies/gap_sdk
So I think I am using the latest GAP_SDK. It the issue is due to GAP_SDK version then could you please tell me how to downgrade the GAP_SDK?

I am copying the error below also.

gapy --target=ai_deck --platform=board --work-dir=/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS run --image --binary=/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test
gapy --target=ai_deck --platform=board --work-dir=/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS run --flash --binary=/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test
gapy --target=ai_deck gen_flash_image --boot-loader /home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test -o /home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/flash.img
gapy --target=ai_deck --platform=board --work-dir=/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS run --exec-prepare --exec --binary=/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test
Launching execution with command:
gap8-openocd -d0 -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 "/home/flw/Dokumente/crazyswarm/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/test" elf 0x1c000094'
Open On-Chip Debugger 0.10.0+dev-gb84d97ec4 (2021-12-01-09:51)
Licensed under GNU GPL v2

debug_level: 0

DEPRECATED! use 'adapter speed' not 'adapter_khz'
DEPRECATED! use 'adapter driver' not 'interface'
TARGET create
0
embedded:startup.tcl:26: Error: Can't find tcl/jtag_boot_entry.tcl
in procedure 'script'
at file "embedded:startup.tcl", line 26
Traceback (most recent call last):
File "/home/flw/Dokumente/crazyswarm/gap_sdk/utils/gapy/gapy", line 162, in <module>
main()
File "/home/flw/Dokumente/crazyswarm/gap_sdk/utils/gapy/gapy", line 152, in main
operationFunc(args, config, system)
File "/home/flw/Dokumente/crazyswarm/gap_sdk/utils/gapy/run.py", line 184, in operationFunc
raise RuntimeError('Runner has failed with value: %d' % status)
RuntimeError: Runner has failed with value: -1
/home/flw/Dokumente/crazyswarm/gap_sdk/rtos/freeRTOS/vendors/gwt/rules/freeRTOS_rules.mk:407: recipe for target 'run' failed
make: *** [run] Error 1
Attachments
lsusb.png
error_log.txt
(4.28 KiB) Downloaded 370 times
Last edited by shrutarv on Tue Jan 11, 2022 3:28 pm, edited 1 time in total.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Fot error when running PMSIS helloworld example

Post by kimberly »

How to downgrade the SDK is also shown in the same instructions here.

And from the looks of this error seems that there are files missing from the gap8 open ocde:

Code: Select all

embedded:startup.tcl:26: Error: Can't find tcl/jtag_boot_entry.tcl
Have you followed these instructions to installthe gap8 openocd ?

If your environment setup for gap8 development is difficult to do, let me point again to the docker container instructions , which is exactly made for this reason to quickly get started with development.
shrutarv
Beginner
Posts: 5
Joined: Thu Dec 09, 2021 4:01 pm

Re: Fot error when running PMSIS helloworld example

Post by shrutarv »

Hi,

As per your advice I tried to use docker using the instructions in the document in this link https://www.bitcraze.io/documentation/r ... cker-gap8/

I am getting an error when running the below command:
docker run --rm -it -v $PWD:/module/data/ --device /dev/ttyUSB0 --privileged -P bitcraze/aideck /bin/bash -c 'export GAPY_OPENOCD_CABLE=interface/ftdi/olimex-arm-usb-tiny-h.cfg; source /gap_sdk/configs/ai_deck.sh; cd /module/data/; make clean all run'

The error is:
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
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: gap8.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
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
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
.
.
.
.

Could you please help me resolve the error.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Fot error when running PMSIS helloworld example

Post by kimberly »

That is usually what you see if the adapter of the jtag lint cable is not correctly connected to the AIdeck. Please see this guide as reference: https://www.bitcraze.io/documentation/r ... ogramming/

Let us know if you are still having problems
Post Reply