STM32GENERIC, my arduino implementation

Discussions about the STM32generic core
acronis
Posts: 161
Joined: Thu Mar 02, 2017 12:32 pm

Re: STM32GENERIC, my arduino implementation

Post by acronis » Sat Jun 17, 2017 12:24 am

danieleff wrote:
acronis wrote:3.2 inch TFT LCD screen with resistive touch screens ILI9341 display module
especially for black Board STM32F407VET6
https://ru.aliexpress.com/item/3-2-inch ... Title=true
This is the first time I actually see a display with the matching connector to the board.

stevestrong has library for 16 bit parallel display https://github.com/stevstrong/Adafruit_ ... 6bit_STM32
Confirm.
Library https://github.com/stevstrong/Adafruit_ ... 6bit_STM32 works perfectly with the display https://ru.aliexpress.com/item/3-2-inch ... Title=true.

ChrisMicro
Posts: 318
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: STM32GENERIC, my arduino implementation

Post by ChrisMicro » Tue Jun 20, 2017 8:54 am

We have a new contributor to the STM32GENERIC repository.

He is starting to intensively to support the STM32F429 discovery.

Hello huaweiwx :D

User avatar
RogerClark
Posts: 7681
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32GENERIC, my arduino implementation

Post by RogerClark » Tue Jun 20, 2017 9:58 am

I checked the user database on the forum and we don't have any members with the email address listed on Github (huaweiwx@sina.com) and we don't have anyone with huaweiwx as their username

Probably best to try emailing them, or contact them via a github issue on that repo

Their email address on GitHub is from this company http://corp.sina.com.cn/eng/sina_intr_eng.htm
In china

I would clone or fork that repo asap, as we don't know who they are, they could remove it again and if not forked or cloned it would be lost

TFTLCDCyg
Posts: 7
Joined: Tue Sep 20, 2016 5:06 pm

Re: STM32GENERIC, my arduino implementation

Post by TFTLCDCyg » Fri Sep 08, 2017 7:07 pm

danieleff great core. THX

Is it possible to use on SdFat library: SPI4, SPI5 or SPI6 in boards like the Discovery F429ZI?

At this time, only can used fine SPI1, SPI2 and SPI3

Best Regards!
TFTLCDCyg

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM32GENERIC, my arduino implementation

Post by michael_l » Wed Oct 04, 2017 7:21 pm

Hi, I wonder if there's support for this small Blue F407VET6 board?

http://stm32duino.com/viewtopic.php?f=3 ... =60#p28309

User avatar
Manny
Posts: 72
Joined: Wed Dec 09, 2015 3:15 pm

Re: STM32GENERIC, my arduino implementation

Post by Manny » Mon Jan 01, 2018 8:27 pm

michael_l wrote:
Wed Oct 04, 2017 7:21 pm
Hi, I wonder if there's support for this small Blue F407VET6 board?

http://stm32duino.com/viewtopic.php?f=3 ... =60#p28309

I used the Black_F407VE and overwrote the variant.c file with the following to get the Blue F407VE Mini to work while I figure out on how to add a board..yes I did read the wiki :?

Code: Select all

#include "stm32_build_defines.h"
#include "stm32_def.h"

void Error_Handler();

