Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add a new variant for WeAct MiniSTM32H743VITX and MiniSTM32H750VBT#1552

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fpistm merged 17 commits intostm32duino:mainfromag88:variant_WeActMiniH743VITX
Nov 26, 2021
Merged

Add a new variant for WeAct MiniSTM32H743VITX and MiniSTM32H750VBT#1552

fpistm merged 17 commits intostm32duino:mainfromag88:variant_WeActMiniH743VITX
Nov 26, 2021

Conversation

ag88
Copy link
Contributor

@ag88ag88 commentedNov 20, 2021
edited
Loading

Summary

The board schematics, images at the time of this commit is found at
https://github.com/WeActTC/MiniSTM32H7xx

This variant is 'unofficial' (i.e. this is community contributed and not from the original vendor). This variant works well, the contributor has done various tests and is using it. But there would not be any direct support from ST should there be
issues as you can't expect original stm32duino developers to have this board.
There is a thread for this board in the forum
https://www.stm32duino.com/viewtopic.php?f=28&t=1348
You may post your queries, issues about this board in the thread in forum, but as this is community contributed, there is no assurance of a response.

This variant is actually adapted from the generic variant found in
https://github.com/stm32duino/Arduino_Core_STM32/tree/main/variants/STM32H7xx/H742V(G-I)(H-T)_H743V(G-I)(H-T)_H750VBT_H753VI(H-T)

the changes are:

  1. created a void SystemClock_Config(void) that use the external 25 Mhz
    HSE crystal. this makes it run at 480 Mhz ! USB (CDC Serial) still
    works per normal.

Much of the rest of the peripherals are clocked at 80 Mhz (from the
outputs of PLL2 and PLL3), that's the max allowable documented in ref
manual for the ADC.

  1. the rest of definitions are pretty much same as the generic variant
    with the following redefinitions
    a. #define LED_BUILTIN PE3 (per schematics and tested)
    b. #define USER_BTN PC13 (per schematics and tested)
    c. SERIAL_TX PA9, SERIAL_RX PA10 - this makes the 1st hardware serial
    port UART1

  2. added 2 conveinence functions - this is only for this board and is
    only availaible if it is selected

   /* power saving mode, mcu runs significantly cooler    * Sysclock 240 Mhz, bus clocks 120 Mhz */  void SysClkHalfSpeed();  /* full speed - sysclk from PLL1 P - 480 Mhz   * Sysclock 480 Mhz, bus clocks 240 Mhz */  void SysClkFullSpeed()

This variant runs the systemclock default at 480 MHz (published max)
and AHB at 240 MHz. The stm32h743 mcu tend to run pretty warm after a
while (around 50 deg C). The half speed function call changes
the system clock dividers (divide by 2 - gives 240 Mhz)
and AHB dividers (divide further by 2 - gives 120 Mhz)
so that it runs at 1/2 the PLL1 P speeds (480 Mhz).
the mcu runs significantly cooler running at 1/2 speeds.
some tests has been done to swtich the speeds calling the functions at
run time, they seem to work ok. But tests isn't thorough, so check
things if you use the speed changing functions.

This PR fixes/implements the followingbugs/features

  • Feature 1
    new variant for WeAct MiniSTM32H743VITX

Explain themotivation for making this change. What existing problem does the pull request solve?

new variant for WeAct MiniSTM32H743VITX, uses onboard 25 Mhz HSE crystal,
defined LED_BUILTIN and USER_BTN

Validation

  • Ensure CI build is passed.
  • Demonstrate the code is solid. [e.g. Provide a sketch]

first a screen print
https://imgur.com/a/E97YKnf

sketch
you can find whetstone.h, whetstone.c here
https://www.stm32duino.com/viewtopic.php?p=106#p106
or here
https://github.com/stm32duino/STM32Examples/tree/main/examples/Benchmarking/Whetstone/SinglePrecision
it may take some adaptation in the codes to run

