-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the WeAct Studio STM32G474 Core Board [Update] #818
Comments
Dear all I have spent some time* creating my own configuration files. I had some general success after browsing several resources, reading different example files from other boards and I managed to get some configuration working on my board. *took me ages, tbh However, I am not sure about the reliability of my implementation. While I can flash code via STLink and do simple tasks I am not fully convinced if I should trust this for starting a big project I have ahead. This is what I have accomplished so far:
For reference, check the schematic here
/*
*******************************************************************************
* Copyright (c) 2019-2021, STMicroelectronics
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
*******************************************************************************
*/
#pragma once
/*----------------------------------------------------------------------------
* STM32 pins number
*----------------------------------------------------------------------------*/
/* P1 connector left side */
#define PB12 0 // SPI2-CSn
#define PB13 1 // SPI2-CLK
#define PB14 2 // SPI2-MISO
#define PB15 3 // SPI2-MOSI
#define PC6 4 // --> BLUE LED
#define PA8 5 // I2C2-SDA
#define PA9 6 // I2C2-SCL
#define PA10 7
#define PA11 8 // USB_DP
#define PA12 9 // USB_DN
#define PA15 10 // SPI1_CSn
#define PC10 11 // UART4-TX
#define PC11 12 // UART4-RX
#define PB3 13 // SPI1/3-SCK
#define PB4 14 // SPI1/3-MISO
#define PB5 15 // SPI1/3MOSI
#define PB6 16 // USART1-TX
#define PB7 17 // USART1-RX
#define PB8 18 // BOOT0 / I2C1-SCL
#define PB9 19 // I2C1-SDA
/* P2 connector right side */
#define PB10 20
#define PB11 PIN_A12 // FLASH-SPI-CSn
#define PB2 PIN_A11
#define PB0 PIN_A10 // FLASH-SPI-MISO
#define PB1 PIN_A9 // FLASH-SPI-MOSI
#define PA7 PIN_A8 // FLASH-WPn
#define PC4 PIN_A7
#define PA5 PIN_A6
#define PA6 PIN_A5 // FLASH-HOLDn
#define PA3 PIN_A4
#define PA4 PIN_A3
#define PA1 PIN_A2
#define PA2 PIN_A1
#define PA0 PIN_A0
#define PC14 34 // RTC-XTAL-IN
#define PC15 35 // RTC-XTAL-OUT
#define PC13 36 // BUTTON
/* Unrouted to connector */
// PA13 SWDIO
// Alternate pins number
(see file in link)
#define NUM_DIGITAL_PINS 36
#define NUM_ANALOG_INPUTS 13
// On-board LED pin number
#define LED_BLUE PC6
#ifndef LED_BUILTIN
#define LED_BUILTIN LED_BLUE
#endif
// On-board user button
#ifndef USER_BTN
#define USER_BTN PC13
#endif
....
...
{
"build": {
"arduino": {
"variant_h": "variant_weact_minicore_g474ceu.h",
"ldscript":"stm32g474ceu.ld"
},
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32G4 -DSTM32G4xx -DSTM32G474xx",
"f_cpu": "170000000L",
"framework_extra_flags": {
"arduino": "-DARDUINO_WeActMiniCoreG474CEU"
},
"mcu": "stm32g474ceu",
"product_line": "STM32G474xx",
"variant": "STM32G4xx/G473C(B-C-E)U_G474C(B-C-E)U_G483CEU_G484CEU"
},
"connectivity": [
"can",
"ethernet"
],
"debug": {
"jlink_device": "STM32G474CEU",
"openocd_target": "stm32g4x",
"svd_path": "STM32G474.svd"
},
"frameworks": [
"arduino",
"cmsis",
"stm32cube"
],
"name": "WeAct Studio Mini Core G474CEU",
"upload": {
"maximum_ram_size": 131072,
"maximum_size": 524288,
"protocol": "stlink",
"protocols": [
"jlink",
"cmsis-dap",
"stlink",
"blackmagic"
]
},
"url": "https://github.com/WeActStudio/WeActStudio.STM32G474CoreBoard/tree/master",
"vendor": "WeAct Studio"
}
[env:WeAct_MiniCore_STM32G474CEU]
platform = ststm32
board = weact_minicore_g474ceu
framework = arduino
; change microcontroller
; board_build.mcu = stm32g474ceu6
;upload protocol
upload_protocol = stlink
; change MCU frequency
board_build.f_cpu = 170000000L
build_flags =
; enable USB serial
-D HSE_VALUE=8000000U
-O3
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USB_MANUFACTURER=“STMicroelectronics” You can download all files from this link: Using these files, I was able to blink an LED, enumerate my board as a COM port upon bootup and read some analog values on ADC0 (assigned to PA0 as However, I have several concerns regarding my "solution":
I would like to invite the guys from @WeActStudio to chip-in and help with these definitions. Thank you all once again 🍺 |
The closest board available is the nucleo_g474re, however, I am not fully familiar with these boards and I may need some help defining the right parameters for the WeAct board.
The board in question is this one from AliExpress.
The provided repo by WeAct is here.
This board does not have an external flash; however, the bare footprint is available for soldering one chip, as is commonly done with these boards.
Thanks in advance
The text was updated successfully, but these errors were encountered: