cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042F6P6TR USB Virtual Port Com (CDC) not working

LLope.31
Associate III

Hello everyone,

I need help because i wanted to use USB VCP for communicating from my STM32 to an arduino via USB-Serial converter.

I thought this MCU was good enough for that. But it seems to have a memory problem.

After creating a new project and enabling the "Virtual Port Com" in "USB_DEVICE Mode and Configuration", I generate the code and compile, and get the following error:

/home/luispl/st/stm32cubeide_1.12.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.linux64_1.0.200.202301161003/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: emwaver_usbtest_f042.elf section `._user_heap_stack' will not fit in region `RAM'

/home/luispl/st/stm32cubeide_1.12.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.linux64_1.0.200.202301161003/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 376 bytes

collect2: error: ld returned 1 exit status

make: *** [makefile:68: emwaver_usbtest_f042.elf] Error 1

Any help would be appreciated. I really want to make this MCU work with virtual com port. I find it weird that this one doesn't work and has 32kb flash, but the bluepill module works fine and has 64kb flash. It's just double. Does the USB driver cost that much memory? How complex can it be..

1 ACCEPTED SOLUTION

Accepted Solutions
LLope.31
Associate III

It's fixed. It was the buffer that was too big, I changed from 1024 bytes to 128 and it worked

View solution in original post

1 REPLY 1
LLope.31
Associate III

It's fixed. It was the buffer that was too big, I changed from 1024 bytes to 128 and it worked