STM32F1, AT32F4: Dynamic USB buffer sizing.

Also tweak firmware update with useful error messages if updates
don't fit in SRAM (bootloader updates) or Flash (main firmware updates).
This commit is contained in:
Keir Fraser
2021-10-04 10:35:09 +01:00
parent 6f45c298ad
commit 08916f8129
14 changed files with 104 additions and 32 deletions

View File

@@ -104,6 +104,8 @@
#define ACK_BAD_UNIT 9
#define ACK_BAD_PIN 10
#define ACK_BAD_CYLINDER 11
#define ACK_OUT_OF_SRAM 12
#define ACK_OUT_OF_FLASH 13
/*

View File

@@ -91,6 +91,7 @@ bool_t gpio_pins_connected(GPIO gpio1, unsigned int pin1,
void fpec_init(void);
void fpec_page_erase(uint32_t flash_address);
void fpec_write(const void *data, unsigned int size, uint32_t flash_address);
extern unsigned int flash_kb;
/* Pin mappings */
enum { _A = 0, _B, _C, _D, _E, _F, _G, _H, _I };

View File

@@ -63,6 +63,8 @@ static SER_ID ser_id = (uint32_t *)0x1ffff7e8;
/* No secondary RAM region */
#define section_ext_ram
extern unsigned int sram_kb;
enum {
F1SM_basic = 0,
F1SM_plus,