cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f070F6 with CDC HAL libs?

David Martins
Senior
Posted on May 10, 2018 at 16:32

Hi.

I'm trying to upgrade an existing PCB (so changing the MCU is not an option for now).

The MCU used so far is the STM32f070F6. The MCU has USB peripheral and I want to use this as VCOM.

When I generate the code with CubeMX and try to compile (with absolutely no code change), I get the message that the MCU do not have enough RAM: '/arm-none-eabi/bin/ld.exe: region` RAM 'overflowed by 1760 bytes'.

I have already changed the CDC buffers to a size of 40 bytes (maximum of what I want to transfer), but I still have a similar error.

Is there an example with this MCU in which the USB peripheral is used?

Thank you.

#cubemx #usbvcom #stm32f070f6 #stm32f070
15 REPLIES 15
Khouloud GARSI
Lead II
Posted on May 10, 2018 at 17:54

Hi David,

There is an application under the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-mcu-packages/stm32cubef0.html

package. It's titled 'CDC_Standalone' and could be found following the path below:

STM32Cube_FW_F0_V1.9.0\Projects\STM32072B_EVAL\Applications\USB_Device\CDC_Standalone

The example may help you to correctly configure your application. It shows how to use the STM32F0xx USB Device peripheral where the STM32 MCU behaves as a USB-to-RS232 bridge following the Virtual COM Port (VCP) implementation. 

Khouloud.

Posted on May 11, 2018 at 16:52

Thank you

garsi.khouloud

I'm following this example, but the problem is that I can not compile at all.

I still have RAM overflow.

The project is here (

https://mega.nz/#F!ke5S0JoJ!tJqNLGDPO_OMfP3whwUPrg

).

As you can see, there is no modified code. It's a clean project, but apparently there is not enough RAM ...

arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -specs=nosys.specs -specs=nano.specs -T'../STM32F070F6Px_FLASH.ld' -Wl,-Map=output.map -Wl,--gc-sections -o 'stm_vcom.elf' @'objects.list' -lm

c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.0.201708311556/tools/compiler/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: stm_vcom.elf section`.bss' will not fit in region `RAM'

c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.0.201708311556/tools/compiler/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe:region `RAM' overflowed by 1632 bytes

collect2.exe: error: ld returned 1 exit status

make: *** [stm_vcom.elf] Error 1

makefile:37: recipe for target 'stm_vcom.elf' failed

Can you confirm, please?

Thank you.

Posted on May 11, 2018 at 17:35

Examine the mapfile to find out where did the memory go.

JW

Posted on May 14, 2018 at 12:20

Is much RAM being spent on RX and TX buffers?

Am I parsing correctly?

https://s7.postimg.cc/a1pn4vzmj/Capturar.png

Posted on May 14, 2018 at 13:43

From *.map file:

0x1000 = 4096 bytes

From 'usbd_cdc_if.c':

https://s7.postimg.cc/7n6ybk8bf/Capturar.png

But in the configurator I wrote 64 bytes to the RX and TX buffer.

Could it be a CubeMX bug?

https://s7.postimg.cc/gi7smc4wb/Capturar.png

David Martins
Senior
Posted on May 14, 2018 at 15:49

Now I can compile the code, but my windows PC still does not detect the device, as USB COM port.

This is my circuit and I think everything is correct to work ...

Could it be a Drivers problem?

https://s7.postimg.cc/xyfqthd7v/Capturar.png

David Martins
Senior
Posted on May 16, 2018 at 12:54

This forum is being watched?

Any news? Some help?

Posted on May 16, 2018 at 12:55

Hi Martin,

  • Now I can compile the code,

-> Could you please share the encountered issue and the solution. This will be helpful for other STM32 MCUs users who are  facing the same issue.

  • Are you building a bus or self powered USB application?

Khouloud.

Posted on May 16, 2018 at 13:10

garsi.khouloud

‌,

I already explained how I managed to compile. Did you see this post?

https://community.st.com/0D50X00009XkeFHSAZ

Change the APP_RX_DATA_SIZE and the APP_TX_DATA_SIZE to 64 solve the problem.

Can you confirm that it is

a CubeMX bug?

This is the circuit I have on my PCB:

https://community.st.com/0D50X00009XkeFHSAZ

All power comes from USB (J2 - is the USB connector).