How to configure USB Host and RTOS?
I noticed that STM32CubeIDE 1.4 does not work in the same way as IDE 1.0 with RTOS and USB Host. In IDE 1.0 it is possible to get messages from Degug but in IDE 1.4 not even the messages are displayed.
When the uC is started with the pendrive already connected, these messages are generated in IDE 1.0:
Power On
USB Device Attached
PID: 4200h
VID: 13feh
Address (#1) assigned.
Manufacturer :
Product : USB DISK 2.0
Serial Number : 7F004191A203B205
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
USB Device disconnected
USB Device Attached
USB Device disconnected
USB Device Attached
USB Device disconnected
USB Device Attached
PID: 4200h
VID: 13feh
Address (#1) assigned.
Manufacturer :
Product : USB DISK 2.0
Serial Number : 7F004191A203B205
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.But there is a problem after the recognition of the MSC class. In addition, there is a problem with the recycling of routines, it can be observed that after disconnecting the pendrive several times, it was possible to recognize the device again.
Without RTOS these messages are obtained:
Power On
USB Device Attached
PID: 4200h
VID: 13feh
Address (#1) assigned.
Manufacturer :
Product : USB DISK 2.0
Serial Number : 7F004191A203B205
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
Number of supported LUN: 2
LUN #0:
Inquiry Vendor :
Inquiry Product : USB DISK 2.0
Inquiry Version : PMAP
MSC Device ready
MSC Device capacity : 3449028096 Bytes
Block number : 15124991
Block Size : 512
LUN #1:
Inquiry Vendor :
Inquiry Product : USB DISK 2.0
Inquiry Version : PMAP
Sense Key : 5
Additional Sense Code : 25
Additional Sense Code Qualifier: 20
USB Device disconnected
USB Device Attached
PID: 4200h
VID: 13feh
Address (#1) assigned.
Manufacturer :
Product : USB DISK 2.0
Serial Number : 7F004191A203B205
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
Number of supported LUN: 2
LUN #0:
Inquiry Vendor :
Inquiry Product : USB DISK 2.0
Inquiry Version : PMAP
MSC Device ready
MSC Device capacity : 3449028096 Bytes
Block number : 15124991
Block Size : 512
LUN #1:
Inquiry Vendor :
Inquiry Product : USB DISK 2.0
Inquiry Version : PMAP
Sense Key : 5
Additional Sense Code : 25
Additional Sense Code Qualifier: 20In IDE 1.4 and without RTOS these messages are obtained:
Power On
USB Device Connected
USB Device Reset Completed
PID: 4200h
VID: 13feh
Address (#1) assigned.
Manufacturer :
Product : USB DISK 2.0
Serial Number : 7F004191A203B205
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
Number of supported LUN: 1
LUN #0:
Inquiry Vendor :
Inquiry Product : USB DISK 2.0
Inquiry Version : PMAP
MSC Device ready
MSC Device capacity : 3449028096 Bytes
Block number : 15124991
Block Size : 512
USB Device disconnected
USB Device Connected
USB Device Reset Completed
PID: 4200h
VID: 13feh
Address (#1) assigned.
Manufacturer :
Product : USB DISK 2.0
Serial Number : 7F004191A203B205
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
Number of supported LUN: 1
LUN #0:
Inquiry Vendor :
Inquiry Product : USB DISK 2.0
Inquiry Version : PMAP
MSC Device ready
MSC Device capacity : 3449028096 Bytes
Block number : 15124991
Block Size : 512When RTOS is activated, the USBH_Process_OS subroutine of the usbh_core.c file does not execute anything, the condition (event.status == osEventMessage) cannot be true.
(usbh_core.c:)
static void USBH_Process_OS(void const *argument)
{
osEvent event;
for (;;)
{
event = osMessageGet(((USBH_HandleTypeDef *)argument)->os_event, osWaitForever);
if (event.status == osEventMessage)
{
USBH_Process((USBH_HandleTypeDef *)argument);
}
}
}
#elseWhen RTOS is activated, in IDE 1.4, is it normal for Debug messages to stop being generated?