Upgrade to v4.5.3 - rpc spi no longer working

I have an application that uses my H7 plus as an rpc SPI slave. Was working with older firmware releases (I.e. v4.5.2 and v4.2.3) but with v4.5.3 no longer works.

Implementation is similar to the example „popular_features_as_the_remote_device“

Spi master is an Arduino based controller using the OpenMV Arduino RPC library version 1.0.9.

Hmmm, I specifically fixed this in a previous commit.

Can you post a bug on github? I will fix it next week.

Thanks,

I raised :
With v4.5.3 RPC SPI no longer works #2173

Thanks.

Thanks, will get it debugged and fixed soon.

firmware.zip (1.1 MB)

Hi, here’s a fixed firmware image for the H7 Plus.

Thanks.

I have tested this in my setup.
Shows as firmware version 4.5.4.

Doesn’t work. Same problem.

Hi, I was able to verify the fix on my setup and confirmed it worked. I can double check it.

I tried again. I have the same software running both on Arduino and Openmv.

If I load a known working firmware SPI works. When I load this one it doesn’t.

Could be that there were multiple breaking changes …

Uh, I’ll re-verify from the latest again… but it totally worked for me yesterday. I pulled the latest Arduino Library and ran the example demo.

Yeah, there might be an unrelated issue in your script that’s broken. Can you check that each function works still?

So tested on examples and they work with this build and I confirmed they don’t work with 4.5.3.

Now the funny part with my code , where the spi calls don’t work with this build, I managed to isolate the problem to importing some libraries that break the SPI.

No idea how this can happen. Have to isolate which one (or more) that makes this happen.

I did delete all imports in the various files and got my code to at least show the spi calls working.

Before spending a lot of time trying to isolate which import is breaking SPI RPC do you have any hunches?

Can it be that interface.loop() is just hanging not crashing or returning an error?

The easiest way to debug this is to run your script while the camera is attached to the IDE and connected to the Arduino.

When the script hits an issue, an exception will be raised, which the IDE will show. This works as long as you are not catching all exceptions.

Camera is connected .

The script loops at interface.loop() waiting for SPI calls .
No exceptions are raised.

With older firmware no issues. Some change broke it.

So very odd . Seems like the SPI working or not depends on how many lines of code I import with main. If I import my full program doesn’t work. If I don’t import some functions from different files it works.

This wasn’t happening in prior builds and hard to debug. Once in interface.loop() i can’t print anything out to debug (for example free memory) .

Hi, one of the Biggs east changes is the firmware is that we parse arguments now correctly and throw exceptions on code errors. If you are catching all exceptions it will be hard to see this now.

Ok I don’t understand what you mean by that. Way over my head.

Any idea why my code works with older firmware and wouldn’t work now?

Is there a way to debug when interface.loop() ?

I checked free memory before going to interface.loop() and there seems always to be more free memory then used.

How can importing more functions to the main make a difference between SPI working or not?

In interface.loop() I don’t know how exceptions are managed . I just call it from the script.

Can you post some code that I can reproduce the error with to debug? I need the code that causes the issue on either side.

I can’t post this specific code.

I can try to make something new but would take some time.

I see rpc.py changed between builds.

I haven’t managed to get a build process going for me. Tried the docker instructions but didn’t manage.

Could you build on that last firmware you gave me instrumenting rpc.py so that it prints what it’s doing while in .loop()?

Maybe I can get the information you’d need to debug that way.

Hi, just grab the rpc.py code from online. Copy it to your disk and add print statements. It will override the internal one.