I am seeing the below warnings while compiling a simple program with a SparkFun RED-V Thing Plus, Platformio/VS Code.
A past post suggests a similar errors were fixed by updating the J-link driver for the microcontroller.
How exactly does one check the J-link version and update if needed? Warnings and code at bottom.
/Users/.platformio/packages/framework-freedom-e-sdk/freedom-metal/src/drivers/sifive_i2c0.c: In function ‘__metal_driver_sifive_i2c0_transfer’:
/Users/.platformio/packages/framework-freedom-e-sdk/freedom-metal/src/drivers/sifive_i2c0.c:330:9: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int ret;
^~~
/Users/.platformio/packages/framework-freedom-e-sdk/freedom-metal/src/shutdown.c:15:9: note: #pragma message: There is no defined shutdown mechanism, metal_shutdown() will spin. #pragma message(
^~~~~~~
So I poked around the open source Freedom E SDK and Freedom Metal.
(Disclaimer: I have almost no idea what I am doing, slowly learning as I go.)
As pictured in my linked images, there are errors related to:
“src/shutdown.c” Per the “shutdown” API brief, shutdown “Shuts down the machine, if the machine enables an interface for shutting down. When no interface is provided, will cause the machine to spin indefinitely.” Seems to align with the #pragma warning: “There is no defined shutdown mechanism. metal_shutdown() will spin.” Might this point to an i2C issue?
“/src/drivers/sifive_i2c0.c” Still learning C, but I can see the “__metal_driver_sifive_i2c0_transfer” function and “ret” variable in the github sifive_12c0.c file. I am trying to figure out what would cause the “may be used uninitialized in this function”, which seems to be fairly common C issue I don’t quite understand yet. Hopefully I can figure it out and propose a change.
Thank you Max. Noted these aren’t critical warnings and the github is idle. Regardless, it is a useful opportunity for a complete novice to struggle.
Why I2C? shutdown.c isn’t involved in that.
Agree. My theory is ‘shutdown’ is triggering a message because whatever ‘interface’ between the board and computer isn’t working properly, and since I am also see an i2C warning, I wonder if the “no interface is provided” that causes ‘shutdown’ to send a warning is indeed the i2c, possibly due to something goofy with how the variable “ret” is used around line 330 in i2c0.c, as noted in the i2c warning.