Open krichardsson opened 1 year ago
I have one AI-deck where this is very consistently the issue. This AI deck has the latest ESP firmware (flashed via cfclient update) and gap8-bootloader (flashed via JTAG). When flashing, cfloader hangs for a while and the Crazyflie reboots. The assert information (via cfclient Assert info) is surprisingly an unrelated assert (note that the firmware does not crash using the 2022.09 release):
SYS: Assert failed at ../src/hal/src/radiolink.c:164
Ah, the magic radiolink.c:164 assert! We have seen this in relation to all sorts of problems and I think the general interpretation should be: "something in the STM is using too much CPU power". We get this assert when NRF is pushing radio packets faster than the STM is consuming them. I don't think the problem actually is radio link related, it is just a symptom.
Interesting that you get this assert though, I would have expected it to be one of the new asserts in the aideck code.
We just got this problem in the stability lab, but the assert was at line 136 in aideck.c
@whoenig do you still see this problem?
No - we have only used the AI deck with the JTAG adapter lately.
Had this again today with an assert in stream_buffer.c
(unfortunately didn't write down the exact line). There was no way out, except of flashing the GAP8 directly via JTAG.
hmm this is strange... We need to find time at one point to stabilize the aideck again but it is not really on our priority list right now. We now say for everybody that a jtag programmer is crucial.
gap8 flashing stops at ~6% when having a flow deck attached
I find that the success rate seems to be higher if we remove the multiranger and flow deck.
https://github.com/bitcraze/crazyflie-firmware/pull/1381 fixes OTA flashing for aideck+flowdeck+multiranger
Still happens for aideck+lighthouse. Assert aideck.c
ln 136
The lighthouse deck seems to add capacitance on VCOM, causing the GAP8 to not reset correctly
As a workaround, we tried a 4.5 kOhm resistor between VCOM and ground. This configuration drops the voltage quickly enough to successfully flash with the lighthouse attached. Note that we are using long wires, which might influence the outcome. Users may experiment with resistances around this range to achieve similar results.
One neat way of doing this would be to solder the resistor between the relevant pads on a battery holder.
Sometimes the flashing process is stopping around 3-4% when flashing a binary to the GAP8 from the cfloader. I have not investigated this deeply, but it seems as if the GAP8 is blocking for some reason. From a STM fw point of view, buffers are pushed to CPX, and the expected behavior is that the ESP passes them on to the GAP8 where they should be written to flash. The first incoming buffer will also trigger an erase of the first flash page.
3-4% is most likely the amount of data that fits into the CPX buffers between the STM and GAP8, that is the GAP8 is not consuming (writing data to flash) as expected. When the CPX buffers are full, the STM can not write any more which blocks the memory mapping task. When the memory mapping task stops sending back ACK packets to the python lib, the memory mapping write in the python lib stops. This is finally what stops the cfloader.
We recently added asserts in the STM fw that are triggered if a write to the GAP8 takes too long, one of them should reboot the Crazyflie when this happens. It can be a bit tricky to actually get the assert information out in this scenario, but there are two options
enable_console_lo
toTrue
in the deck flashing code