Intermediate step in the examples tree, looking to get USB working correctly on the
429 still
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
e4d106dce6
commit
a3ff2c9250
@@ -67,8 +67,12 @@ sdram_init(void) {
|
||||
/*
|
||||
* First all the GPIO pins that end up as SDRAM pins
|
||||
*/
|
||||
rcc_periph_clock_enable(RCC_GPIOB | RCC_GPIOC | RCC_GPIOD |
|
||||
RCC_GPIOE | RCC_GPIOF | RCC_GPIOG);
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
rcc_periph_clock_enable(RCC_GPIOC);
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
rcc_periph_clock_enable(RCC_GPIOE);
|
||||
rcc_periph_clock_enable(RCC_GPIOF);
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
gpio_mode_setup(sdram_pins[i].gpio, GPIO_MODE_AF, GPIO_PUPD_NONE,
|
||||
@@ -79,7 +83,11 @@ sdram_init(void) {
|
||||
}
|
||||
|
||||
/* Enable the SDRAM Controller */
|
||||
#if 1
|
||||
rcc_periph_clock_enable(RCC_FSMC);
|
||||
#else
|
||||
rcc_peripheral_enable_clock(&RCC_AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
#endif
|
||||
|
||||
/* Note the STM32F429-DISCO board has the ram attached to bank 2 */
|
||||
/* Timing parameters computed for a 168Mhz clock */
|
||||
|
||||
@@ -73,15 +73,12 @@ sdram_init(void) {
|
||||
/*
|
||||
* First all the GPIO pins that end up as SDRAM pins
|
||||
*/
|
||||
rcc_periph_clock_enable(RCC_GPIOB | RCC_GPIOC | RCC_GPIOD |
|
||||
RCC_GPIOE | RCC_GPIOF | RCC_GPIOG);
|
||||
/*
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
rcc_periph_clock_enable(RCC_GPIOC);
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
rcc_periph_clock_enable(RCC_GPIOE);
|
||||
rcc_periph_clock_enable(RCC_GPIOF);
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
*/
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
gpio_mode_setup(sdram_pins[i].gpio, GPIO_MODE_AF, GPIO_PUPD_NONE,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
CFLAGS = -DTEST
|
||||
OBJS = clock.o console.o
|
||||
|
||||
BINARY = spi-mems
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
## along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
OBJS = console.o
|
||||
|
||||
BINARY = cdcacm
|
||||
|
||||
LDSCRIPT = ../stm32f4-discovery.ld
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/cdc.h>
|
||||
#include <libopencm3/cm3/scb.h>
|
||||
#include "console.h"
|
||||
|
||||
static const struct usb_device_descriptor dev = {
|
||||
.bLength = USB_DT_DEVICE_SIZE,
|
||||
@@ -208,6 +209,7 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
static void cdcacm_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
||||
{
|
||||
console_puts("set config called.\n");
|
||||
(void)wValue;
|
||||
|
||||
usbd_ep_setup(usbd_dev, 0x01, USB_ENDPOINT_ATTR_BULK, 64,
|
||||
@@ -227,6 +229,8 @@ int main(void)
|
||||
usbd_device *usbd_dev;
|
||||
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
console_setup();
|
||||
console_puts("USB demo (orig)\n");
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_OTGFS);
|
||||
|
||||
Reference in New Issue
Block a user