aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/KINETIS/RT-FREEDOM-K20D50M-EXT/chconf.h1
-rw-r--r--demos/KINETIS/RT-FREEDOM-K20D50M/chconf.h1
-rw-r--r--demos/KINETIS/RT-FREEDOM-KL25Z-EXT/chconf.h1
-rw-r--r--demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/chconf.h1
-rw-r--r--demos/KINETIS/RT-FREEDOM-KL25Z/chconf.h1
-rw-r--r--demos/KINETIS/RT-MCHCK-K20-GPT/chconf.h1
-rw-r--r--demos/KINETIS/RT-MCHCK-K20-SPI/chconf.h1
-rw-r--r--demos/KINETIS/RT-TEENSY3/chconf.h1
-rw-r--r--demos/MSP430X/NIL-EXP430FR5969/chconf.h1
-rw-r--r--demos/MSP430X/NIL-EXP430FR6989/chconf.h1
-rw-r--r--demos/NRF51/MICROBIT/chconf.h1
-rw-r--r--demos/NRF51/OSHCHIP_V1.0/chconf.h1
-rw-r--r--demos/NRF51/RT-WVSHARE_BLE400/chconf.h1
-rw-r--r--demos/NRF52/Classic/chconf.h1
-rw-r--r--demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h1
-rw-r--r--demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h1
-rw-r--r--demos/TIVA/RT-TM4C123G-LAUNCHPAD/chconf.h1
-rw-r--r--demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/chconf.h1
-rw-r--r--demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h1
-rw-r--r--demos/various/RT-Win32-TriBuf/chconf.h3
-rw-r--r--os/hal/include/hal_usb_msd.h3
-rw-r--r--os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.c6
-rw-r--r--os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.h36
-rw-r--r--os/hal/src/hal_usb_msd.c22
-rw-r--r--os/various/lib_scsi.c78
-rw-r--r--os/various/lib_scsi.h15
-rw-r--r--testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL25Z/GPT/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL25Z/PWM/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL25Z/USB_HID/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL26Z/I2C/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL26Z/PWM/chconf.h1
-rw-r--r--testhal/KINETIS/FRDM-KL26Z/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/KL27Z/BLINK/chconf.h1
-rw-r--r--testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h1
-rw-r--r--testhal/KINETIS/MCHCK/PWM/chconf.h1
-rw-r--r--testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/ADC/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/EXT/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/GPT/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/PWM/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY_LC/BOOTLOADER/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY_LC/EEPROM_EMU/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY_LC/PWM/chconf.h1
-rw-r--r--testhal/MSP430X/EXP430FR5969/ADC/chconf.h1
-rw-r--r--testhal/MSP430X/EXP430FR5969/DMA/chconf.h1
-rw-r--r--testhal/MSP430X/EXP430FR5969/SPI/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/ADC/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/EXT/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/GPT/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/I2C/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/PWM/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/RNG/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/SPI/chconf.h1
-rw-r--r--testhal/NRF51/NRF51822/WDG/chconf.h1
-rw-r--r--testhal/STM32/STM32F0xx/crc/chconf.h1
-rw-r--r--testhal/STM32/STM32F0xx/onewire/chconf.h1
-rw-r--r--testhal/STM32/STM32F0xx/qei/chconf.h1
-rw-r--r--testhal/STM32/STM32F1xx/onewire/chconf.h1
-rw-r--r--testhal/STM32/STM32F1xx/qei/chconf.h1
-rw-r--r--testhal/STM32/STM32F3xx/COMP/chconf.h1
-rw-r--r--testhal/STM32/STM32F3xx/EEProm/chconf.h1
-rw-r--r--testhal/STM32/STM32F3xx/TIMCAP/chconf.h1
-rw-r--r--testhal/STM32/STM32F4xx/EICU/chconf.h1
-rw-r--r--testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h1
-rw-r--r--testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h1
-rw-r--r--testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h1
-rw-r--r--testhal/STM32/STM32F4xx/USB_HOST/chconf.h1
-rw-r--r--testhal/STM32/STM32F4xx/onewire/chconf.h1
-rw-r--r--testhal/STM32/STM32F7xx/USB_MSD/chconf.h1
-rw-r--r--testhal/STM32/STM32F7xx/USB_MSD/main.c2
-rw-r--r--testhal/TIVA/TM4C123x/ADC/chconf.h1
-rw-r--r--testhal/TIVA/TM4C123x/EXT/chconf.h1
-rw-r--r--testhal/TIVA/TM4C123x/GPT/chconf.h1
-rw-r--r--testhal/TIVA/TM4C123x/I2C/chconf.h1
-rw-r--r--testhal/TIVA/TM4C123x/PWM/chconf.h1
-rw-r--r--testhal/TIVA/TM4C123x/SPI/chconf.h1
-rw-r--r--testhal/TIVA/TM4C123x/WDG/chconf.h1
-rw-r--r--tools/mx2board.py2
85 files changed, 212 insertions, 31 deletions
diff --git a/demos/KINETIS/RT-FREEDOM-K20D50M-EXT/chconf.h b/demos/KINETIS/RT-FREEDOM-K20D50M-EXT/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-FREEDOM-K20D50M-EXT/chconf.h
+++ b/demos/KINETIS/RT-FREEDOM-K20D50M-EXT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-FREEDOM-K20D50M/chconf.h b/demos/KINETIS/RT-FREEDOM-K20D50M/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-FREEDOM-K20D50M/chconf.h
+++ b/demos/KINETIS/RT-FREEDOM-K20D50M/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-FREEDOM-KL25Z-EXT/chconf.h b/demos/KINETIS/RT-FREEDOM-KL25Z-EXT/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-FREEDOM-KL25Z-EXT/chconf.h
+++ b/demos/KINETIS/RT-FREEDOM-KL25Z-EXT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/chconf.h b/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/chconf.h
index c78e879..054d6b3 100644
--- a/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/chconf.h
+++ b/demos/KINETIS/RT-FREEDOM-KL25Z-SHELL/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-FREEDOM-KL25Z/chconf.h b/demos/KINETIS/RT-FREEDOM-KL25Z/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-FREEDOM-KL25Z/chconf.h
+++ b/demos/KINETIS/RT-FREEDOM-KL25Z/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-MCHCK-K20-GPT/chconf.h b/demos/KINETIS/RT-MCHCK-K20-GPT/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-MCHCK-K20-GPT/chconf.h
+++ b/demos/KINETIS/RT-MCHCK-K20-GPT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-MCHCK-K20-SPI/chconf.h b/demos/KINETIS/RT-MCHCK-K20-SPI/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-MCHCK-K20-SPI/chconf.h
+++ b/demos/KINETIS/RT-MCHCK-K20-SPI/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/KINETIS/RT-TEENSY3/chconf.h b/demos/KINETIS/RT-TEENSY3/chconf.h
index 1eaf053..c95387a 100644
--- a/demos/KINETIS/RT-TEENSY3/chconf.h
+++ b/demos/KINETIS/RT-TEENSY3/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/MSP430X/NIL-EXP430FR5969/chconf.h b/demos/MSP430X/NIL-EXP430FR5969/chconf.h
index bf2ad1b..1a017a0 100644
--- a/demos/MSP430X/NIL-EXP430FR5969/chconf.h
+++ b/demos/MSP430X/NIL-EXP430FR5969/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_NIL_CONF_
+#define _CHIBIOS_NIL_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/MSP430X/NIL-EXP430FR6989/chconf.h b/demos/MSP430X/NIL-EXP430FR6989/chconf.h
index bf2ad1b..1a017a0 100644
--- a/demos/MSP430X/NIL-EXP430FR6989/chconf.h
+++ b/demos/MSP430X/NIL-EXP430FR6989/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_NIL_CONF_
+#define _CHIBIOS_NIL_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/NRF51/MICROBIT/chconf.h b/demos/NRF51/MICROBIT/chconf.h
index a753ec9..14c1bf3 100644
--- a/demos/NRF51/MICROBIT/chconf.h
+++ b/demos/NRF51/MICROBIT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/NRF51/OSHCHIP_V1.0/chconf.h b/demos/NRF51/OSHCHIP_V1.0/chconf.h
index a753ec9..14c1bf3 100644
--- a/demos/NRF51/OSHCHIP_V1.0/chconf.h
+++ b/demos/NRF51/OSHCHIP_V1.0/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/NRF51/RT-WVSHARE_BLE400/chconf.h b/demos/NRF51/RT-WVSHARE_BLE400/chconf.h
index a753ec9..14c1bf3 100644
--- a/demos/NRF51/RT-WVSHARE_BLE400/chconf.h
+++ b/demos/NRF51/RT-WVSHARE_BLE400/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/NRF52/Classic/chconf.h b/demos/NRF52/Classic/chconf.h
index 31b74a2..c7ec876 100644
--- a/demos/NRF52/Classic/chconf.h
+++ b/demos/NRF52/Classic/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h
index a0fc879..17f8197 100644
--- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h
+++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h
index 9a33ce5..81ccb47 100644
--- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h
+++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/TIVA/RT-TM4C123G-LAUNCHPAD/chconf.h b/demos/TIVA/RT-TM4C123G-LAUNCHPAD/chconf.h
index 25e39f6..0d24275 100644
--- a/demos/TIVA/RT-TM4C123G-LAUNCHPAD/chconf.h
+++ b/demos/TIVA/RT-TM4C123G-LAUNCHPAD/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/chconf.h b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/chconf.h
index dd5025e..35f9abd 100644
--- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/chconf.h
+++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h
index 15db44a..cc0b2bd 100644
--- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h
+++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/demos/various/RT-Win32-TriBuf/chconf.h b/demos/various/RT-Win32-TriBuf/chconf.h
index 835d59b..75839d3 100644
--- a/demos/various/RT-Win32-TriBuf/chconf.h
+++ b/demos/various/RT-Win32-TriBuf/chconf.h
@@ -28,6 +28,9 @@
#ifndef _CHCONF_H_
#define _CHCONF_H_
+#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
+
/*===========================================================================*/
/**
* @name System timers settings
diff --git a/os/hal/include/hal_usb_msd.h b/os/hal/include/hal_usb_msd.h
index fcc2cf2..0fe03e4 100644
--- a/os/hal/include/hal_usb_msd.h
+++ b/os/hal/include/hal_usb_msd.h
@@ -172,7 +172,8 @@ extern "C" {
void msdObjectInit(USBMassStorageDriver *msdp);
void msdStart(USBMassStorageDriver *msdp, USBDriver *usbp,
BaseBlockDevice *blkdev, uint8_t *blkbuf,
- const scsi_inquiry_response_t *scsi_inquiry_response);
+ const scsi_inquiry_response_t *scsi_inquiry_response,
+ const scsi_unit_serial_number_inquiry_response_t *serialInquiry);
void msdStop(USBMassStorageDriver *msdp);
bool msd_request_hook(USBDriver *usbp);
#ifdef __cplusplus
diff --git a/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.c b/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.c
index 98defed..126959f 100644
--- a/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.c
+++ b/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.c
@@ -359,6 +359,7 @@ void spi_lld_stop(SPIDriver *spip)
}
}
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_LLD) || defined(__DOXYGEN__)
/**
* @brief Asserts the slave select signal and prepares for transfers.
*
@@ -368,7 +369,7 @@ void spi_lld_stop(SPIDriver *spip)
*/
void spi_lld_select(SPIDriver *spip)
{
- palClearPad(spip->config->ssport, spip->config->sspad);
+ /* No implementation on Tiva.*/
}
/**
@@ -381,8 +382,9 @@ void spi_lld_select(SPIDriver *spip)
*/
void spi_lld_unselect(SPIDriver *spip)
{
- palSetPad(spip->config->ssport, spip->config->sspad);
+ /* No implementation on Tiva.*/
}
+#endif
/**
* @brief Ignores data on the SPI bus.
diff --git a/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.h b/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.h
index 64560eb..4dcf6db 100644
--- a/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.h
+++ b/os/hal/ports/TIVA/LLD/SSI/hal_spi_lld.h
@@ -165,6 +165,10 @@
#define TIVA_UDMA_REQUIRED
#endif
+#if SPI_SELECT_MODE == SPI_SELECT_MODE_LLD
+#error "SPI_SELECT_MODE_LLD not supported by this driver"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -189,16 +193,34 @@ typedef struct {
/**
* @brief Operation complete callback or @p NULL.
*/
- spicallback_t end_cb;
- /* End of the mandatory fields.*/
+ spicallback_t end_cb;
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_LINE) || defined(__DOXYGEN__)
+ /**
+ * @brief The chip select line.
+ */
+ ioline_t ssline;
+#endif
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_PORT) || defined(__DOXYGEN__)
+ /**
+ * @brief The chip select port.
+ */
+ ioportid_t ssport;
/**
- * @brief The chip select line port.
+ * @brief The chip select port mask.
*/
- ioportid_t ssport;
+ uint8fast_t ssmask;
+#endif
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_PAD) || defined(__DOXYGEN__)
/**
- * @brief The chip select line pad number.
+ * @brief The chip select port.
*/
- uint16_t sspad;
+ ioportid_t ssport;
+ /**
+ * @brief The chip select pad number.
+ */
+ uint_fast8_t sspad;
+#endif
+ /* End of the mandatory fields.*/
/**
* @brief SSI CR0 initialization data.
*/
@@ -289,8 +311,10 @@ extern "C" {
void spi_lld_init(void);
void spi_lld_start(SPIDriver *spip);
void spi_lld_stop(SPIDriver *spip);
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_LLD) || defined(__DOXYGEN__)
void spi_lld_select(SPIDriver *spip);
void spi_lld_unselect(SPIDriver *spip);
+#endif
void spi_lld_ignore(SPIDriver *spip, size_t n);
void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf);
diff --git a/os/hal/src/hal_usb_msd.c b/os/hal/src/hal_usb_msd.c
index 6cc5386..564bad0 100644
--- a/os/hal/src/hal_usb_msd.c
+++ b/os/hal/src/hal_usb_msd.c
@@ -84,6 +84,19 @@ static const scsi_inquiry_response_t default_scsi_inquiry_response = {
{'v',CH_KERNEL_MAJOR+'0','.',CH_KERNEL_MINOR+'0'}
};
+/**
+ * @brief Hardcoded default SCSI unit serial number inquiry response structure.
+ */
+static const scsi_unit_serial_number_inquiry_response_t default_scsi_unit_serial_number_inquiry_response =
+{
+ 0x00,
+ 0x80,
+ 0x00,
+ 0x08,
+ "00000000"
+};
+
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
@@ -373,7 +386,8 @@ void msdStop(USBMassStorageDriver *msdp) {
*/
void msdStart(USBMassStorageDriver *msdp, USBDriver *usbp,
BaseBlockDevice *blkdev, uint8_t *blkbuf,
- const scsi_inquiry_response_t *inquiry) {
+ const scsi_inquiry_response_t *inquiry,
+ const scsi_unit_serial_number_inquiry_response_t *serialInquiry) {
osalDbgCheck((msdp != NULL) && (usbp != NULL)
&& (blkdev != NULL) && (blkbuf != NULL));
@@ -393,6 +407,12 @@ void msdStart(USBMassStorageDriver *msdp, USBDriver *usbp,
else {
msdp->scsi_config.inquiry_response = inquiry;
}
+ if (NULL == serialInquiry) {
+ msdp->scsi_config.unit_serial_number_inquiry_response = &default_scsi_unit_serial_number_inquiry_response;
+ }
+ else {
+ msdp->scsi_config.unit_serial_number_inquiry_response = serialInquiry;
+ }
msdp->scsi_config.blkbuf = blkbuf;
msdp->scsi_config.blkdev = blkdev;
msdp->scsi_config.transport = &msdp->scsi_transport;
diff --git a/os/various/lib_scsi.c b/os/various/lib_scsi.c
index 55aeb7e..ea2adda 100644
--- a/os/various/lib_scsi.c
+++ b/os/various/lib_scsi.c
@@ -159,7 +159,6 @@ static bool cmd_ignored(SCSITarget *scsip, const uint8_t *cmd) {
(void)scsip;
(void)cmd;
- set_sense_ok(scsip);
return SCSI_SUCCESS;
}
@@ -175,7 +174,12 @@ static bool cmd_ignored(SCSITarget *scsip, const uint8_t *cmd) {
*/
static bool inquiry(SCSITarget *scsip, const uint8_t *cmd) {
- if ((cmd[1] & 0b11) || cmd[2] != 0) {
+ if ((cmd[1] & 0b1) && cmd[2] == 0x80) {
+ /* Unit serial number page */
+ return transmit_data(scsip, (const uint8_t *)scsip->config->unit_serial_number_inquiry_response,
+ sizeof(scsi_unit_serial_number_inquiry_response_t));
+ }
+ else if ((cmd[1] & 0b11) || cmd[2] != 0) {
set_sense(scsip, SCSI_SENSE_KEY_ILLEGAL_REQUEST,
SCSI_ASENSE_INVALID_FIELD_IN_CDB,
SCSI_ASENSEQ_NO_QUALIFIER);
@@ -199,10 +203,7 @@ static bool inquiry(SCSITarget *scsip, const uint8_t *cmd) {
*/
static bool request_sense(SCSITarget *scsip, const uint8_t *cmd) {
- uint32_t tmp;
- memcpy(&tmp, &cmd[1], 3);
-
- if ((tmp != 0) || (cmd[4] != sizeof(scsi_sense_response_t))) {
+ if (((cmd[1] & 0x01) != 0) || (cmd[4] != sizeof(scsi_sense_response_t))) {
set_sense(scsip, SCSI_SENSE_KEY_ILLEGAL_REQUEST,
SCSI_ASENSE_INVALID_FIELD_IN_CDB,
SCSI_ASENSEQ_NO_QUALIFIER);
@@ -378,6 +379,30 @@ static bool data_read_write10(SCSITarget *scsip, const uint8_t *cmd) {
}
return SCSI_SUCCESS;
}
+
+/**
+ * @brief SCSI test unit ready command handler
+ * @details If block device is inserted, sets sense data in 'all OK' condition
+ * and returns success status.
+ * If block device is not inserted, sets sense data to 'Medium not present' considion,
+ * and returns check condition status.
+ */
+static bool test_unit_ready(SCSITarget *scsip, const uint8_t *cmd) {
+ (void)cmd;
+
+ if (blkIsInserted(scsip->config->blkdev)) {
+ return SCSI_SUCCESS;
+ }
+ else {
+ warnprintf("SCSI Medium is not inserted.\r\n");
+ set_sense(scsip, SCSI_SENSE_KEY_NOT_READY,
+ SCSI_ASENSE_MEDIUM_NOT_PRESENT,
+ SCSI_ASENSEQ_NO_QUALIFIER);
+ return SCSI_FAILED;
+ }
+
+}
+
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
@@ -398,54 +423,69 @@ static bool data_read_write10(SCSITarget *scsip, const uint8_t *cmd) {
*/
bool scsiExecCmd(SCSITarget *scsip, const uint8_t *cmd) {
- /* status will be overwritten later in case of error */
- set_sense_ok(scsip);
+ bool ret = SCSI_SUCCESS;
switch (cmd[0]) {
case SCSI_CMD_INQUIRY:
dbgprintf("SCSI_CMD_INQUIRY\r\n");
- return inquiry(scsip, cmd);
+ ret = inquiry(scsip, cmd);
+ break;
case SCSI_CMD_REQUEST_SENSE:
dbgprintf("SCSI_CMD_REQUEST_SENSE\r\n");
- return request_sense(scsip, cmd);
+ ret = request_sense(scsip, cmd);
+ break;
case SCSI_CMD_READ_CAPACITY_10:
dbgprintf("SCSI_CMD_READ_CAPACITY_10\r\n");
- return read_capacity10(scsip, cmd);
+ ret = read_capacity10(scsip, cmd);
+ break;
case SCSI_CMD_READ_10:
dbgprintf("SCSI_CMD_READ_10\r\n");
- return data_read_write10(scsip, cmd);
+ ret = data_read_write10(scsip, cmd);
+ break;
case SCSI_CMD_WRITE_10:
dbgprintf("SCSI_CMD_WRITE_10\r\n");
- return data_read_write10(scsip, cmd);
+ ret = data_read_write10(scsip, cmd);
+ break;
case SCSI_CMD_TEST_UNIT_READY:
dbgprintf("SCSI_CMD_TEST_UNIT_READY\r\n");
- return cmd_ignored(scsip, cmd);
+ ret = test_unit_ready(scsip, cmd);
+ break;
case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
dbgprintf("SCSI_CMD_ALLOW_MEDIUM_REMOVAL\r\n");
- return cmd_ignored(scsip, cmd);
+ ret = cmd_ignored(scsip, cmd);
+ break;
case SCSI_CMD_MODE_SENSE_6:
dbgprintf("SCSI_CMD_MODE_SENSE_6\r\n");
- return mode_sense6(scsip, cmd);
+ ret = mode_sense6(scsip, cmd);
+ break;
case SCSI_CMD_READ_FORMAT_CAPACITIES:
dbgprintf("SCSI_CMD_READ_FORMAT_CAPACITIES\r\n");
- return read_format_capacities(scsip, cmd);
+ ret = read_format_capacities(scsip, cmd);
+ break;
case SCSI_CMD_VERIFY_10:
dbgprintf("SCSI_CMD_VERIFY_10\r\n");
- return cmd_ignored(scsip, cmd);
+ ret = cmd_ignored(scsip, cmd);
+ break;
default:
warnprintf("SCSI unhandled command: %X\r\n", cmd[0]);
- return cmd_unhandled(scsip, cmd);
+ ret = cmd_unhandled(scsip, cmd);
+ break;
}
+
+ if (ret == SCSI_SUCCESS)
+ set_sense_ok(scsip);
+
+ return ret;
}
/**
diff --git a/os/various/lib_scsi.h b/os/various/lib_scsi.h
index 97badb0..8384ae3 100644
--- a/os/various/lib_scsi.h
+++ b/os/various/lib_scsi.h
@@ -133,6 +133,17 @@ typedef struct PACKED_VAR {
} scsi_inquiry_response_t;
/**
+ * @brief Represents SCSI unit serial number inquiry response structure.
+ * @details See SCSI specification.
+ */
+typedef struct PACKED_VAR {
+ uint8_t peripheral;
+ uint8_t page_code;
+ uint8_t reserved;
+ uint8_t page_length;
+ uint8_t serianNumber[8];
+} scsi_unit_serial_number_inquiry_response_t;
+/**
* @brief Represents SCSI mode sense (6) request structure.
* @details See SCSI specification.
*/
@@ -225,6 +236,10 @@ typedef struct {
* @brief Pointer to SCSI inquiry response object.
*/
const scsi_inquiry_response_t *inquiry_response;
+ /**
+ * @brief Pointer to SCSI unit serial number inquiry response object.
+ */
+ const scsi_unit_serial_number_inquiry_response_t *unit_serial_number_inquiry_response;
} SCSITargetConfig;
/**
diff --git a/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h b/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h
index eecc0a6..5f05547 100644
--- a/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h
+++ b/testhal/KINETIS/FRDM-K20D50M/I2C/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h b/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h
index bd97716..222c5ea 100644
--- a/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/FRDM-K20D50M/USB_SERIAL/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h b/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h
index eecc0a6..5f05547 100644
--- a/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h
+++ b/testhal/KINETIS/FRDM-KL25Z/ADC/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL25Z/GPT/chconf.h b/testhal/KINETIS/FRDM-KL25Z/GPT/chconf.h
index b7ffc80..5d231c8 100644
--- a/testhal/KINETIS/FRDM-KL25Z/GPT/chconf.h
+++ b/testhal/KINETIS/FRDM-KL25Z/GPT/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL25Z/PWM/chconf.h b/testhal/KINETIS/FRDM-KL25Z/PWM/chconf.h
index 25dd7b8..2a25a25 100644
--- a/testhal/KINETIS/FRDM-KL25Z/PWM/chconf.h
+++ b/testhal/KINETIS/FRDM-KL25Z/PWM/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL25Z/USB_HID/chconf.h b/testhal/KINETIS/FRDM-KL25Z/USB_HID/chconf.h
index 6774a44..424cf02 100644
--- a/testhal/KINETIS/FRDM-KL25Z/USB_HID/chconf.h
+++ b/testhal/KINETIS/FRDM-KL25Z/USB_HID/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/chconf.h b/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/chconf.h
index 7b54de5..e89ec1f 100644
--- a/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/FRDM-KL25Z/USB_SERIAL/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL26Z/I2C/chconf.h b/testhal/KINETIS/FRDM-KL26Z/I2C/chconf.h
index eecc0a6..5f05547 100644
--- a/testhal/KINETIS/FRDM-KL26Z/I2C/chconf.h
+++ b/testhal/KINETIS/FRDM-KL26Z/I2C/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL26Z/PWM/chconf.h b/testhal/KINETIS/FRDM-KL26Z/PWM/chconf.h
index 8c37f87..9f9b3e9 100644
--- a/testhal/KINETIS/FRDM-KL26Z/PWM/chconf.h
+++ b/testhal/KINETIS/FRDM-KL26Z/PWM/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/FRDM-KL26Z/USB_SERIAL/chconf.h b/testhal/KINETIS/FRDM-KL26Z/USB_SERIAL/chconf.h
index c7ed185..9c9a479 100644
--- a/testhal/KINETIS/FRDM-KL26Z/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/FRDM-KL26Z/USB_SERIAL/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/KL27Z/BLINK/chconf.h b/testhal/KINETIS/KL27Z/BLINK/chconf.h
index 41259a0..49d21ae 100644
--- a/testhal/KINETIS/KL27Z/BLINK/chconf.h
+++ b/testhal/KINETIS/KL27Z/BLINK/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h b/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h
index b2448a9..a185459 100644
--- a/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h
+++ b/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/MCHCK/PWM/chconf.h b/testhal/KINETIS/MCHCK/PWM/chconf.h
index 034c6cc..2f2938a 100644
--- a/testhal/KINETIS/MCHCK/PWM/chconf.h
+++ b/testhal/KINETIS/MCHCK/PWM/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h b/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h
index 7371b49..22272b1 100644
--- a/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/ADC/chconf.h b/testhal/KINETIS/TEENSY3_x/ADC/chconf.h
index caae0c2..029e4ec 100644
--- a/testhal/KINETIS/TEENSY3_x/ADC/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/ADC/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h b/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h
index ea87df8..3bb57de 100644
--- a/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/EXT/chconf.h b/testhal/KINETIS/TEENSY3_x/EXT/chconf.h
index 0389bed..0be6605 100644
--- a/testhal/KINETIS/TEENSY3_x/EXT/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/EXT/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/GPT/chconf.h b/testhal/KINETIS/TEENSY3_x/GPT/chconf.h
index b2ed194..93ba7b8 100644
--- a/testhal/KINETIS/TEENSY3_x/GPT/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/GPT/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/PWM/chconf.h b/testhal/KINETIS/TEENSY3_x/PWM/chconf.h
index dda26e1..a661f7e 100644
--- a/testhal/KINETIS/TEENSY3_x/PWM/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/PWM/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h b/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h
index 95b505a..27ed81c 100644
--- a/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h b/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h
index 7d9ace3..6dbecb5 100644
--- a/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY_LC/BOOTLOADER/chconf.h b/testhal/KINETIS/TEENSY_LC/BOOTLOADER/chconf.h
index d6a7bf8..f0c238c 100644
--- a/testhal/KINETIS/TEENSY_LC/BOOTLOADER/chconf.h
+++ b/testhal/KINETIS/TEENSY_LC/BOOTLOADER/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY_LC/EEPROM_EMU/chconf.h b/testhal/KINETIS/TEENSY_LC/EEPROM_EMU/chconf.h
index 919e2b0..97c98b7 100644
--- a/testhal/KINETIS/TEENSY_LC/EEPROM_EMU/chconf.h
+++ b/testhal/KINETIS/TEENSY_LC/EEPROM_EMU/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY_LC/PWM/chconf.h b/testhal/KINETIS/TEENSY_LC/PWM/chconf.h
index b18de54..d910706 100644
--- a/testhal/KINETIS/TEENSY_LC/PWM/chconf.h
+++ b/testhal/KINETIS/TEENSY_LC/PWM/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/MSP430X/EXP430FR5969/ADC/chconf.h b/testhal/MSP430X/EXP430FR5969/ADC/chconf.h
index 3b7a8e1..0678ca4 100644
--- a/testhal/MSP430X/EXP430FR5969/ADC/chconf.h
+++ b/testhal/MSP430X/EXP430FR5969/ADC/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_NIL_CONF_
+#define _CHIBIOS_NIL_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/MSP430X/EXP430FR5969/DMA/chconf.h b/testhal/MSP430X/EXP430FR5969/DMA/chconf.h
index cb45526..0a5657c 100644
--- a/testhal/MSP430X/EXP430FR5969/DMA/chconf.h
+++ b/testhal/MSP430X/EXP430FR5969/DMA/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_NIL_CONF_
+#define _CHIBIOS_NIL_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/MSP430X/EXP430FR5969/SPI/chconf.h b/testhal/MSP430X/EXP430FR5969/SPI/chconf.h
index cb45526..0a5657c 100644
--- a/testhal/MSP430X/EXP430FR5969/SPI/chconf.h
+++ b/testhal/MSP430X/EXP430FR5969/SPI/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_NIL_CONF_
+#define _CHIBIOS_NIL_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/ADC/chconf.h b/testhal/NRF51/NRF51822/ADC/chconf.h
index 71b3bb4..790132e 100644
--- a/testhal/NRF51/NRF51822/ADC/chconf.h
+++ b/testhal/NRF51/NRF51822/ADC/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/EXT/chconf.h b/testhal/NRF51/NRF51822/EXT/chconf.h
index 50218e4..eeb3fa3 100644
--- a/testhal/NRF51/NRF51822/EXT/chconf.h
+++ b/testhal/NRF51/NRF51822/EXT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/GPT/chconf.h b/testhal/NRF51/NRF51822/GPT/chconf.h
index 71b3bb4..790132e 100644
--- a/testhal/NRF51/NRF51822/GPT/chconf.h
+++ b/testhal/NRF51/NRF51822/GPT/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/I2C/chconf.h b/testhal/NRF51/NRF51822/I2C/chconf.h
index 3d441c6..3f6766a 100644
--- a/testhal/NRF51/NRF51822/I2C/chconf.h
+++ b/testhal/NRF51/NRF51822/I2C/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/PWM/chconf.h b/testhal/NRF51/NRF51822/PWM/chconf.h
index a753ec9..14c1bf3 100644
--- a/testhal/NRF51/NRF51822/PWM/chconf.h
+++ b/testhal/NRF51/NRF51822/PWM/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/RNG/chconf.h b/testhal/NRF51/NRF51822/RNG/chconf.h
index c0af32b..ed43625 100644
--- a/testhal/NRF51/NRF51822/RNG/chconf.h
+++ b/testhal/NRF51/NRF51822/RNG/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/SPI/chconf.h b/testhal/NRF51/NRF51822/SPI/chconf.h
index f777f9d..49a050a 100644
--- a/testhal/NRF51/NRF51822/SPI/chconf.h
+++ b/testhal/NRF51/NRF51822/SPI/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/NRF51/NRF51822/WDG/chconf.h b/testhal/NRF51/NRF51822/WDG/chconf.h
index 4477bd5..9952575 100644
--- a/testhal/NRF51/NRF51822/WDG/chconf.h
+++ b/testhal/NRF51/NRF51822/WDG/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F0xx/crc/chconf.h b/testhal/STM32/STM32F0xx/crc/chconf.h
index c2d6f04..6a187da 100644
--- a/testhal/STM32/STM32F0xx/crc/chconf.h
+++ b/testhal/STM32/STM32F0xx/crc/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F0xx/onewire/chconf.h b/testhal/STM32/STM32F0xx/onewire/chconf.h
index 724dc02..4b2d922 100644
--- a/testhal/STM32/STM32F0xx/onewire/chconf.h
+++ b/testhal/STM32/STM32F0xx/onewire/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F0xx/qei/chconf.h b/testhal/STM32/STM32F0xx/qei/chconf.h
index 71cbe47..b3260d4 100644
--- a/testhal/STM32/STM32F0xx/qei/chconf.h
+++ b/testhal/STM32/STM32F0xx/qei/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F1xx/onewire/chconf.h b/testhal/STM32/STM32F1xx/onewire/chconf.h
index ee20e3c..b38dfa3 100644
--- a/testhal/STM32/STM32F1xx/onewire/chconf.h
+++ b/testhal/STM32/STM32F1xx/onewire/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F1xx/qei/chconf.h b/testhal/STM32/STM32F1xx/qei/chconf.h
index 71cbe47..b3260d4 100644
--- a/testhal/STM32/STM32F1xx/qei/chconf.h
+++ b/testhal/STM32/STM32F1xx/qei/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F3xx/COMP/chconf.h b/testhal/STM32/STM32F3xx/COMP/chconf.h
index 00eb395..894f737 100644
--- a/testhal/STM32/STM32F3xx/COMP/chconf.h
+++ b/testhal/STM32/STM32F3xx/COMP/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F3xx/EEProm/chconf.h b/testhal/STM32/STM32F3xx/EEProm/chconf.h
index 00eb395..894f737 100644
--- a/testhal/STM32/STM32F3xx/EEProm/chconf.h
+++ b/testhal/STM32/STM32F3xx/EEProm/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F3xx/TIMCAP/chconf.h b/testhal/STM32/STM32F3xx/TIMCAP/chconf.h
index 00eb395..894f737 100644
--- a/testhal/STM32/STM32F3xx/TIMCAP/chconf.h
+++ b/testhal/STM32/STM32F3xx/TIMCAP/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F4xx/EICU/chconf.h b/testhal/STM32/STM32F4xx/EICU/chconf.h
index ad6b53a..736770d 100644
--- a/testhal/STM32/STM32F4xx/EICU/chconf.h
+++ b/testhal/STM32/STM32F4xx/EICU/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h b/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h
index 1065821..cf950cd 100644
--- a/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h
+++ b/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h
index 1065821..cf950cd 100644
--- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h
+++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h
index 1065821..cf950cd 100644
--- a/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h
+++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h
index 449cb3d..e112daf 100644
--- a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h
+++ b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F4xx/onewire/chconf.h b/testhal/STM32/STM32F4xx/onewire/chconf.h
index 1065821..cf950cd 100644
--- a/testhal/STM32/STM32F4xx/onewire/chconf.h
+++ b/testhal/STM32/STM32F4xx/onewire/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F7xx/USB_MSD/chconf.h b/testhal/STM32/STM32F7xx/USB_MSD/chconf.h
index 8bdd9f2..346c876 100644
--- a/testhal/STM32/STM32F7xx/USB_MSD/chconf.h
+++ b/testhal/STM32/STM32F7xx/USB_MSD/chconf.h
@@ -29,6 +29,7 @@
#define CHCONF_H
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/STM32/STM32F7xx/USB_MSD/main.c b/testhal/STM32/STM32F7xx/USB_MSD/main.c
index cae2b74..87ca8d2 100644
--- a/testhal/STM32/STM32F7xx/USB_MSD/main.c
+++ b/testhal/STM32/STM32F7xx/USB_MSD/main.c
@@ -102,7 +102,7 @@ int main(void) {
* start mass storage
*/
msdObjectInit(&USBMSD1);
- msdStart(&USBMSD1, &USBD1, (BaseBlockDevice *)&ramdisk, blkbuf, NULL);
+ msdStart(&USBMSD1, &USBD1, (BaseBlockDevice *)&ramdisk, blkbuf, NULL, NULL);
/*
*
diff --git a/testhal/TIVA/TM4C123x/ADC/chconf.h b/testhal/TIVA/TM4C123x/ADC/chconf.h
index 25e39f6..0d24275 100644
--- a/testhal/TIVA/TM4C123x/ADC/chconf.h
+++ b/testhal/TIVA/TM4C123x/ADC/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/TIVA/TM4C123x/EXT/chconf.h b/testhal/TIVA/TM4C123x/EXT/chconf.h
index dd6722a..c56df3c 100644
--- a/testhal/TIVA/TM4C123x/EXT/chconf.h
+++ b/testhal/TIVA/TM4C123x/EXT/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/TIVA/TM4C123x/GPT/chconf.h b/testhal/TIVA/TM4C123x/GPT/chconf.h
index 25e39f6..0d24275 100644
--- a/testhal/TIVA/TM4C123x/GPT/chconf.h
+++ b/testhal/TIVA/TM4C123x/GPT/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/TIVA/TM4C123x/I2C/chconf.h b/testhal/TIVA/TM4C123x/I2C/chconf.h
index 25e39f6..0d24275 100644
--- a/testhal/TIVA/TM4C123x/I2C/chconf.h
+++ b/testhal/TIVA/TM4C123x/I2C/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/TIVA/TM4C123x/PWM/chconf.h b/testhal/TIVA/TM4C123x/PWM/chconf.h
index 25e39f6..0d24275 100644
--- a/testhal/TIVA/TM4C123x/PWM/chconf.h
+++ b/testhal/TIVA/TM4C123x/PWM/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/TIVA/TM4C123x/SPI/chconf.h b/testhal/TIVA/TM4C123x/SPI/chconf.h
index 25e39f6..0d24275 100644
--- a/testhal/TIVA/TM4C123x/SPI/chconf.h
+++ b/testhal/TIVA/TM4C123x/SPI/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/TIVA/TM4C123x/WDG/chconf.h b/testhal/TIVA/TM4C123x/WDG/chconf.h
index 25e39f6..0d24275 100644
--- a/testhal/TIVA/TM4C123x/WDG/chconf.h
+++ b/testhal/TIVA/TM4C123x/WDG/chconf.h
@@ -18,6 +18,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/tools/mx2board.py b/tools/mx2board.py
index 85e643b..ea0b010 100644
--- a/tools/mx2board.py
+++ b/tools/mx2board.py
@@ -268,7 +268,7 @@ def gen_defines(project):
defines['PORT_'+label] = 'GPIO' + port_key
defines['PAD_'+label] = pad_key
- if re.search(r"TIM\d_CH\d", signal, re.M):
+ if re.search(r"TIM\d+_CH\d$", signal, re.M):
timer = signal.replace('S_TIM', '').replace('_CH', '')[:-1]
ch_num = int(signal[-1:])