aideck bootloader

Discussions about the AI-deck
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

Hello Marcus
I checked the leds again and both of them flash, but the viewer still doesn’t come up.
When I try to flash the wifi example to the aideck I get the following error with this

make clean all
test.c:15:10: fatal error wifi_credentials.h no such file or directory
#include “wifi_credentials.h”
This also happens when I run
make clean all run io=uart

I am trying to flash wifi example with JTAG

I am using the olimex tiny-h programmer.
Do I need to build the wifi example before I try the python opencv-viewer.py

Regards
Rodrigo
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: aideck bootloader

Post by marcus »

Unfortunately things in this part of the code (AI-deck / examples) currently have a lot of changes and there's probably still a few issues lurking here that we haven't found yet. I see that the code you're trying to compile is older code since it's giving the warning for the wifi_credentials.h file.

I would recommend restarting fresh from master in the concerned repositories and first flashing the GAP8 without the bootloader just to make sure that we get something working. After that we can add the complexity of using the bootloader.

So if possible please do the following:

First flash the Crazyflie 2.1 with the latest release (this will give you access to printouts from the GAP8). The latest release is available in the Crazyflie client by using Connect->Bootloader. The release is called 2022.03 (make sure to flash the one for the Crazyflie).

Secondly clone and flash the latest ESP32 using our toolbelt:

Code: Select all

git clone https://github.com/bitcraze/aideck-esp-firmware.git
cd aideck-esp-firmware
tb update
tb make
docker run --rm -it -v $PWD:/module/ --device /dev/ttyUSB0 --privileged -P bitcraze/builder /bin/bash -c "openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg -c 'adapter_khz 20000' -c 'program_esp build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp build/aideck_esp.bin 0x10000 verify reset exit'"
Then clone and flash the latest GAP8 example firmware (without the bootloader).

Code: Select all

git clone https://github.com/bitcraze/aideck-gap8-examples.git
cd aideck-gap8-examples/GAP8/test_functionalities/wifi_jpeg_streamer/
docker pull bitcraze/aideck:4.8.0
docker run --rm -it -v $PWD:/module/data/ --device /dev/ttyUSB0 --privileged -P bitcraze/aideck:4.8.0 /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 image flash SETUP_WIFI_AP=1'
Restart the Crazyflie and make sure that both of the LEDs on the AI-deck is blinking.

Now connect to the Crazyflie and check the Console tab, it should have some printouts from the GAP8:

Code: Select all

-- WiFi image streamer example --
FC at 250 MHz
Now the AI-deck should act as a access point where you can connect (it's named "WiFi streamer example"). Connect to this and once connected run the following command in the GAP8 example repository:

Code: Select all

python opencv-viewer.py -n 192.168.4.1

Connecting to socket on 192.168.4.1:5000...
Socket connected
0.19070196151733398
5.243784552835364
0.15853166580200195
.....
You would also see some prinouts in the Crazyflie client console:

Code: Select all

AIDECK-ROUTER: CPX RX: Message from [0x02] to funt nction [0x04] (size=2)
AIDECK-ROUTER: WiFi client connected
connection status: 1
Captured in 74 ms
Sent in 6
Captured in 74 ms
Sent in 33
Captured in 74 ms
Sent in 28
Captured in 74 ms
Let me know how it goes, and if this works we can move on to the bootloader.
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

hi marcus
I have had a few issues, after downloading the aideck-esp-firmware i tried to run the docker code and get the foloowig error
embedded:startup.tcl:449: Error: ** Unable to reset target **
in procedure 'program_esp'
in procedure 'program_error' called at file "/new_home/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 85
at file "embedded:startup.tcl", line 449
I am using gap_sdk 4.7 and ubuntu 18.04
regards
rodrigo
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: aideck bootloader

Post by marcus »

Are you using the docker container for flashing the ESP or are you using a local installation?
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

hi
i am using a local installation of gap_sdk i downgraded to version 3.8.1 to see if that would work, but it hasnt.
rodrigo
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

Hi Marcus
I installed the gap_sdk on docker and tested it with this example: GAP8/image_processing_examples/image_manipulations and it worked just fine, but when I run the aideck-esp-firmware docker code I get the same error as I described on my previous post.
Rodrigo
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

Hi Marcus
I noticed the address to call openocd is different from the example that I used to test the installation of gap_sdk on docker which is:
-c ‘ export GAPY_OPENOCD_CABLE=interface/ftdi/olimex-arm-usb-tiny-h.cfg

and in the code to flash esp-firmware is:

-c “openocd -f Interface/ftdi/olimex-arm-usb-tiny-h.cfg
Maybe that’s the problem.
Rodrigo
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: aideck bootloader

Post by marcus »

Ok, thanks for the update. So just to make sure, you're using the toolbelt for the ESP32 (as described above) and you get an error when programming? Are you using the Olimex ARM-USB-TINY-H programmer? The reason I'm asking is that I'm using the toolbelt to build/flash the ESP32 and I'm not seeing the same error.
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

Hi
Yes I am using the Olimex Arm-usb-tiny-h programmer. I haven’t changed that piece of code yet, I’ll do it now and let you know the outcome.
Rodrigo
1pi
Member
Posts: 49
Joined: Mon Nov 23, 2020 1:28 am

Re: aideck bootloader

Post by 1pi »

hi marcus
could you please have a look at the complete output when i try to flash the ai-deck, there are a few errors.
I have the gap-sdk on my local machine, could this be causing problems, should i uninstall all the software regarding the installation of gap_sdk or do i needed.

(base) rodrigo@rodrigo-VirtualBox:~/aideck-esp-firmware$ docker run --rm -it - $PWD:/module/ --device /dev/ttyUSB0 --privileged -P bitcraze/builder /bin/bash -c "openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg -c 'adapter_khz 20000' -c 'program_esp build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp build/aideck_esp.bin 0x10000 verify reset exit'"
Open On-Chip Debugger v0.10.0-esp32-20210401 (2021-04-01-15:45)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 20000 kHz

Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x149511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x1)
Warn : JTAG tap: esp32.cpu0 UNEXPECTED: 0x149511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x1)
Error: JTAG tap: esp32.cpu0 expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Warn : JTAG tap: esp32.cpu1 UNEXPECTED: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Error: JTAG tap: esp32.cpu1 expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu1: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: esp32.cpu0 tap/device found: 0x149511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x1)
Warn : JTAG tap: esp32.cpu0 UNEXPECTED: 0x149511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x1)
Error: JTAG tap: esp32.cpu0 expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Warn : JTAG tap: esp32.cpu1 UNEXPECTED: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Error: JTAG tap: esp32.cpu1 expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu1: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Couldn't halt target before SoC reset
embedded:startup.tcl:449: Error: ** Unable to reset target **
in procedure 'program_esp'
in procedure 'program_error' called at file "/new_home/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 85
at file "embedded:startup.tcl", line 449
(base) rodrigo@rodrigo-VirtualBox:~/aideck-esp-firmware$
Post Reply