Fix for Blue Pill, wait using MHZ.

This commit is contained in:
NIIBE Yutaka
2018-05-08 13:16:58 +09:00
parent 808aa5b186
commit f500ac03da
5 changed files with 40 additions and 3 deletions

View File

@@ -1,3 +1,11 @@
2018-05-08 NIIBE Yutaka <gniibe@fsij.org>
* board/board-blue-pill.h (GPIO_USB_SET_TO_ENABLE): Remove.
* doc/chopstx.texi (Compile-time macro): Add chapter.
* mcu/sys-stm32f103.c (usb_lld_sys_init): Use MHZ.
2018-04-26 NIIBE Yutaka <gniibe@fsij.org> 2018-04-26 NIIBE Yutaka <gniibe@fsij.org>
* board/board-blue-pill-g.h: New. Define STM32_ADCPRE and * board/board-blue-pill-g.h: New. Define STM32_ADCPRE and

18
NEWS
View File

@@ -1,6 +1,24 @@
NEWS - Noteworthy changes NEWS - Noteworthy changes
* Major changes in Chopstx 1.9
Released 2018-05-09
** GD32F103 support
GD32F103 is an alternative implementation of STM32F103 by Giga Device,
which can run at 96MHz.
** Minor USB driver fix for STM32F103
BTABLE setting should be done for initialization, not for USB RESET.
** Minor ADC driver change for GD32F103
ADC on GD32F103 is another implementation and its behavior is somewhat
different. It requires waits after enabling. So, we use continuous
samping. Still, we observe enough noise (> 4.7 bit/byte) for each ADC
sampling.
* Major changes in Chopstx 1.8 * Major changes in Chopstx 1.8
Released 2018-01-19 Released 2018-01-19

View File

@@ -13,13 +13,14 @@
#define GPIO_LED_BASE GPIOC_BASE #define GPIO_LED_BASE GPIOC_BASE
#define GPIO_LED_CLEAR_TO_EMIT 13 #define GPIO_LED_CLEAR_TO_EMIT 13
#define GPIO_USB_BASE GPIOA_BASE #define GPIO_USB_BASE GPIOA_BASE
#define GPIO_USB_SET_TO_ENABLE 12
#undef GPIO_OTHER_BASE #undef GPIO_OTHER_BASE
/* /*
* Port A setup. * Port A setup.
* PA11 - Push Pull output 10MHz 0 default (until USB enabled) (USBDM) * PA11 - Push Pull output 10MHz 0 default (until USB enabled) (USBDM)
* PA12 - Push Pull output 10MHz 0 default (until USB enabled) (USBDP) * PA12 - Push Pull output 10MHz 0 default (until USB enabled) (USBDP)
*
* Port C setup.
* PC13 - Push pull output 50MHz (LED 1:ON 0:OFF) * PC13 - Push pull output 50MHz (LED 1:ON 0:OFF)
* ------------------------ Default * ------------------------ Default
* PAx - input with pull-up * PAx - input with pull-up

View File

@@ -11,7 +11,7 @@
This manual is for Chopstx (version @value{VERSION}). This manual is for Chopstx (version @value{VERSION}).
@noindent @noindent
Copyright @copyright{} 2013, 2015, 2016, 2017 Flying Stone Technology @* Copyright @copyright{} 2013, 2015, 2016, 2017, 2018 Flying Stone Technology @*
@quotation @quotation
Permission is granted to copy, distribute and/or modify this document Permission is granted to copy, distribute and/or modify this document
@@ -157,6 +157,16 @@ program carefully. Enabling sleep, it may result a bricked board; A
board with no RESET pin cannot be debugged by JTAG/SWD. board with no RESET pin cannot be debugged by JTAG/SWD.
@node Compile-time macro
@chapter Compile-time macro
@subheading MHZ
@anchor{MHZ}
@defmac {MHZ}
Running CPU clock in MHz. Used for chopstx_usec_wait.
@end defmac
@node API @node API
@chapter API @chapter API

View File

@@ -82,7 +82,7 @@ usb_lld_sys_init (void)
{ {
usb_lld_sys_shutdown (); usb_lld_sys_shutdown ();
/* Disconnect requires SE0 (>= 2.5uS). */ /* Disconnect requires SE0 (>= 2.5uS). */
wait (300); wait (5*MHZ);
} }
usb_cable_config (1); usb_cable_config (1);