#include <Arduino.h>#include <math.h>#include "whetstone.h"enum EnCpuSp {SPFULL = 0,SPHALF};void cpusetspeed(EnCpuSp speed);void checkcmd(void);void printtempvbat(void);void cosfade();void EnableCache();void sleep(uint16_t ms);int ledPin = LED_BUILTIN;int print = false;//used by cosfade()#define PER 15#define REP 20int8_t led = 0;int n = PER, cnt = 0;uint8_t p = 0;// the setup() method runs once when the sketch startsvoid setup() {EnableCache();//initialize the digital pin as an output:pinMode(ledPin, OUTPUT);digitalWrite(ledPin, LOW);pinMode(ATEMP, INPUT_ANALOG);pinMode(AVREF, INPUT_ANALOG);pinMode(USER_BTN, INPUT_PULLDOWN);}//the loop() method runs over and over again, void loop() {checkcmd();if (print && n == 0 && cnt == 0) printtempvbat();cosfade();}/* a half hearted attempt to make a 'breathing' led, works quite well though */void cosfade() {  digitalWrite(LED_BUILTIN,led);  led = ~led & 1;  if(led)    delay(PER-p);  else    delay(p);  if(cnt>REP) {  float nf, perf;  n = n>PER?0:n+1;  nf = n * 1.0;  perf = PER * 1.0;  p = perf * ( cos(2 * PI * nf/perf) / 2.0 + 0.5 );  cnt=0;  } else  cnt++;}void printtempvbat() {uint16_t vrefint = analogRead(AVREF);Serial.print("Vref int (1.21v):");Serial.print(vrefint);Serial.println();uint16_t vtemp = analogRead(ATEMP);Serial.print("temp sensor:");Serial.print(vtemp);Serial.println();uint16_t mv = (1210 * vtemp) / vrefint;Serial.print("mvolt:");Serial.print(mv);Serial.println();// specs 5.3.22 temp sensor characteristics// V 30 deg ~ 0.62v// slope 2 mv/Cuint16_t v30 = 620;float temp = (mv - v30) * 1.0 / 2.0 + 30.0;Serial.print("temp:");Serial.print(temp);Serial.println();}void cpusetspeed(EnCpuSp speed) {if (speed == EnCpuSp::SPHALF) {SysClkHalfSpeed();} else {SysClkFullSpeed();}}void checkcmd() {if(Serial.available()) {char r = Serial.read();if(r=='p') {print = ! print;} else if (r=='w') {//whetstone(F_CPU/1000000);whetstone(SystemCoreClock/1000000);} else if (r=='C') {cpusetspeed(EnCpuSp::SPFULL);Serial.print("sysclock Mhz:");Serial.println(SystemCoreClock/1000000);} else if (r=='c') {cpusetspeed(EnCpuSp::SPHALF);Serial.print("sysclock Mhz:");Serial.println(SystemCoreClock/1000000);} else {Serial.println("p - print/stop print");Serial.println("C - cpu full speed");Serial.println("c - cpu half speed");Serial.println("w - run whetstone");}}if (digitalRead(USER_BTN) == HIGH) {Serial.println("user btn pressed");}}void blinks() {for (int i = 0; i < 5; i++) {digitalWrite(LED_BUILTIN, HIGH);delay(100);digitalWrite(LED_BUILTIN, LOW);delay(100);}}void EnableCache() {SCB_CleanDCache();__DSB();SCB_InvalidateDCache();SCB_EnableDCache();__ISB();SCB_InvalidateICache();SCB_EnableICache();}void sleep(uint16_t ms) {for(uint16_t i=0; i<ms; i++)asm("wfi");}

sample results are like such (use usb (CDC) serial with a serial monitor.
putty is quite good, responds to single key commands)

p - print/stop printC - cpu full speedc - cpu half speedw - run whetstoneVref int (1.21v):376  <<< type 'p' print the cpu temperaturetemp sensor:205mvolt:659temp:49.50Beginning Whetstone benchmark at 480 MHz ...  <<< type 'w' run whetstone benchmarkLoops:10000, Iterations:1, Duration:1627.57 millisecC Converted Single Precision Whetstones:614.41 Mflopssysclock Mhz:240 <<< typed 'c' here to reduce system clock to 240 MhzVref int (1.21v):375temp sensor:205mvolt:661temp:50.50Beginning Whetstone benchmark at 240 MHz ...   <<< type 'w' run whetstone benchmarkLoops:10000, Iterations:1, Duration:3251.76 millisecC Converted Single Precision Whetstones:307.53 MflopsVref int (1.21v):376temp sensor:202mvolt:650temp:45.00user btn pressed  <<< --- press user button on boarduser btn presseduser btn pressed

