We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
uint8_t erase_flash (void), exit with a timeout, but the program still manages to program the chip.
The erase_flash return status is ignored, thus the error is 'not visible.
visible.
I changed the function to log the error on the serial terminal. I always get timeout 2, even if the timeout is 1 sec.
/** ---------------------------------------------------------------------------
@brief erase_flash
@return uint8_t */ uint8_t erase_flash (void) { gprintf ("\r\n Erasing flash.. please wait .."); write_register(0x4001e504, 2);
long timeout = millis(); while (read_register(0x4001e400) != 1) { if (millis()-timeout > TIMEOUT) { gprintf ( "\r\n Erasing timeout 1 .."); return 1; } }
write_register(0x4001e50c, 1);
timeout = millis(); while (read_register(0x4001e400) != 1) { if(millis()-timeout > TIMEOUT) { gprintf ( "\r\n Erasing timeout 2..."); return 1; } } write_register(0x4001e504, 0); timeout = millis(); while (read_register(0x4001e400) != 1) { if(millis()-timeout > TIMEOUT) { gprintf ("\r\n Erasing timeout 3..."); return 1; } } gprintf ( "\r\n Erasing done .."); return 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
uint8_t erase_flash (void), exit with a timeout, but the program still manages to program the chip.
The erase_flash return status is ignored, thus the error is 'not
visible.
I changed the function to log the error on the serial terminal. I always get timeout 2, even if the timeout is 1 sec.
/** ---------------------------------------------------------------------------
@brief erase_flash
@return uint8_t
*/
uint8_t erase_flash (void)
{
gprintf ("\r\n Erasing flash.. please wait ..");
write_register(0x4001e504, 2);
long timeout = millis();
while (read_register(0x4001e400) != 1)
{
if (millis()-timeout > TIMEOUT)
{
gprintf ( "\r\n Erasing timeout 1 ..");
return 1;
}
}
write_register(0x4001e50c, 1);
timeout = millis();
while (read_register(0x4001e400) != 1)
{
if(millis()-timeout > TIMEOUT)
{
gprintf ( "\r\n Erasing timeout 2...");
return 1;
}
}
write_register(0x4001e504, 0);
timeout = millis();
while (read_register(0x4001e400) != 1)
{
if(millis()-timeout > TIMEOUT)
{
gprintf ("\r\n Erasing timeout 3...");
return 1;
}
}
gprintf ( "\r\n Erasing done ..");
return 0;
}
The text was updated successfully, but these errors were encountered: