Reduce BUSY_TIMEOUT and handles FPC/FLASH FW more gracefully on non-RDV4 pm3

This commit is contained in:
Philippe Teuwen 2019-05-01 16:48:04 +02:00
parent ec5f70caf2
commit 9d261adfb1
4 changed files with 11 additions and 9 deletions

View file

@ -1564,15 +1564,16 @@ void __attribute__((noreturn)) AppMain(void) {
usart_init();
#endif
#ifdef WITH_FLASH
loadT55xxConfig();
#endif
// This is made as late as possible to ensure enumeration without timeout
// against device such as http://www.hobbytronics.co.uk/usb-host-board-v2
usb_disable();
usb_enable();
#ifdef WITH_FLASH
// If flash is not present, BUSY_TIMEOUT kicks in, let's do it after USB
loadT55xxConfig();
#endif
for (;;) {
WDT_HIT();

View file

@ -521,10 +521,10 @@ void Flashmem_print_status(void) {
Dbprintf(" Baudrate................%dMHz", FLASHMEM_SPIBAUDRATE / 1000000);
if (!FlashInit()) {
DbpString(" Init....................FAIL");
DbpString(" Init...................." _RED_("FAILED"));
return;
}
DbpString(" Init....................OK");
DbpString(" Init...................." _GREEN_("OK"));
uint8_t dev_id = Flash_ReadID();
switch (dev_id) {
@ -538,7 +538,7 @@ void Flashmem_print_status(void) {
DbpString(" Memory size.............512 kbits / 64kb");
break;
default :
DbpString(" Device ID............... --> Unknown <--");
DbpString(" Device ID..............." _YELLOW_(" --> Unknown <--"));
break;
}

View file

@ -61,7 +61,8 @@
#define SUSPEND 0x75
#define RESUME 0x7A
#define BUSY_TIMEOUT 1000000000L
// Flash busy timeout: 20ms is the strict minimum when writing 256kb
#define BUSY_TIMEOUT 50000L
#define WINBOND_MANID 0xEF
#define WINBOND_DEVID 0x11

View file

@ -600,7 +600,7 @@ void I2C_print_status(void) {
if (len > 0)
Dbprintf(" version.................v%x.%02d", resp[0], resp[1]);
else
DbpString(" version.................FAILED");
DbpString(" version................." _RED_("FAILED"));
}
// Will read response from smart card module, retries 3 times to get the data.