Closing issues

Fixes #xxx

ag88 added2 commitsNovember 21, 2021 05:49
The board schematics, images at the time of this commit is found athttps://github.com/WeActTC/MiniSTM32H7xxThis variant is 'unofficial' (i.e. this is community contributed and notfrom the original vendor)it is actually adapted from the generic variant found inhttps://github.com/stm32duino/Arduino_Core_STM32/tree/main/variants/STM32H7xx/H742V(G-I)(H-T)_H743V(G-I)(H-T)_H750VBT_H753VI(H-T)the changes are:1) created a void SystemClock_Config(void) that use the external 25 MhzHSE crystal. this makes it run at 480 Mhz ! USB (CDC Serial) stillworks per normal.much of the rest of the peripherals are clocked at 80 Mhz (from theoutputs of PLL2 and PLL3), that's the max allowable documented in refmanual for the ADC.2) the rest of definitions are pretty much same as the generic variantwith the following redefinitions  a.  #define LED_BUILTIN PE3 (per schematics and tested)  b.  #define USER_BTN PC13 (per schematics and tested)  c.  SERIAL_TX PA9, SERIAL_RX PA10 - this makes the 1st hardware serial      port UART13) added 2 conveinence functions - this is only for this board and isonly availaible if it is selected   /* power saving mode, mcu runs significantly cooler    * Sysclock 240 Mhz, bus clocks 120 Mhz */  void SysClkHalfSpeed();  /* full speed - sysclk from PLL1 P - 480 Mhz   * Sysclock 480 Mhz, bus clocks 240 Mhz */  void SysClkFullSpeed()  This variant runs the systemclock default at 480 MHz (published max)  and AHB at 240 MHz. The stm32h743 mcu tend to run pretty warm after a  while (around 50 deg C). The half speed function call changes  the system clock dividers (divide by 2 - gives 240 Mhz)  and AHB dividers (divide further by 2 - gives 120 Mhz)  so that it runs at 1/2 the PLL1 P speeds (480 Mhz).  the mcu runs significantly cooler running at 1/2 speeds.  some tests has been done to swtich the speeds calling the functions at  run time, they seem to work ok. But tests isn't thorough, so check  things if you use the speed changing functions.
change label WeActMiniH743VITX instead of WeActMiniH7xx
update variant_WeActMiniH743VITX.cpp add board ifdef to prevent otherboards from picking up definitions from this board (i.e. prevent crossdependencies). This is to allow other similar boards to co-exist.
@fpistmfpistm added the new variantAdd support of new bard labelNov 22, 2021
@ag88
Copy link
ContributorAuthor

ag88 commentedNov 22, 2021
edited
Loading

hi fpiSTM, the AStyle checks errors is mainly spacing corrections, it seemed I used tabs while AStyle use spaces.
Do i need to make a new commit for the AStyle checks?

@fpistm
Copy link
Member

Hi@ag88
Thanks for this PR.
I will review it soon and yes you have to fix astyle issue.

fix some astyle errors caused by spacing formatting (e.g. use spaceinstead of tabs)
@ag88
Copy link
ContributorAuthor

i made a round of fixes for the astyle errors, hope it works

fpistm reacted with thumbs up emoji

@fpistmfpistm self-requested a reviewNovember 23, 2021 13:24
@fpistmfpistm added this to the2.2.0 milestoneNov 23, 2021
@ag88
Copy link
ContributorAuthor

ag88 commentedNov 23, 2021
edited
Loading

@fpistm let me know if you prefer for me to update readme.md. I'd like to suggest an entry as follows that link to this PR comments as well as WeAct's repo for this board like such

Generic STM32H7 boards

StatusDevice(s)NameReleaseNotes
💚STM32H743VG
STM32H743VI
Generic Board2.0.0
💛STM32H743VG
STM32H743VI
WeAct MiniSTM32H743VIT62.1.1More info

the markdown codes look like such for this board's entry

