PlatformIO Community

How to Check J-link Driver Version + Update If Needed? (SparkFun RED-V Thing Plus, Platformio/VS Code)


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(

Full pics of code and terminal:

…But I don’t see how getting compiler warnings from the Freedom E SDK relates to a JLink driver update? These are completely separate.

These warnings aren’t critical, the program should still work.

Fixing them is something that must first be done in the SDK. But looking at

And it’s usages, it’s only defined emulated test cases (QEMU etc.), probably to indicate the end of the program.


I don’t agree with the compiler, in every codepath the variable is set before usage.

1 Like

Thanks, Max.

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:

  1. “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?
  2. “/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.

Why I2C? shutdown.c isn’t involved in that.

The GitHub - sifive/freedom-e-sdk: Open Source Software for Developing on the Freedom E Platform hasn’t received changes for over a year and has tons of PRs open, no idea what SiFive is doing there. I wouldn’t try to put effort in fixing that.

Again, these build warnings can be ignored. They should not affect your application in any way.

1 Like

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. :grinning:

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.

no idea what SiFive is doing

I messaged a SiFive software engineer on LinkedIn and received the below reply.

“Freedom E SDK has been deprecated. The SDK was intended to support Sifive Boards & SOCs. there’s a different software sdk for internal use.”

Marking your final comment as a solution. Thanks for engaging, Max.