Added various boards to the makefile and config.h - Note. This is a work in progress

This commit is contained in:
rogerclarkmelbourne 2015-05-15 07:55:32 +10:00
parent f69d71ba9d
commit 6da18b60b7
9 changed files with 269 additions and 65 deletions

View File

@ -114,12 +114,14 @@ ELFSIZE = $(SIZE) -A $(TARGET).elf
# go! # go!
all: begin gccversion build sizeafter finished end all: begin gccversion build sizeafter finished end
maple-mini: begin gccversion build_maple-mini sizeafter finished copy_maple_mini end maple-mini: begin gccversion build_maple-mini sizeafter finished copy_maple_mini end
maple-rev3: begin gccversion build_maple-rev3 sizeafter finished end maple-rev3: begin gccversion build_maple-rev3 sizeafter finished copy_maple-rev3 end
maple-rev5: begin gccversion build_maple-rev5 sizeafter finished copy_maple-rev5 end
generic_stm32f103c8: begin gccversion build_generic-stm32f103c8 sizeafter finished copy_generic-stm32f103c8 end
build: elf bin lss sym build: elf bin lss sym
build_maple-mini: TARGETFLAGS= -DTARGET_MAPLE_MINI build_maple-mini: TARGETFLAGS= -DTARGET=MAPLE_MINI
build_maple-mini: elf bin lss sym build_maple-mini: elf bin lss sym
copy_maple_mini: copy_maple_mini:
@echo @echo
@ -128,9 +130,35 @@ copy_maple_mini:
cp $(TARGET).bin binaries/maple_mini_boot20.bin cp $(TARGET).bin binaries/maple_mini_boot20.bin
@echo @echo
build_maple-rev3: TARGETFLAGS= -DTARGET_MAPLE_REV3 build_maple-rev3: TARGETFLAGS= -DTARGET=MAPLE_REV3
build_maple-rev3: elf bin lss sym build_maple-rev3: elf bin lss sym
copy_maple-rev3:
@echo
@echo "Copying to binaries folder"
@echo
cp $(TARGET).bin binaries/maple_rev3_boot20.bin
@echo
build_maple-rev5: TARGETFLAGS= -DTARGET=MAPLE_REV5
build_maple-rev5: elf bin lss sym
copy_maple-rev5:
@echo
@echo "Copying to binaries folder"
@echo
cp $(TARGET).bin binaries/maple_rev5_boot20.bin
@echo
build_generic-stm32f103c8: TARGETFLAGS= -DTARGET=GENERIC_STM32F103C8
build_generic-stm32f103c8: elf bin lss sym
copy_generic-stm32f103c8:
@echo
@echo "Copying to binaries folder"
@echo
cp $(TARGET).bin binaries/generic_stm32f103c8_boot20.bin
@echo
bin: $(TARGET).bin bin: $(TARGET).bin
elf: $(TARGET).elf elf: $(TARGET).elf
lss: $(TARGET).lss lss: $(TARGET).lss

Binary file not shown.

Binary file not shown.

View File

