cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476 Discovery CDC configuration change

scash9
Associate
Posted on October 05, 2016 at 12:48

Hi all,

I'm working on a USB CDC demo from cubel4 family under the STM32L476G_EVAL board.

I port the example to work with the STM32L476_VG_Discovery changing the PIN.

The example configure the board to receive from a USARTx interrupt and transmit from a USARTx_DMA_TX interrupt.

I wanna know how to configure the example to receive and transmit both from the DMA. I must change the configuration in the hal_msp.c and configure the new interrupt USARTx_DMA_RX?

Thank's

#stm32l476 #dma #cdc
1 REPLY 1
slimen
Senior
Posted on October 07, 2016 at 13:26

Hello,

I recommend to use the STM32CubeMX tool to initialize peripherals, build and generate your starting projects with initialization C code.

STM32CubeMX tool from ST will allow you to choose the microcontroller, select the peripherals you want and map them to pins graphically. 

Then, you can follow the ''CDC-Standalone'' example from STM32CubeL4 and modify this working application depending on your needs:

 STM32Cube_FW_L4_V1.5.0\Projects\STM32L476G_EVAL\Applications\USB_Device\CDC_Standalone

For more detail about

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html

tool, take a look to this user Manual

http://www.st.com/content/ccc/resource/technical/document/user_manual/10/c5/1a/43/3a/70/43/7d/DM00104712.pdf/files/DM00104712.pdf/jcr:content/translations/en.DM00104712.pdf

.

For more details, refer to

http://www.st.com/content/ccc/resource/technical/document/user_manual/cf/38/e5/b5/dd/1d/4c/09/DM00108129.pdf/files/DM00108129.pdf/jcr:content/translations/en.DM00108129.pdf

that explains more the use of STM32Cube USb device library.

Regards