Just now, I disabled USB, successfully compiled the old version, it runs successfully on F405, I2S data is fine,and i confirmed the compilation option, it's OTGv1
Code: Select all
Compiler Options
arm-none-eabi-gcc -c -mcpu=cortex-m4 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffast-math -fsingle-precision-constant -ffunction-sections -fdata-sections -fno-common -flto -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wall -Wextra -Wundef -Wstrict-prototypes -Wa,-alms=build/lst/ -DCORTEX_USE_FPU=TRUE -DARM_MATH_CM4 -DVERSION="" -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -IChibiOS/os/license -IChibiOS/os/common/startup/ARMCMx/compilers/GCC -IChibiOS/os/common/startup/ARMCMx/devices/STM32F4xx -IChibiOS/os/common/ext/CMSIS/include -IChibiOS/os/common/ext/CMSIS/ST/STM32F4xx -IChibiOS/os/rt/include -IChibiOS/os/common/oslib/include -IChibiOS/os/common/ports/ARMCMx -IChibiOS/os/common/ports/ARMCMx/compilers/GCC -IChibiOS/os/hal/osal/rt -IChibiOS/os/hal/include -IChibiOS/os/hal/ports/common/ARMCMx -IChibiOS/os/hal/ports/STM32/STM32F4xx -IChibiOS/os/hal/ports/STM32/LLD/ADCv2 -IChibiOS/os/hal/ports/STM32/LLD/CANv1 -IChibiOS/os/hal/ports/STM32/LLD/DACv1 -IChibiOS/os/hal/ports/STM32/LLD/DMAv2 -IChibiOS/os/hal/ports/STM32/LLD/EXTIv1 -IChibiOS/os/hal/ports/STM32/LLD/GPIOv2 -IChibiOS/os/hal/ports/STM32/LLD/I2Cv1 -IChibiOS/os/hal/ports/STM32/LLD/MACv1 -IChibiOS/os/hal/ports/STM32/LLD/OTGv1 -IChibiOS/os/hal/ports/STM32/LLD/RTCv2 -IChibiOS/os/hal/ports/STM32/LLD/SDIOv1 -IChibiOS/os/hal/ports/STM32/LLD/SPIv1 -IChibiOS/os/hal/ports/STM32/LLD/TIMv1 -IChibiOS/os/hal/ports/STM32/LLD/USARTv1 -IChibiOS/os/hal/ports/STM32/LLD/xWDGv1 -IChibiOS/os/hal/lib/streams main.c -o main.o
but I'm currently using the code of the old version of CHIBOS, I can't use OTGv1
One difference I see between the old and the new is USBDriver :
old version
Code: Select all
bool sduRequestsHook(USBDriver *usbp) {
if ((usbp->setup.bmRequestType & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) {
switch (usbp->setup.bRequest) {
case CDC_GET_LINE_CODING:
usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL);
return true;
case CDC_SET_LINE_CODING:
usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL);
return true;
case CDC_SET_CONTROL_LINE_STATE:
/* Nothing to do, there are no control lines.*/
usbSetupTransfer(usbp, NULL, 0, NULL);
return true;
default:
return false;
}
}
return false;
}
lastet version
Code: Select all
bool sduRequestsHook(USBDriver *usbp) {
if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) {
switch (usbp->setup[1]) {
case CDC_GET_LINE_CODING:
usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL);
return true;
case CDC_SET_LINE_CODING:
usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL);
return true;
case CDC_SET_CONTROL_LINE_STATE:
/* Nothing to do, there are no control lines.*/
usbSetupTransfer(usbp, NULL, 0, NULL);
return true;
default:
return false;
}
}
return false;
}