@ -40,23 +40,187 @@
#define BLINK_SLOW 0x100000 #define BLINK_SLOW 0x100000
/* On the Mini, LED is PB1 */ /* On the Mini, LED is PB1 */
#if defined(TARGET_MAPLE_MINI) #if TARGET == MAPLE_MINI
#define LED_BANK GPIOB
#define LED 1
#define LED_BANK_CR GPIO_CRL(LED_BANK)
#define LED_CR_MASK 0xFFFFFF0F
#define LED_CR_MODE 0x00000010
#define RCC_APB2ENR_LED 0x00000008 /* enable PB */
/* On the Mini, BUT is PB8 */ /* Porting information Please read.
#define BUTTON_BANK GPIOB
#define BUTTON 8 These defineds are use to setup the hardware of the GPIO.
#define BUT_BANK_CR GPIO_CRH(BUTTON_BANK) See http://www.st.com/web/en/resource/technical/document/reference_manual/CD00171190.pdf
#define BUT_CR_MASK 0xFFFFFFF0
#define BUT_CR_OUTPUT_IN 0x00000004
#define RCC_APB2ENR_BUT 0x00000008 /* enable PB */ Two GPIO pins need to be defined, the LED and the Button.
For each pin, the following is required
LED_BANK, this is the GPIO port, e.g. GPIOA,GPIOB, GPIOC etc etc etc
LED, this is the pin number e.g PB1 = 1
LED_BANK_CR, this is the address of the port control register
for pins 0 to 7 its GPIO_CRL(LED_BANK)
for pins 8 to 15 its GPIO_CRH(LED_BANK)
This is because 2 different control registers are needed for the lower and upper 8 bits in the GPIO port (see the programming manual)
LED_CR_MASK, this is the 4 bit mask used to mask in the CR mode , i.e there are 4 bits per pin, hence pin 1 = 0xFFFFFF0F pin 0 would be 0xFFFFFFF0 etc
RCC_APB2ENR_LED, this is the clock control register for the port, without this setting to the RCC m the whole GPIO port wont work at all
See 7.3.7 APB2 peripheral clock enable register (RCC_APB2ENR) in the manual. page 112 and 113
Bit 8 IOPGEN: IO port G clock enable
Bit 7 IOPFEN: IO port F clock enable
Bit 6 IOPEEN: IO port E clock enable
Bit 5 IOPDEN: IO port D clock enable
Bit 4 IOPCEN: IO port C clock enable
Bit 3 IOPBEN: IO port B clock enable
Bit 2 IOPAEN: IO port A clock enable
*/
#define LED_BANK GPIOB
#define LED 1
#define LED_BANK_CR GPIO_CRL(LED_BANK)
#define LED_CR_MASK 0xFFFFFF0F
#define LED_CR_MODE 0x00000010
#define RCC_APB2ENR_LED 0x00000008 /* enable Port B (bit 3 - see table above IOPBEN)*/
/* On the Mini, BUT is PB8 */
#define BUTTON_BANK GPIOB
#define BUTTON 8
#define BUT_BANK_CR GPIO_CRH(BUTTON_BANK)
#define BUT_CR_MASK 0xFFFFFFF0
#define BUT_CR_OUTPUT_IN 0x00000004
#define RCC_APB2ENR_BUT 0x00000008 /* enable Port B (bit 3 - see table above IOPBEN)*/
// Use the usb_description_strings_util.html to make new strngs for the next 3 arrays if you need to change the text.
#define ALT0_STR_LEN 0x8E
#define ALT0_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'E',0,'R',0,'R',0,'O',0,'R',0,'.',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'R',0,'A',0,'M',0,' ',0,'i',0,'s',0,' ',0,'n',0,'o',0,'t',0,' ',0,'s',0,'u',0,'p',0,'p',0,'o',0,'r',0,'t',0,'e',0,'d',0,'.',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'m',0,'i',0,'n',0,'i',0,')',0
#define ALT1_STR_LEN 0x84
#define ALT1_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'5',0,'0',0,'0',0,'0',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'m',0,'i',0,'n',0,'i',0,')',0
#define ALT2_STR_LEN 0x84
#define ALT2_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'2',0,'0',0,'0',0,'0',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'m',0,'i',0,'n',0,'i',0,')',0
#define USER_CODE_RAM ((u32)0x20000C00)
#define RAM_END ((u32)0x20005000)
#define USER_CODE_FLASH0X8005000 ((u32)0x08005000)
#define USER_CODE_FLASH0X8002000 ((u32)0x08002000)
#define FLASH_END ((u32)0x08020000)
#elif TARGET == MAPLE_REV3
#define LED_BANK GPIOB
#define LED 1
#define LED_BANK_CR GPIO_CRL(LED_BANK)
#define LED_CR_MASK 0xFFFFFF0F
#define LED_CR_MODE 0x00000010
#define RCC_APB2ENR_LED 0x00000008 /* enable PB */
/* On the Mini, BUT is PB8 */
#define BUTTON_BANK GPIOB
#define BUTTON 8
#define BUT_BANK_CR GPIO_CRH(BUTTON_BANK)
#define BUT_CR_MASK 0xFFFFFFF0
#define BUT_CR_OUTPUT_IN 0x00000004
#define RCC_APB2ENR_BUT 0x00000008 /* enable PB */
// Use the usb_description_strings_util.html to make new strngs for the next 3 arrays if you need to change the text.
#define ALT0_STR_LEN 0x8E
#define ALT0_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'E',0,'R',0,'R',0,'O',0,'R',0,'.',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'R',0,'A',0,'M',0,' ',0,'i',0,'s',0,' ',0,'n',0,'o',0,'t',0,' ',0,'s',0,'u',0,'p',0,'p',0,'o',0,'r',0,'t',0,'e',0,'d',0,'.',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'R',0,'e',0,'v',0,'3',0,')',0
#define ALT1_STR_LEN 0x84
#define ALT1_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'5',0,'0',0,'0',0,'0',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'R',0,'e',0,'v',0,'3',0,')',0
#define ALT2_STR_LEN 0x84
#define ALT2_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'2',0,'0',0,'0',0,'0',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'R',0,'e',0,'v',0,'3',0,')',0
#define USER_CODE_RAM ((u32)0x20000C00)
#define RAM_END ((u32)0x20005000)
#define USER_CODE_FLASH0X8005000 ((u32)0x08005000)
#define USER_CODE_FLASH0X8002000 ((u32)0x08002000)
#define FLASH_END ((u32)0x08020000)
#elif TARGET == MAPLE_REV5
#define LED_BANK GPIOA
#define LED 5
#define LED_BANK_CR GPIO_CRL(LED_BANK)
#define LED_CR_MASK 0xFF0FFFFF
#define LED_CR_MODE 0x00000010
#define RCC_APB2ENR_LED 0x00000004 /* enable Part A (Bit 2) */
/* On the Mini, BUT is PB8 */
#define BUTTON_BANK GPIOC
#define BUTTON 9
#define BUT_BANK_CR GPIO_CRH(BUTTON_BANK)
#define BUT_CR_MASK 0xFFFFFF0F
#define BUT_CR_OUTPUT_IN 0x00000004
#define RCC_APB2ENR_BUT 0x00000010 /* enable Port C (Bit 4)*/
// Use the usb_description_strings_util.html to make new strngs for the next 3 arrays if you need to change the text.
#define ALT0_STR_LEN 0x8E
#define ALT0_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'E',0,'R',0,'R',0,'O',0,'R',0,'.',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'R',0,'A',0,'M',0,' ',0,'i',0,'s',0,' ',0,'n',0,'o',0,'t',0,' ',0,'s',0,'u',0,'p',0,'p',0,'o',0,'r',0,'t',0,'e',0,'d',0,'.',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'R',0,'e',0,'v',0,'5',0,')',0
#define ALT1_STR_LEN 0x84
#define ALT1_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'5',0,'0',0,'0',0,'0',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'R',0,'e',0,'v',0,'5',0,')',0
#define ALT2_STR_LEN 0x84
#define ALT2_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'2',0,'0',0,'0',0,'0',0,' ',0,'(',0,'M',0,'a',0,'p',0,'l',0,'e',0,'-',0,'R',0,'e',0,'v',0,'5',0,')',0
#define USER_CODE_RAM ((u32)0x20000C00)
#define RAM_END ((u32)0x20005000)
#define USER_CODE_FLASH0X8005000 ((u32)0x08005000)
#define USER_CODE_FLASH0X8002000 ((u32)0x08002000)
#define FLASH_END ((u32)0x08040000)
#elif TARGET == GENERIC_STM32F103C8
/* Most generic STM32F103C8 boards have the LED on PC13 */
//#warning "Data for STM32F103C8"
#define LED_BANK GPIOC
#define LED 13
// Note GPIO_CRH is high register for bits 8 to 15. (GPIO_CRL would be for bits 0 to 7)
#define LED_BANK_CR GPIO_CRH(LED_BANK)
// Bit mask for pin 13. Thus is the high 32 bits of the control register with 4 bits per pin
#define LED_CR_MASK 0xFF0FFFFF
#define LED_CR_MODE 0x00000010
#define RCC_APB2ENR_LED 0x00000010 /* enable Port C . Bit 4 IOPAEN: IO port C clock enable*/
/* Assign Button to PB8 the same as on the Maple mini */
#define BUTTON_BANK GPIOB
#define BUTTON 8
#define BUT_BANK_CR GPIO_CRH(BUTTON_BANK)
#define BUT_CR_MASK 0xFFFFFFF0
#define BUT_CR_OUTPUT_IN 0x00000004
#define RCC_APB2ENR_BUT 0x00000008 /* enable Port B . Bit 2 IOPAEN: IO port B clock enable*/
// Use the usb_description_strings_util.html to make new strngs for the next 3 arrays if you need to change the text.
#define ALT0_STR_LEN 0x90
#define ALT0_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'E',0,'R',0,'R',0,'O',0,'R',0,'.',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'R',0,'A',0,'M',0,' ',0,'i',0,'s',0,' ',0,'n',0,'o',0,'t',0,' ',0,'s',0,'u',0,'p',0,'p',0,'o',0,'r',0,'t',0,'e',0,'d',0,'.',0,' ',0,'(',0,'S',0,'T',0,'M',0,'3',0,'2',0,'F',0,'1',0,'0',0,'3',0,'C',0,'8',0,')',0
#define ALT1_STR_LEN 0x86
#define ALT1_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'5',0,'0',0,'0',0,'0',0,' ',0,'(',0,'S',0,'T',0,'M',0,'3',0,'2',0,'F',0,'1',0,'0',0,'3',0,'C',0,'8',0,')',0
#define ALT2_STR_LEN 0x86
#define ALT2_MSG_STR 'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,'.',0,'r',0,'c',0,'1',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'2',0,'0',0,'0',0,'0',0,' ',0,'(',0,'S',0,'T',0,'M',0,'3',0,'2',0,'F',0,'1',0,'0',0,'3',0,'C',0,'8',0,')',0
#define USER_CODE_RAM ((u32)0x20000C00)
#define RAM_END ((u32)0x20005000)
#define USER_CODE_FLASH0X8005000 ((u32)0x08005000)
#define USER_CODE_FLASH0X8002000 ((u32)0x08002000)
// 64k flash
#define FLASH_END ((u32)0x08010000)
#else #else
#error "No config for this target" #error "No config for this target"
#endif #endif
@ -64,11 +228,7 @@
#define STARTUP_BLINKS 5 #define STARTUP_BLINKS 5
#define BOOTLOADER_WAIT 6 #define BOOTLOADER_WAIT 6
#define USER_CODE_RAM ((u32)0x20000C00)
#define RAM_END ((u32)0x20005000)
#define USER_CODE_FLASH0X8005000 ((u32)0x08005000)
#define USER_CODE_FLASH0X8002000 ((u32)0x08002000)
#define FLASH_END ((u32)0x08020000)
#define VEND_ID0 0xAF #define VEND_ID0 0xAF
#define VEND_ID1 0x1E #define VEND_ID1 0x1E

View File

@ -35,6 +35,10 @@
#define GPIOA ((u32)0x40010800) #define GPIOA ((u32)0x40010800)
#define GPIOB ((u32)0x40010C00) #define GPIOB ((u32)0x40010C00)
#define GPIOC ((u32)0x40011000) #define GPIOC ((u32)0x40011000)
#define GPIOD ((u32)0x40011400)
#define GPIOE ((u32)0x40011800)
#define GPIOF ((u32)0x40011C00)
#define GPIOG ((u32)0x40012000)
#define RCC_CR RCC #define RCC_CR RCC
#define RCC_CFGR (RCC + 0x04) #define RCC_CFGR (RCC + 0x04)

View File

@ -178,26 +178,25 @@ u8 u8_usbStringSerial[USB_SERIAL_STR_LEN] = {
'L', 0, 'L', 0, 'M', 0, ' ', 0, '0', 0, '0', 0, '3', 0 'L', 0, 'L', 0, 'M', 0, ' ', 0, '0', 0, '0', 0, '3', 0
}; };
#define ALT0_STR_LEN 0x6A u8 u8_usbStringAlt0[ALT0_STR_LEN] = {
u8 u8_usbStringAlt0[ALT0_STR_LEN] = { ALT0_STR_LEN,
ALT0_STR_LEN, 0x03,
0x03, ALT0_MSG_STR
'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,' ',0,'E',0,'R',0,'R',0,'O',0,'R',0,'.',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'R',0,'A',0,'M',0,' ',0,'i',0,'s',0,' ',0,'n',0,'o',0,'t',0,' ',0,'s',0,'u',0,'p',0,'p',0,'o',0,'r',0,'t',0,'e',0,'d',0 };
};
#define ALT1_STR_LEN 0x62
u8 u8_usbStringAlt1[ALT1_STR_LEN] = {
ALT1_STR_LEN,
0x03,
'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'5',0,'0',0,'0',0,'0',0
};
#define ALT2_STR_LEN 0x62 u8 u8_usbStringAlt1[ALT1_STR_LEN] = {
u8 u8_usbStringAlt2[ALT2_STR_LEN] = { ALT1_STR_LEN,
ALT2_STR_LEN, 0x03,
0x03, ALT1_MSG_STR
'B',0,'o',0,'o',0,'t',0,'l',0,'o',0,'a',0,'d',0,'e',0,'r',0,' ',0,'2',0,'.',0,'0',0,' ',0,'U',0,'p',0,'l',0,'o',0,'a',0,'d',0,' ',0,'t',0,'o',0,' ',0,'F',0,'l',0,'a',0,'s',0,'h',0,' ',0,'a',0,'d',0,'d',0,'r',0,'e',0,'s',0,'s',0,' ',0,'0',0,'x',0,'8',0,'0',0,'0',0,'2',0,'0',0,'0',0,'0',0 };
};
u8 u8_usbStringAlt2[ALT2_STR_LEN] = {
ALT2_STR_LEN,
0x03,
ALT2_MSG_STR
};
u8 u8_usbStringInterface = NULL; u8 u8_usbStringInterface = NULL;
@ -210,27 +209,4 @@ ONE_DESCRIPTOR usbStringDescriptor[STR_DESC_LEN] = {
{ (u8 *)u8_usbStringAlt1, ALT1_STR_LEN }, { (u8 *)u8_usbStringAlt1, ALT1_STR_LEN },
{ (u8 *)u8_usbStringAlt2, ALT2_STR_LEN } { (u8 *)u8_usbStringAlt2, ALT2_STR_LEN }
}; };
/*
Roger.
Javascript utility to make new ALT ID text structs
<html>
<script>
function convertText(txt,idNum)
{
var txt2 ="#define ALT"+idNum+"_STR_LEN 0x"+(txt.length*2 + 2).toString(16).toUpperCase()+"<br/>u8 u8_usbStringAlt"+idNum+"[ALT"+idNum+"_STR_LEN] = {<br/>ALT"+idNum+"_STR_LEN,<br/>0x03,<br/>";
for (var i=0;i<txt.length;i++)
{
txt2+="'"+txt[i]+"',0,";
}
return txt2.substring(0,txt2.length-1)+"<br/>};<br/>";
}
document.write("<pre>");
document.write(convertText("Bootloader 2.0 ERROR. Upload to RAM is not supported",0)+"<br/>");
document.write(convertText("Bootloader 2.0 Upload to Flash address 0x8005000",1)+"<br/>");
document.write(convertText("Bootloader 2.0 Upload to Flash address 0x8002000",2)+"<br/>");
document.write("</pre>");
</script>
</html>
*/

View File

@ -0,0 +1,36 @@
<html>
<script>
function convertText(txt,idNum)
{
var txt2 ="#define ALT"+idNum+"_STR_LEN 0x"+(txt.length*2 + 2).toString(16).toUpperCase()+"<br/>\t#define ALT"+idNum+"_MSG_STR ";
for (var i=0;i<txt.length;i++)
{
txt2+="'"+txt[i]+"',0,";
}
return txt2.substring(0,txt2.length-1)+"<br/>";
}
document.write("<pre>Maple mini\n\n");
document.write("\t"+convertText("Bootloader 2.0.rc1 ERROR. Upload to RAM is not supported. (Maple-mini)",0)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8005000 (Maple-mini)",1)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8002000 (Maple-mini)",2)+"<br/>");
document.write("<pre>Maple Rev3\n\n");
document.write("\t"+convertText("Bootloader 2.0.rc1 ERROR. Upload to RAM is not supported. (Maple-Rev3)",0)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8005000 (Maple-Rev3)",1)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8002000 (Maple-Rev3)",2)+"<br/>");
document.write("<pre>Maple REV5 / RET 5 \n\n");
document.write("\t"+convertText("Bootloader 2.0.rc1 ERROR. Upload to RAM is not supported. (Maple-Rev5)",0)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8005000 (Maple-Rev5)",1)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8002000 (Maple-Rev5)",2)+"<br/>");
document.write("<pre>Generic STM32F103C8-LED_PC13\n\n");
document.write("\t"+convertText("Bootloader 2.0.rc1 ERROR. Upload to RAM is not supported. (STM32F103C8)",0)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8005000 (STM32F103C8)",1)+"<br/>");
document.write("\t"+convertText("Bootloader 2.0.rc1 Upload to Flash address 0x8002000 (STM32F103C8)",2)+"<br/>");
document.write("</pre>");
</script>
</html>