| :yellow_heart: | STM32H743VG<br>STM32H743VI | [WeAct MiniSTM32H743VIT6](https://github.com/WeActTC/MiniSTM32H7xx) | *2.1.1* | [More info](https://github.com/stm32duino/Arduino_Core_STM32/pull/1552) |

I'd prefer not to update readme.md myself as it'd likely result in a need to merge. Thanks

@fpistm
Copy link
Member

Hi@ag88
yes the README.md should be updated but wit 2.2.0 not 2.1.1.
I currently reviewing it.

update README.md entry for WeAct MiniSTM32H743VIT6 board
@ag88
Copy link
ContributorAuthor

ag88 commentedNov 24, 2021
edited
Loading

fpistmand others added11 commitsNovember 25, 2021 18:54
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
and add descriptionsSigned-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
several pins already connected to other peripheralsSigned-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistmfpistm changed the titleAdd a new variant for WeAct MiniSTM32H743VITXAdd a new variant for WeAct MiniSTM32H743VITX and MiniSTM32H750VBTNov 26, 2021
@fpistm
Copy link
Member

I've tested for both boards:

  • µSD using STM32SD

  • SPI Flash

    usingSerialFlash

      Raw SerialFlash Hardware Test  Read Chip Identification:    JEDEC ID:     EF 40 17    Part Nummber: W25Q64FV    Memory Size:  8388608 bytes    Block Size:   65536 bytes  Reading Chip...  Writing 32 signatures  Double Checking All Signatures:    all 4096 signatures read ok  Checking Signature Pairs    all 2047 signature pairs read ok  Checking Read-While-Write (Program Suspend)    write 256 bytes at 512    write time was 374 microseconds.    read-while-writing: 00 00 00 00 15 F5 95 4B     test passed, good read while writing  Checking Read-While-Erase (Erase Suspend)    erase time was 217504 microseconds.    erase correctly erased 65536 bytes    read-while-erasing: 00 00 00 00 15 F5 95 4B     test passed, good read while erasing  All Tests Passed  :-)  Test data was written to your chip.  You must run  EraseEverything before using this chip for files.
  • I2C and SPI with default instance using en external EEPROM and a SD card slot.
  • USB
  • EEPROM emulation on Flash
  • ADC

Copy link
Member

@fpistmfpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM
Thanks@ag88

@fpistmfpistm merged commitd51d562 intostm32duino:mainNov 26, 2021
@ag88ag88 deleted the variant_WeActMiniH743VITX branchNovember 27, 2021 08:23
@ag88ag88 restored the variant_WeActMiniH743VITX branchNovember 29, 2021 08:44
ag88 pushed a commit to ag88/Arduino_Core_STM32 that referenced this pull requestDec 11, 2021
in previous commmit some clocks from PLL2, PLL3are not distributed to some peripheralsstm32duino#1552originally to save some power. However, users using thosepheriperials may mistake that it is not workingthis fix distributes the missed out PLL clocks to all pheripheralsthose clocks are at 80 Mhz
ag88 pushed a commit to ag88/Arduino_Core_STM32 that referenced this pull requestDec 11, 2021
in previous commit (stm32duino#1552)some clocks from PLL2, PLL3 are not distributed to some peripheralsoriginally to save some power. However, users using thosepheriperials may mistake that it is not workingthis fix distributes the missed out PLL clocks to all pheripheralsthose clocks are at 80 Mhz
ag88 pushed a commit to ag88/Arduino_Core_STM32 that referenced this pull requestDec 11, 2021
make the same fixes fromstm32duino#1585---in previous commit (stm32duino#1552)some clocks from PLL2, PLL3 are not distributed to some peripheralsoriginally to save some power. However, users using thosepheriperials may mistake that it is not workingthis fix distributes the missed out PLL clocks to all pheripheralsthose clocks are at 80 Mhz---
fpistm pushed a commit that referenced this pull requestDec 13, 2021
…ks (#1585)in previous commit some clocks from PLL2, PLL3 are not distributedto some peripherals:#1552#1585Originally to save some power. However, users using thoseperipherals may mistake that it is not working.This fix distributes the missed out PLL clocks to all peripheralsthose clocks are at 80 MHzCo-authored-by: ag88 <ag88@github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fpistmfpistmfpistm approved these changes

Assignees
No one assigned
Labels
new variantAdd support of new bard
Projects
None yet
Milestone
2.2.0 🎄 🎅
Development

Successfully merging this pull request may close these issues.

2 participants
@ag88@fpistm

[8]ページ先頭

©2009-2025 Movatter.jp