From c1397ed69110bb9c77227d11aec0416a304dfa38 Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Mon, 8 Mar 2021 13:11:20 +1000 Subject: [PATCH] More work to merge revF and 2020/2021 branches --- Makefile.2020c | 2 +- Makefile.revF | 189 +++--- STM32CubeMX/revF/Inc/main.h | 12 +- STM32CubeMX/revF/Src/gpio.c | 18 +- .../SCSI2SD-V6 Configuration/.cproject | 170 ----- .../SCSI2SD-V6 Configuration/.project | 636 ------------------ .../revF/TrueSTUDIO/revF/revF.elf.launch | 4 +- STM32CubeMX/revF/revF.ioc | 10 +- src/firmware/hwversion.c | 22 +- src/firmware/main.c | 2 + 10 files changed, 135 insertions(+), 930 deletions(-) delete mode 100644 STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.cproject delete mode 100644 STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.project diff --git a/Makefile.2020c b/Makefile.2020c index bbc1f9f1..bb2afd60 100644 --- a/Makefile.2020c +++ b/Makefile.2020c @@ -2,7 +2,7 @@ ARMCC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy -CPPFLAGS=-DSTM32F205xx -DSTM32F2xx -DUSE_HAL_DRIVER -Wall -DS2S_USB_FS +CPPFLAGS=-DSTM32F205xx -DSTM32F2xx -DUSE_HAL_DRIVER -Wall -DS2S_USB_FS -DREV_2020 CFLAGS=-mcpu=cortex-m3 -mthumb -mslow-flash-data \ -std=gnu11 \ -specs=nosys.specs \ diff --git a/Makefile.revF b/Makefile.revF index 4099808b..5dadcc24 100644 --- a/Makefile.revF +++ b/Makefile.revF @@ -2,7 +2,7 @@ ARMCC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy -CPPFLAGS=-DSTM32F2xx -DSTM32F205xx -DUSE_HAL_DRIVER -Wall +CPPFLAGS=-DSTM32F2xx -DSTM32F205xx -DUSE_HAL_DRIVER -Wall -DS2S_USB_FS -DREV_2019 CFLAGS=-mcpu=cortex-m3 -mthumb -mslow-flash-data \ -std=gnu11 \ -specs=nosys.specs \ @@ -26,96 +26,80 @@ STM32CubeMX_INCUDE = \ -ISTM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Inc \ -Isrc/firmware/usb_device \ -all: build/firmware.dfu - -build/stm32cubemx/bsp_driver_sd.o: STM32CubeMX/revF/Src/bsp_driver_sd.c -build/stm32cubemx/fsmc.o: STM32CubeMX/revF/Src/fsmc.c -build/stm32cubemx/gpio.o: STM32CubeMX/revF/Src/gpio.c -build/stm32cubemx/main.o: STM32CubeMX/revF/Src/main.c -build/stm32cubemx/sdio.o: STM32CubeMX/revF/Src/sdio.c -build/stm32cubemx/spi.o: STM32CubeMX/revF/Src/spi.c -build/stm32cubemx/stm32f2xx_hal_msp.o: STM32CubeMX/revF/Src/stm32f2xx_hal_msp.c -build/stm32cubemx/stm32f2xx_it.o: STM32CubeMX/revF/Src/stm32f2xx_it.c -build/stm32cubemx/usart.o: STM32CubeMX/revF/Src/usart.c -build/stm32cubemx/usbd_conf.o: STM32CubeMX/revF/Src/usbd_conf.c -build/stm32cubemx/usbh_conf.o: STM32CubeMX/revF/Src/usbh_conf.c -build/stm32cubemx/usb_host.o: STM32CubeMX/revF/Src/usb_host.c -build/stm32cubemx/stm32f2xx_hal.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c -build/stm32cubemx/stm32f2xx_hal_cortex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_cortex.c -build/stm32cubemx/stm32f2xx_hal_dma.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_dma.c -build/stm32cubemx/stm32f2xx_hal_flash.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash.c -build/stm32cubemx/stm32f2xx_hal_flash_ex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash_ex.c -build/stm32cubemx/stm32f2xx_hal_gpio.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c -build/stm32cubemx/stm32f2xx_hal_hcd.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_hcd.c -build/stm32cubemx/stm32f2xx_hal_pcd.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd.c -build/stm32cubemx/stm32f2xx_hal_pcd_ex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd_ex.c -build/stm32cubemx/stm32f2xx_hal_rcc.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_rcc.c -build/stm32cubemx/stm32f2xx_hal_sd.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sd.c -build/stm32cubemx/stm32f2xx_hal_spi.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_spi.c -build/stm32cubemx/stm32f2xx_hal_sram.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sram.c -build/stm32cubemx/stm32f2xx_hal_tim.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim.c -build/stm32cubemx/stm32f2xx_hal_tim_ex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim_ex.c -build/stm32cubemx/stm32f2xx_hal_uart.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c -build/stm32cubemx/stm32f2xx_ll_fsmc.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_fsmc.c -build/stm32cubemx/stm32f2xx_ll_sdmmc.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_sdmmc.c -build/stm32cubemx/stm32f2xx_ll_usb.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_usb.c -build/stm32cubemx/usbd_core.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c -build/stm32cubemx/usbd_ctlreq.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c -build/stm32cubemx/usbd_ioreq.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c -build/stm32cubemx/usbh_core.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c -build/stm32cubemx/usbh_ctlreq.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c -build/stm32cubemx/usbh_ioreq.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c -build/stm32cubemx/usbh_pipes.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c -build/stm32cubemx/usbh_msc.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c -build/stm32cubemx/usbh_msc_bot.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c -build/stm32cubemx/usbh_msc_scsi.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_scsi.c -build/stm32cubemx/system_stm32f2xx.o: STM32CubeMX/revF/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c -build/stm32cubemx/startup_stm32f205xx.o: STM32CubeMX/revF/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s +all: build/firmware.V6.revF.dfu + +build/revF/stm32cubemx/dma.o: STM32CubeMX/revF/Src/dma.c +build/revF/stm32cubemx/fsmc.o: STM32CubeMX/revF/Src/fsmc.c +build/revF/stm32cubemx/gpio.o: STM32CubeMX/revF/Src/gpio.c +build/revF/stm32cubemx/main.o: STM32CubeMX/revF/Src/main.c +build/revF/stm32cubemx/sdio.o: STM32CubeMX/revF/Src/sdio.c +build/revF/stm32cubemx/spi.o: STM32CubeMX/revF/Src/spi.c +build/revF/stm32cubemx/tim.o: STM32CubeMX/revF/Src/tim.c +build/revF/stm32cubemx/stm32f2xx_hal_msp.o: STM32CubeMX/revF/Src/stm32f2xx_hal_msp.c +build/revF/stm32cubemx/stm32f2xx_it.o: STM32CubeMX/revF/Src/stm32f2xx_it.c +build/revF/stm32cubemx/usart.o: STM32CubeMX/revF/Src/usart.c +build/revF/stm32cubemx/usbd_conf.o: STM32CubeMX/revF/Src/usbd_conf.c +build/revF/stm32cubemx/stm32f2xx_hal.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c +build/revF/stm32cubemx/stm32f2xx_hal_cortex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_cortex.c +build/revF/stm32cubemx/stm32f2xx_hal_dma.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_dma.c +build/revF/stm32cubemx/stm32f2xx_hal_flash.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash.c +build/revF/stm32cubemx/stm32f2xx_hal_flash_ex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash_ex.c +build/revF/stm32cubemx/stm32f2xx_hal_gpio.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c +build/revF/stm32cubemx/stm32f2xx_hal_hcd.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_hcd.c +build/revF/stm32cubemx/stm32f2xx_hal_pcd.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd.c +build/revF/stm32cubemx/stm32f2xx_hal_pcd_ex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd_ex.c +build/revF/stm32cubemx/stm32f2xx_hal_rcc.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_rcc.c +build/revF/stm32cubemx/stm32f2xx_hal_sd.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sd.c +build/revF/stm32cubemx/stm32f2xx_hal_spi.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_spi.c +build/revF/stm32cubemx/stm32f2xx_hal_sram.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sram.c +build/revF/stm32cubemx/stm32f2xx_hal_tim.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim.c +build/revF/stm32cubemx/stm32f2xx_hal_tim_ex.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim_ex.c +build/revF/stm32cubemx/stm32f2xx_hal_uart.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c +build/revF/stm32cubemx/stm32f2xx_ll_fsmc.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_fsmc.c +build/revF/stm32cubemx/stm32f2xx_ll_sdmmc.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_sdmmc.c +build/revF/stm32cubemx/stm32f2xx_ll_usb.o: STM32CubeMX/revF/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_usb.c +build/revF/stm32cubemx/usbd_core.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c +build/revF/stm32cubemx/usbd_ctlreq.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c +build/revF/stm32cubemx/usbd_ioreq.o: STM32CubeMX/revF/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c +build/revF/stm32cubemx/system_stm32f2xx.o: STM32CubeMX/revF/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c +build/revF/stm32cubemx/startup_stm32f205xx.o: STM32CubeMX/revF/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s STM32OBJS = \ - build/stm32cubemx/bsp_driver_sd.o \ - build/stm32cubemx/fsmc.o \ - build/stm32cubemx/gpio.o \ - build/stm32cubemx/main.o \ - build/stm32cubemx/sdio.o \ - build/stm32cubemx/spi.o \ - build/stm32cubemx/stm32f2xx_hal_msp.o \ - build/stm32cubemx/stm32f2xx_it.o \ - build/stm32cubemx/usart.o \ - build/stm32cubemx/usbd_conf.o \ - build/stm32cubemx/usbh_conf.o \ - build/stm32cubemx/usb_host.o \ - build/stm32cubemx/stm32f2xx_hal.o \ - build/stm32cubemx/stm32f2xx_hal_cortex.o \ - build/stm32cubemx/stm32f2xx_hal_dma.o \ - build/stm32cubemx/stm32f2xx_hal_flash.o \ - build/stm32cubemx/stm32f2xx_hal_flash_ex.o \ - build/stm32cubemx/stm32f2xx_hal_gpio.o \ - build/stm32cubemx/stm32f2xx_hal_hcd.o \ - build/stm32cubemx/stm32f2xx_hal_pcd.o \ - build/stm32cubemx/stm32f2xx_hal_pcd_ex.o \ - build/stm32cubemx/stm32f2xx_hal_rcc.o \ - build/stm32cubemx/stm32f2xx_hal_sd.o \ - build/stm32cubemx/stm32f2xx_hal_spi.o \ - build/stm32cubemx/stm32f2xx_hal_sram.o \ - build/stm32cubemx/stm32f2xx_hal_tim.o \ - build/stm32cubemx/stm32f2xx_hal_tim_ex.o \ - build/stm32cubemx/stm32f2xx_hal_uart.o \ - build/stm32cubemx/stm32f2xx_ll_fsmc.o \ - build/stm32cubemx/stm32f2xx_ll_sdmmc.o \ - build/stm32cubemx/stm32f2xx_ll_usb.o \ - build/stm32cubemx/usbd_core.o \ - build/stm32cubemx/usbd_ctlreq.o \ - build/stm32cubemx/usbd_ioreq.o \ - build/stm32cubemx/usbh_core.o \ - build/stm32cubemx/usbh_ctlreq.o \ - build/stm32cubemx/usbh_ioreq.o \ - build/stm32cubemx/usbh_pipes.o \ - build/stm32cubemx/usbh_msc.o \ - build/stm32cubemx/usbh_msc_bot.o \ - build/stm32cubemx/usbh_msc_scsi.o \ - build/stm32cubemx/system_stm32f2xx.o \ - build/stm32cubemx/startup_stm32f205xx.o \ + build/revF/stm32cubemx/dma.o \ + build/revF/stm32cubemx/fsmc.o \ + build/revF/stm32cubemx/gpio.o \ + build/revF/stm32cubemx/main.o \ + build/revF/stm32cubemx/sdio.o \ + build/revF/stm32cubemx/spi.o \ + build/revF/stm32cubemx/tim.o \ + build/revF/stm32cubemx/stm32f2xx_hal_msp.o \ + build/revF/stm32cubemx/stm32f2xx_it.o \ + build/revF/stm32cubemx/usart.o \ + build/revF/stm32cubemx/usbd_conf.o \ + build/revF/stm32cubemx/stm32f2xx_hal.o \ + build/revF/stm32cubemx/stm32f2xx_hal_cortex.o \ + build/revF/stm32cubemx/stm32f2xx_hal_dma.o \ + build/revF/stm32cubemx/stm32f2xx_hal_flash.o \ + build/revF/stm32cubemx/stm32f2xx_hal_flash_ex.o \ + build/revF/stm32cubemx/stm32f2xx_hal_gpio.o \ + build/revF/stm32cubemx/stm32f2xx_hal_hcd.o \ + build/revF/stm32cubemx/stm32f2xx_hal_pcd.o \ + build/revF/stm32cubemx/stm32f2xx_hal_pcd_ex.o \ + build/revF/stm32cubemx/stm32f2xx_hal_rcc.o \ + build/revF/stm32cubemx/stm32f2xx_hal_sd.o \ + build/revF/stm32cubemx/stm32f2xx_hal_spi.o \ + build/revF/stm32cubemx/stm32f2xx_hal_sram.o \ + build/revF/stm32cubemx/stm32f2xx_hal_tim.o \ + build/revF/stm32cubemx/stm32f2xx_hal_tim_ex.o \ + build/revF/stm32cubemx/stm32f2xx_hal_uart.o \ + build/revF/stm32cubemx/stm32f2xx_ll_fsmc.o \ + build/revF/stm32cubemx/stm32f2xx_ll_sdmmc.o \ + build/revF/stm32cubemx/stm32f2xx_ll_usb.o \ + build/revF/stm32cubemx/usbd_core.o \ + build/revF/stm32cubemx/usbd_ctlreq.o \ + build/revF/stm32cubemx/usbd_ioreq.o \ + build/revF/stm32cubemx/system_stm32f2xx.o \ + build/revF/stm32cubemx/startup_stm32f205xx.o \ # Modified versin from stm32cubemx for a composite class with both # mass-storage and HID interfaces @@ -153,46 +137,47 @@ SRC = \ src/firmware/tape.c \ src/firmware/time.c \ src/firmware/vendor.c \ + src/firmware/bsp_driver_sd.c \ ${USBCOMPOSITE_SRC} -build/firmware.elf: $(SRC) rtl/fpga_bitmap.o $(STM32OBJS) +build/revF/firmware.elf: $(SRC) rtl/fpga_bitmap.o $(STM32OBJS) $(ARMCC) $(CPPFLAGS) $(CFLAGS) -o $@ $(STM32CubeMX_INCUDE) $(INCLUDE) $^ $(LDFLAGS) - @EBSS=`arm-none-eabi-nm build/firmware.elf | grep _ebss | cut -f1 "-d "`; \ + @EBSS=`arm-none-eabi-nm build/revF/firmware.elf | grep _ebss | cut -f1 "-d "`; \ echo HEAPSIZE = $$((0x2001C000 - 0x$${EBSS})) bytes @echo STACKSIZE = 16384 bytes -build/firmware.bin: build/firmware.elf +build/revF/firmware.bin: build/revF/firmware.elf $(OBJCOPY) -O binary $< $@ # Example to hard-code config within firmware #sudo arm-none-eabi-objcopy --update-section .fixed_config=config.dat firmware.elf -O binary firmware.bin -build/stm32cubemx/%.o: - mkdir -p build/stm32cubemx +build/revF/stm32cubemx/%.o: + mkdir -p build/revF/stm32cubemx $(ARMCC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(STM32CubeMX_INCUDE) $(INCLUDE) $^ -build/stm32cubemx/stm32f2xx_it.o: - mkdir -p build/stm32cubemx +build/revF/stm32cubemx/stm32f2xx_it.o: + mkdir -p build/revF/stm32cubemx $(ARMCC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(STM32CubeMX_INCUDE) $(INCLUDE) $^ $(OBJCOPY) -N EXTI4_IRQHandler $@ -build/stm32cubemx/system_stm32f2xx.o: - mkdir -p build/stm32cubemx +build/revF/stm32cubemx/system_stm32f2xx.o: + mkdir -p build/revF/stm32cubemx $(ARMCC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(STM32CubeMX_INCUDE) $(INCLUDE) $^ $(OBJCOPY) --redefine-sym SystemInit=OrigSystemInit $@ -build/scsiPhy.s: src/firmware/scsiPhy.c +build/revF/scsiPhy.s: src/firmware/scsiPhy.c $(ARMCC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $(STM32CubeMX_INCUDE) $(INCLUDE) $^ -build/firmware.dfu: build/firmware.bin +build/firmware.V6.revF.dfu: build/revF/firmware.bin python tools/dfu-convert.py -b 0x08000000:$< $@ clean: - rm -f build/firmware.elf build/firmware.bin + rm -rf build/revF build/firmware.V6.revF.dfu program: - dfu-util --download build/firmware.dfu --alt 0 + dfu-util --download build/firmware.V6.revF.dfu --alt 0 diff --git a/STM32CubeMX/revF/Inc/main.h b/STM32CubeMX/revF/Inc/main.h index a257d76c..cb5272c0 100644 --- a/STM32CubeMX/revF/Inc/main.h +++ b/STM32CubeMX/revF/Inc/main.h @@ -91,12 +91,12 @@ void Error_Handler(void); #define UNUSED_PA3_GPIO_Port GPIOA #define nSPICFG_CS_Pin GPIO_PIN_4 #define nSPICFG_CS_GPIO_Port GPIOA -#define UNUSED_PC4_Pin GPIO_PIN_4 -#define UNUSED_PC4_GPIO_Port GPIOC -#define UNUSED_PC5_Pin GPIO_PIN_5 -#define UNUSED_PC5_GPIO_Port GPIOC -#define LED_Pin GPIO_PIN_0 -#define LED_GPIO_Port GPIOB +#define VER_ID1_Pin GPIO_PIN_4 +#define VER_ID1_GPIO_Port GPIOC +#define VER_ID2_Pin GPIO_PIN_5 +#define VER_ID2_GPIO_Port GPIOC +#define LED_IO_Pin GPIO_PIN_0 +#define LED_IO_GPIO_Port GPIOB #define nTERM_EN_Pin GPIO_PIN_1 #define nTERM_EN_GPIO_Port GPIOB #define BOOT1_Pin GPIO_PIN_2 diff --git a/STM32CubeMX/revF/Src/gpio.c b/STM32CubeMX/revF/Src/gpio.c index c33a04cb..c3b55254 100644 --- a/STM32CubeMX/revF/Src/gpio.c +++ b/STM32CubeMX/revF/Src/gpio.c @@ -54,7 +54,7 @@ void MX_GPIO_Init(void) __HAL_RCC_GPIOD_CLK_ENABLE(); /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOB, LED_Pin|nTERM_EN_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(GPIOB, LED_IO_Pin|nTERM_EN_Pin, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(FPGA_RST_GPIO_Port, FPGA_RST_Pin, GPIO_PIN_RESET); @@ -72,11 +72,9 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /*Configure GPIO pins : PCPin PCPin PCPin PCPin - PCPin PCPin PCPin PCPin - PCPin */ + PCPin PCPin PCPin */ GPIO_InitStruct.Pin = UNUSED_PC13_Pin|UNUSED_PC14_Pin|UNUSED_PC15_Pin|UNUSED_PC0_Pin - |UNUSED_PC1_Pin|UNUSED_PC2_Pin|UNUSED_PC3_Pin|UNUSED_PC4_Pin - |UNUSED_PC5_Pin; + |UNUSED_PC1_Pin|UNUSED_PC2_Pin|UNUSED_PC3_Pin; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_PULLDOWN; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); @@ -93,12 +91,18 @@ void MX_GPIO_Init(void) GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(nSPICFG_CS_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pins : PCPin PCPin */ + GPIO_InitStruct.Pin = VER_ID1_Pin|VER_ID2_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; + GPIO_InitStruct.Pin = LED_IO_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_PULLDOWN; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); + HAL_GPIO_Init(LED_IO_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pin : PtPin */ GPIO_InitStruct.Pin = nTERM_EN_Pin; diff --git a/STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.cproject b/STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.cproject deleted file mode 100644 index b322318f..00000000 --- a/STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.cproject +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.project b/STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.project deleted file mode 100644 index 55eb0ffc..00000000 --- a/STM32CubeMX/revF/TrueSTUDIO/SCSI2SD-V6 Configuration/.project +++ /dev/null @@ -1,636 +0,0 @@ - - - SCSI2SD-V6 Configuration - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/STM32100B-EVAL/Debug} - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - - - - - - Drivers/CMSIS - 2 - virtual:/virtual - - - 2 - - - - 2 - - - Middlewares/FatFs - 2 - virtual:/virtual - - Middlewares/USB_Device_Library - 2 - virtual:/virtual - - Middlewares/USB_Host_Library - 2 - virtual:/virtual - - - 2 - - - Application/User - 2 - virtual:/virtual - - Drivers/STM32F2xx_HAL_Driver - 2 - virtual:/virtual - - Application/TrueSTUDIO - 2 - virtual:/virtual - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_sram.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sram.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_ll_sdmmc.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_sdmmc.c - - Application/User/stm32f2xx_hal_msp.c - 1 - PARENT-2-PROJECT_LOC/Src/stm32f2xx_hal_msp.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_rcc_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_rcc_ex.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pwr_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pwr_ex.c - - Middlewares/FatFs/ff.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/ff.c - - Application/User/usb_host.c - 1 - PARENT-2-PROJECT_LOC/Src/usb_host.c - - Middlewares/USB_Host_Library/usbh_core.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c - - Application/User/dma.c - 1 - PARENT-2-PROJECT_LOC/Src/dma.c - - Middlewares/USB_Host_Library/usbh_pipes.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c - - Middlewares/FatFs/syscall.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/option/syscall.c - - Middlewares/USB_Device_Library/usbd_ctlreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c - - Drivers/CMSIS/system_stm32f2xx.c - 1 - PARENT-2-PROJECT_LOC/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c - - Middlewares/USB_Host_Library/usbh_ioreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_ll_usb.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_usb.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_dma_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_dma_ex.c - - Middlewares/FatFs/ff_gen_drv.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/ff_gen_drv.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_gpio.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c - - Middlewares/USB_Host_Library/usbh_ctlreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c - - Middlewares/FatFs/sd_diskio.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_ll_fsmc.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_fsmc.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_rcc.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_rcc.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_spi.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_spi.c - - Application/User/fsmc.c - 1 - PARENT-2-PROJECT_LOC/Src/fsmc.c - - Middlewares/USB_Host_Library/usbh_msc.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pcd.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pwr.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pwr.c - - Application/User/usbd_conf.c - 1 - PARENT-2-PROJECT_LOC/Src/usbd_conf.c - - Application/User/usart.c - 1 - PARENT-2-PROJECT_LOC/Src/usart.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pcd_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd_ex.c - - Application/User/spi.c - 1 - PARENT-2-PROJECT_LOC/Src/spi.c - - Application/TrueSTUDIO/startup_stm32f205xx.s - 1 - PARENT-2-PROJECT_LOC/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_uart.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_tim.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_sd.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sd.c - - Middlewares/USB_Host_Library/usbh_msc_scsi.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_scsi.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_hcd.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_hcd.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_dma.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_dma.c - - Application/User/usbd_desc.c - 1 - PARENT-2-PROJECT_LOC/Src/usbd_desc.c - - Middlewares/USB_Device_Library/usbd_ioreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_flash.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash.c - - Application/User/usbh_conf.c - 1 - PARENT-2-PROJECT_LOC/Src/usbh_conf.c - - Middlewares/USB_Device_Library/usbd_core.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c - - Middlewares/FatFs/ccsbcs.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/option/ccsbcs.c - - Middlewares/FatFs/usbh_diskio.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/drivers/usbh_diskio.c - - Middlewares/FatFs/diskio.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/diskio.c - - Application/User/stm32f2xx_it.c - 1 - PARENT-2-PROJECT_LOC/Src/stm32f2xx_it.c - - Application/User/main.c - 1 - PARENT-2-PROJECT_LOC/Src/main.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_tim_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim_ex.c - - Middlewares/USB_Host_Library/usbh_msc_bot.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c - - Application/User/sdio.c - 1 - PARENT-2-PROJECT_LOC/Src/sdio.c - - Application/User/bsp_driver_sd.c - 1 - PARENT-2-PROJECT_LOC/Src/bsp_driver_sd.c - - Application/User/gpio.c - 1 - PARENT-2-PROJECT_LOC/Src/gpio.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_cortex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_cortex.c - - Application/User/fatfs.c - 1 - PARENT-2-PROJECT_LOC/Src/fatfs.c - - Application/User/tim.c - 1 - PARENT-2-PROJECT_LOC/Src/tim.c - - Application/User/usb_device.c - 1 - PARENT-2-PROJECT_LOC/Src/usb_device.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_flash_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash_ex.c - - Drivers/CMSIS - 2 - virtual:/virtual - - Drivers - 2 - virtual:/virtual - - Middlewares - 2 - virtual:/virtual - - Middlewares/FatFs - 2 - virtual:/virtual - - Middlewares/USB_Device_Library - 2 - virtual:/virtual - - Middlewares/USB_Host_Library - 2 - virtual:/virtual - - Application - 2 - virtual:/virtual - - Application/User - 2 - virtual:/virtual - - Drivers/STM32F2xx_HAL_Driver - 2 - virtual:/virtual - - Application/TrueSTUDIO - 2 - virtual:/virtual - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_sram.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sram.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_ll_sdmmc.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_sdmmc.c - - Application/User/stm32f2xx_hal_msp.c - 1 - PARENT-2-PROJECT_LOC/Src/stm32f2xx_hal_msp.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_rcc_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_rcc_ex.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pwr_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pwr_ex.c - - Middlewares/FatFs/ff.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/ff.c - - Application/User/usb_host.c - 1 - PARENT-2-PROJECT_LOC/Src/usb_host.c - - Middlewares/USB_Host_Library/usbh_core.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c - - Application/User/dma.c - 1 - PARENT-2-PROJECT_LOC/Src/dma.c - - Middlewares/USB_Host_Library/usbh_pipes.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c - - Middlewares/FatFs/syscall.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/option/syscall.c - - Middlewares/USB_Device_Library/usbd_ctlreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c - - Drivers/CMSIS/system_stm32f2xx.c - 1 - PARENT-2-PROJECT_LOC/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c - - Middlewares/USB_Host_Library/usbh_ioreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_ll_usb.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_usb.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_dma_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_dma_ex.c - - Middlewares/FatFs/ff_gen_drv.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/ff_gen_drv.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_gpio.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c - - Middlewares/USB_Host_Library/usbh_ctlreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c - - Middlewares/FatFs/sd_diskio.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_ll_fsmc.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_fsmc.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_rcc.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_rcc.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_spi.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_spi.c - - Application/User/fsmc.c - 1 - PARENT-2-PROJECT_LOC/Src/fsmc.c - - Middlewares/USB_Host_Library/usbh_msc.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pcd.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pwr.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pwr.c - - Application/User/usbd_conf.c - 1 - PARENT-2-PROJECT_LOC/Src/usbd_conf.c - - Application/User/usart.c - 1 - PARENT-2-PROJECT_LOC/Src/usart.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_pcd_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_pcd_ex.c - - Application/User/spi.c - 1 - PARENT-2-PROJECT_LOC/Src/spi.c - - Application/TrueSTUDIO/startup_stm32f205xx.s - 1 - PARENT-2-PROJECT_LOC/Drivers/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_uart.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c - - Middlewares/USB_Device_Library/usbd_hid.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_tim.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_sd.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_sd.c - - Middlewares/USB_Host_Library/usbh_msc_scsi.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_scsi.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_hcd.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_hcd.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_dma.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_dma.c - - Application/User/usbd_desc.c - 1 - PARENT-2-PROJECT_LOC/Src/usbd_desc.c - - Middlewares/USB_Device_Library/usbd_ioreq.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_flash.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash.c - - Application/User/usbh_conf.c - 1 - PARENT-2-PROJECT_LOC/Src/usbh_conf.c - - Middlewares/USB_Device_Library/usbd_core.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c - - Middlewares/FatFs/ccsbcs.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/option/ccsbcs.c - - Middlewares/FatFs/usbh_diskio.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/drivers/usbh_diskio.c - - Middlewares/FatFs/diskio.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/Third_Party/FatFs/src/diskio.c - - Application/User/stm32f2xx_it.c - 1 - PARENT-2-PROJECT_LOC/Src/stm32f2xx_it.c - - Application/User/main.c - 1 - PARENT-2-PROJECT_LOC/Src/main.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_tim_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_tim_ex.c - - Middlewares/USB_Host_Library/usbh_msc_bot.c - 1 - PARENT-2-PROJECT_LOC/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c - - Application/User/sdio.c - 1 - PARENT-2-PROJECT_LOC/Src/sdio.c - - Application/User/bsp_driver_sd.c - 1 - PARENT-2-PROJECT_LOC/Src/bsp_driver_sd.c - - Application/User/gpio.c - 1 - PARENT-2-PROJECT_LOC/Src/gpio.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_cortex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_cortex.c - - Application/User/fatfs.c - 1 - PARENT-2-PROJECT_LOC/Src/fatfs.c - - Application/User/tim.c - 1 - PARENT-2-PROJECT_LOC/Src/tim.c - - Application/User/usb_device.c - 1 - PARENT-2-PROJECT_LOC/Src/usb_device.c - - Drivers/STM32F2xx_HAL_Driver/stm32f2xx_hal_flash_ex.c - 1 - PARENT-2-PROJECT_LOC/Drivers/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash_ex.c - - diff --git a/STM32CubeMX/revF/TrueSTUDIO/revF/revF.elf.launch b/STM32CubeMX/revF/TrueSTUDIO/revF/revF.elf.launch index ebfb968e..b4e9c948 100644 --- a/STM32CubeMX/revF/TrueSTUDIO/revF/revF.elf.launch +++ b/STM32CubeMX/revF/TrueSTUDIO/revF/revF.elf.launch @@ -15,9 +15,9 @@ - + - + diff --git a/STM32CubeMX/revF/revF.ioc b/STM32CubeMX/revF/revF.ioc index ac0e4200..cc617ae2 100644 --- a/STM32CubeMX/revF/revF.ioc +++ b/STM32CubeMX/revF/revF.ioc @@ -207,7 +207,7 @@ PA8.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH PA8.Mode=Clock-out-1 PA8.Signal=RCC_MCO_1 PB0.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP -PB0.GPIO_Label=LED +PB0.GPIO_Label=LED_IO PB0.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP PB0.GPIO_PuPd=GPIO_PULLDOWN PB0.Locked=true @@ -304,13 +304,13 @@ PC3.GPIO_PuPd=GPIO_PULLDOWN PC3.Locked=true PC3.Signal=GPIO_Input PC4.GPIOParameters=GPIO_PuPd,GPIO_Label -PC4.GPIO_Label=UNUSED_PC4 -PC4.GPIO_PuPd=GPIO_PULLDOWN +PC4.GPIO_Label=VER_ID1 +PC4.GPIO_PuPd=GPIO_PULLUP PC4.Locked=true PC4.Signal=GPIO_Input PC5.GPIOParameters=GPIO_PuPd,GPIO_Label -PC5.GPIO_Label=UNUSED_PC5 -PC5.GPIO_PuPd=GPIO_PULLDOWN +PC5.GPIO_Label=VER_ID2 +PC5.GPIO_PuPd=GPIO_PULLUP PC5.Locked=true PC5.Signal=GPIO_Input PC6.GPIOParameters=GPIO_PuPd,GPIO_Label diff --git a/src/firmware/hwversion.c b/src/firmware/hwversion.c index d88a0c9b..eba4be6b 100755 --- a/src/firmware/hwversion.c +++ b/src/firmware/hwversion.c @@ -47,7 +47,17 @@ const uint8_t *otp = (uint8_t*)(FLASH_OTP_BASE + OTP_BLOCK_NUM * OTP_BLOCK_SIZE) const uint32_t *otp32 = (uint32_t*)(FLASH_OTP_BASE + OTP_BLOCK_NUM * OTP_BLOCK_SIZE); const uint8_t *lock = (uint8_t*)(FLASH_OTP_BASE + OTP_SIZE + OTP_BLOCK_NUM); +#ifdef STM32F2xx +#ifdef REV_2019 +const uint32_t marker = 0x06002019; // REV F and older +#endif +#ifdef REV_2020 const uint32_t marker = 0x06002020; +#endif +#endif +#ifdef STM32F4xx +const uint32_t marker = 0x06002021; +#endif static void checkHwSensePins() @@ -55,18 +65,28 @@ checkHwSensePins() // Check the board version is correct. // Sense pins are configued as pullup, and connected to GND for 2020 hw, // or N/C for v6 ref F or older +#ifdef REV_2019 + if ((HAL_GPIO_ReadPin(VER_ID1_GPIO_Port, VER_ID1_Pin) == 0) || + (HAL_GPIO_ReadPin(VER_ID2_GPIO_Port, VER_ID2_Pin) == 0)) + { + // Oh dear, wrong version. Do not pass go. + while (1) {} + } + +#endif +#ifdef REV_2020 if (HAL_GPIO_ReadPin(VER_ID1_GPIO_Port, VER_ID1_Pin) || HAL_GPIO_ReadPin(VER_ID2_GPIO_Port, VER_ID2_Pin)) { // Oh dear, wrong version. Do not pass go. while (1) {} } +#endif } void s2s_checkHwVersion() { -return; // TODO FIX FOR 2021 checkHwSensePins(); // Write a marker to flash that can be read by dfu-util now that we know diff --git a/src/firmware/main.c b/src/firmware/main.c index 087e9531..cb118edb 100755 --- a/src/firmware/main.c +++ b/src/firmware/main.c @@ -46,8 +46,10 @@ static int isUsbStarted; // Note that the chip clocking isn't fully configured at this stage. void mainEarlyInit() { +#ifdef nULPI_RESET_GPIO_Port // Disable the ULPI chip HAL_GPIO_WritePin(nULPI_RESET_GPIO_Port, nULPI_RESET_Pin, GPIO_PIN_RESET); +#endif // Sets up function pointers only s2s_initUsbDeviceStorage(); -- 2.38.5