Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efinix: program reports success (returns 0) when programming fails #476

Open
AndrewD opened this issue Jul 25, 2024 · 3 comments
Open

efinix: program reports success (returns 0) when programming fails #476

AndrewD opened this issue Jul 25, 2024 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@AndrewD
Copy link

AndrewD commented Jul 25, 2024

Efinix: programming errors still result in a success return code so there is no way for a script to detect errors from the return value.

This interface needs to be able to propagate errors (not return void):

void program(unsigned int offset, bool unprotect_flash) override;

@trabucayre
Copy link
Owner

In fact for all vendor's drivers program method throw exceptions when something is wrong.
But it's true, changing program to a non void method may be more easy to manage
And for efinix most of errors doesn't produces exception.

@trabucayre trabucayre added bug Something isn't working enhancement New feature or request labels Jul 25, 2024
@AndrewD
Copy link
Author

AndrewD commented Jul 25, 2024

If throwing an exception is the existing pattern then following this for Efinix would be sufficient for now - openfpgaloader just returning a non-zero value on error is all we need.

@AndrewD AndrewD changed the title openfpgaloader reports success (returns 0) when programming fails efinix: program reports success (returns 0) when programming fails Jul 25, 2024
@trabucayre
Copy link
Owner

with this commit all errors are correctly handled by program() method.
It's good to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants