Fix oscillator oversight in clocks.c

This commit is contained in:
Lucian Copeland 2020-02-05 18:12:48 -05:00
parent 788464a594
commit cdd1622350
6 changed files with 11 additions and 3 deletions

View File

@ -34,6 +34,8 @@
#define MICROPY_HW_NEOPIXEL (&pin_PC00)
#define BOARD_OSC_DIV 12
// On-board flash
#define SPI_FLASH_MOSI_PIN (&pin_PB05)
#define SPI_FLASH_MISO_PIN (&pin_PB04)

View File

@ -32,6 +32,7 @@
#define FLASH_SIZE (0x100000)
#define FLASH_PAGE_SIZE (0x4000)
#define BOARD_OSC_DIV 12
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)

View File

@ -32,5 +32,7 @@
#define FLASH_SIZE (0x100000)
#define FLASH_PAGE_SIZE (0x4000)
#define BOARD_OSC_DIV 8
#define DEFAULT_I2C_BUS_SCL (&pin_PB10)
#define DEFAULT_I2C_BUS_SDA (&pin_PB09)

View File

@ -25,6 +25,7 @@
* THE SOFTWARE.
*/
#include "stm32f4xx_hal.h"
#include "py/mpconfig.h"
void stm32f4_peripherals_clocks_init(void) {
//System clock init
@ -44,7 +45,7 @@ void stm32f4_peripherals_clocks_init(void) {
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 12;
RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
RCC_OscInitStruct.PLL.PLLQ = 7;

View File

@ -25,6 +25,7 @@
* THE SOFTWARE.
*/
#include "stm32f4xx_hal.h"
#include "py/mpconfig.h"
void stm32f4_peripherals_clocks_init(void) {
//TODO: All parameters must be moved to board level, due to relationship with HSE Osc.
@ -46,7 +47,7 @@ void stm32f4_peripherals_clocks_init(void) {
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 12;
RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;

View File

@ -25,6 +25,7 @@
* THE SOFTWARE.
*/
#include "stm32f4xx_hal.h"
#include "py/mpconfig.h"
void stm32f4_peripherals_clocks_init(void) {
//System clock init
@ -46,7 +47,7 @@ void stm32f4_peripherals_clocks_init(void) {
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV;
RCC_OscInitStruct.PLL.PLLN = 200;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;