void SystemClock_Config(void) {
  RCC_OscInitTypeDef RCC_OscInitStruct;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;
  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;

  __HAL_RCC_PWR_CLK_ENABLE();

  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 25;
  RCC_OscInitStruct.PLL.PLLN = 336;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 7;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
  {
    Error_Handler();
  }

  PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
  PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
  PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
  {
  Error_Handler();
  }

  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);

  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);

  /* SysTick_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
Anyone with with a rotary encoder example?

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM32GENERIC, my arduino implementation

Post by michael_l » Mon Jan 01, 2018 8:48 pm

Manny wrote:
Mon Jan 01, 2018 8:27 pm
michael_l wrote:
Wed Oct 04, 2017 7:21 pm
Hi, I wonder if there's support for this small Blue F407VET6 board?

http://stm32duino.com/viewtopic.php?f=3 ... =60#p28309

I used the Black_F407VE and overwrote the variant.c file with the following to get the Blue F407VE Mini to work while I figure out on how to add a board..yes I did read the wiki :?

Code: Select all

#include "stm32_build_defines.h"
#include "stm32_def.h"

void Error_Handler();

void SystemClock_Config(void) {
  RCC_OscInitTypeDef RCC_OscInitStruct;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;
  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;

  __HAL_RCC_PWR_CLK_ENABLE();

  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 25;
  RCC_OscInitStruct.PLL.PLLN = 336;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 7;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
  {
    Error_Handler();
  }

  PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
  PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
  PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
  {
  Error_Handler();
  }

  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);

  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);

  /* SysTick_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
Thanks for this! I'll try this and report back.

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM32GENERIC, my arduino implementation

Post by michael_l » Fri Jan 26, 2018 7:15 am

Thanks Manny, your variant.c works for me with Blue F407VE Mini board.

I can also confirm that SDIO works.

I also tried huaweiwx's branch but strange enough SDIO did not work. Diffed the code and there are some small changes, which are unknown to me.

Daniel, I can send pull request for changes needed for this variant, is that okay ? I added also Arduino IDE menus for this board.

User avatar
Manny
Posts: 72
Joined: Wed Dec 09, 2015 3:15 pm

Re: STM32GENERIC, my arduino implementation

Post by Manny » Fri Jan 26, 2018 8:50 pm

michael_l wrote:
Fri Jan 26, 2018 7:15 am
Thanks Manny, your variant.c works for me with Blue F407VE Mini board.
I forgot you need to change a setting in boards.txt otherwise UART gets garbled because of wrong clock setting.. the DHSE_VALUE originaly 8000000 has to be 25000000, I also add the -O3 flag for more speed ;)

Code: Select all

BLACK_F407XX.menu.subboard.BLACK_F407VE=BLACK F407VE (V2.0)
BLACK_F407XX.menu.subboard.BLACK_F407VE.upload.maximum_size=524288
BLACK_F407XX.menu.subboard.BLACK_F407VE.upload.maximum_data_size=131072
BLACK_F407XX.menu.subboard.BLACK_F407VE.build.variant=BLACK_F407VE
BLACK_F407XX.menu.subboard.BLACK_F407VE.build.board=BLACK_F407VE
BLACK_F407XX.menu.subboard.BLACK_F407VE.build.extra_flags=-DSTM32F407VE -DHSE_VALUE=25000000 -O3
I also tried huaweiwx's branch but strange enough SDIO did not work. Diffed the code and there are some small changes, which are unknown to me.
huaweiwx's fork does not compile for me and looking at the variant file what hhe calls the 'BLUE_F407VE' must be a different board all the setting are wrong for our board ..same trick should work though.

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM32GENERIC, my arduino implementation

Post by michael_l » Fri Jan 26, 2018 8:58 pm

Manny wrote:
Fri Jan 26, 2018 8:50 pm
michael_l wrote:
Fri Jan 26, 2018 7:15 am
Thanks Manny, your variant.c works for me with Blue F407VE Mini board.
I forgot you need to change a setting in boards.txt otherwise UART gets garbled because of wrong clock setting.. the DHSE_VALUE originaly 8000000 has to be 25000000, I also add the -O3 flag for more speed ;)

Code: Select all

BLACK_F407XX.menu.subboard.BLACK_F407VE=BLACK F407VE (V2.0)
BLACK_F407XX.menu.subboard.BLACK_F407VE.upload.maximum_size=524288
BLACK_F407XX.menu.subboard.BLACK_F407VE.upload.maximum_data_size=131072
BLACK_F407XX.menu.subboard.BLACK_F407VE.build.variant=BLACK_F407VE
BLACK_F407XX.menu.subboard.BLACK_F407VE.build.board=BLACK_F407VE
BLACK_F407XX.menu.subboard.BLACK_F407VE.build.extra_flags=-DSTM32F407VE -DHSE_VALUE=25000000 -O3
I also tried huaweiwx's branch but strange enough SDIO did not work. Diffed the code and there are some small changes, which are unknown to me.
huaweiwx's fork does not compile for me and looking at the variant file what hhe calls the 'BLUE_F407VE' must be a different board all the setting are wrong for our board ..same trick should work though.
I did the variant.c changes in huaweiwx's fork for the BLACK_F407VE board so I definitely was expecting SDIO also to work but as said .. no go. I did not add the -DHSE_VALUE=25000000 so I'll try that next.

Seems huaweiwx has taken this STM32GENERIC a bit further

Post Reply