Recently, I used the USB_OTG_FS of STM32F407VET6 as a virtual serial port for work.
I used STM32 CubeMX to generate the virtual serial port code of STM32F103C8T6 before, and it was very convenient to use. So I used MX to produce the project for F407 this time, but I encountered many problems and was troubled for two days.
Let me talk about my process first.
The address of the post was that the heap space allocated by STM32CubeMX was too small:
change 0x200 to 0x600 (isn't it generally the case that the heap space is larger than the stack space?), regenerate the project, compile, download, and plug in the USB:
Fantastic! The yellow exclamation mark finally disappeared (ignore the COM7, that was a minor problem with the driver). Compile after adding some code:
/* StartDefaultTask function */
void StartDefaultTask(void const * argument)
{
/* init code for USB_DEVICE */
MX_USB_DEVICE_Init();
/* USER CODE BEGIN 5 */
/* Infinite loop */
for(;;)
{
CDC_Transmit_FS((uint8_t *)"No Fuck!\n",sizeof("No Fuck!\n"));
osDelay(500);
}
/* USER CODE END 5 */
}
Finally it can be used normally, and this USB virtual serial port can come to an end.
Previous article:STM32 hardware I2C and AT24C16
Next article:STM32-USB virtual serial port-learning notes
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Share MSP430F149 interrupt learning
- I found a good domestic embedded GUI, the display effect of Android is amazing
- [Atria Development Board AT32F421 Review] - Unboxing Review
- New uses for old phones (9) - File sync
- Near Field Communication (NFC) Transceiver Design
- Guwei LCR819 bridge cannot be tested maintenance record
- MP2459 related circuit solution
- TI Industrial Robots Online Seminar Resource Sharing
- [Gifts to give away] STMicroelectronics Power and Discrete Devices (PDSA) Quiz with Prizes!
- Enjoy the Avnet Artificial Intelligence Cloud Exhibition and challenge the 60-day check-in learning and development record!