2018-05-10 07:32 AM
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 #stm32f0702018-05-16 06:17 AM
Hi David,
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?
-> I will share this internally for further check and come back to you with an answer ASAP.
Khouloud.
2018-05-16 06:26 AM
I see that your oscillator is 16MHz but the value in the clock configuration is 8MHz:
See HSE_VALUE macro.
2018-05-16 06:54 AM
In fact a negligent mistake from me.
I tested momentarily with an 8MHz crystal to see if there were any changes.When I put the 16MHz crystal back on again, I did not see it oscillates.
Now when I read the post I went to see and itnot
oscillate
... because the crystal was badly welded.https://s7.postimg.cc/ltkwp7xgr/Capturar.png
Now the crystal is oscillating again.
But it still does not detect anything on the USB ....
2018-05-16 07:05 AM
Problem solved!
When regenerating the configuration with CubeMX, I had to make an update.
I compiled the code and flashed the MCU. I turned on the USB and it worked right away.
Please confirm if the
APP_RX_DATA_SIZE and the APP_TX_DATA_SIZE with 2048
isa CubeMX bug?
The CubeMX do not change these values...Thank you all!
2018-05-17 03:06 AM
Hi David,
Happy to hear that your issue is solved!
Regarding 'APP_RX_DATA_SIZE' and 'APP_TX_DATA_SIZE' values, they are configured by STM32CubeMX tool just the first time; Then it's up to user to redefine and/or remove those define based on his needs (the generated code is placed in dedicated section between:
/* USER CODE BEGIN PRIVATE_DEFINES */ and /* USER CODE END PRIVATE_DEFINES */; thus it's no longer modified by the tool).
However, I have highlighted your point to our CubeMX team and one of our experts will answer you ASAP.
Khouloud.
2018-05-18 01:44 AM
Hi David,
The user tags have been kept for compatibility with old project where the RX and TX buffer size weren't generated bu CubeMX.
2048 will never be compiled as your chip is of 6KByte RAM (0x1800), you have to set a lower value that fits in your RAM