Using Arduino for other board

Post here first, or if you can't find a relevant section!
Post Reply
speecu
Posts: 5
Joined: Sat Jan 04, 2020 3:51 pm

Using Arduino for other board

Post by speecu »

Hello, i just want to know if its possible to use the arduino program for a board that has other serial number like stm32f411E-DISCO by using this type stm32f407G-DISC1 ?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Using Arduino for other board

Post by fpiSTM »

Hi,

pin mapping could not be the same, clock configuration could not be the same....
speecu
Posts: 5
Joined: Sat Jan 04, 2020 3:51 pm

Re: Using Arduino for other board

Post by speecu »

Okey, but can i find somewhere the package with this board to use it or it's the only one?
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Using Arduino for other board

Post by ag123 »

it seemed both f407vg and f411ve disco boards use a 8mhz HSE crystal.
so i'd guess you could try it,
there could be gotchas if register mappings or clocks settings are literally different between f407 vs f411 (there is a good chance for parts of it being the same)
or perhaps you could wait a little for a new variant ;)
in terms of pins use references like PAxx tend to avoid pin mapping issues as normally the same PAxx maps the same way between mcus (of the same family e.g. f4xx)
it'd help to keep the manual handy as it has the schematics in it
https://www.st.com/en/evaluation-tools/ ... overy.html
my guess is you could temporarily try out the f407vg variant and await a actual variant for f411ve variant being available
Last edited by ag123 on Sat Jan 04, 2020 5:24 pm, edited 1 time in total.
speecu
Posts: 5
Joined: Sat Jan 04, 2020 3:51 pm

Re: Using Arduino for other board

Post by speecu »

Thanks for the answer, i've already checked and it wont work unluckly :/
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Using Arduino for other board

Post by ag123 »

based on the f411 user manuals there are leds on PD12, PD13, PD14, PD15
so i'd guess one way is to try to blink the leds, e.g.

Code: Select all

pinMode(PD12,OUTPUT);
digitalWrite(PD12,1);
that should light up the led, you could make it a blinky so that it would be more obvious that the sketch is working
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Using Arduino for other board

Post by ag123 »

ok i noted the folly, f407vg runs at 168mhz, while f411ve runs at 100mhz max, though based on the manual, both of them runs on a 8mhz crystal
if you are feeling a little adventurous
locate the file
.arduino15/packages/STM32/hardware/stm32/1.8.0/variants/DISCO_F407VG/variant.cpp
first make a backup of it

in variant.cpp locate the function

Code: Select all

WEAK void SystemClock_Config(void)
{
...
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  //RCC_OscInitStruct.PLL.PLLM = 8;
  //RCC_OscInitStruct.PLL.PLLN = 336;
  //RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  //RCC_OscInitStruct.PLL.PLLQ = 7;
  //108Mhz
  RCC_OscInitStruct.PLL.PLLM = 1;
  RCC_OscInitStruct.PLL.PLLN = 54;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
  RCC_OscInitStruct.PLL.PLLQ = 9;
  //96Mhz
  RCC_OscInitStruct.PLL.PLLM = 2;
  RCC_OscInitStruct.PLL.PLLN = 48;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 4;

the set m = 8, n = 336, p = 2, q = 7 is for 168 mhz, i've shown it commented off
i've shown 2 sets of clock settings
you need to comment one of the other 2 set 108mhz slightly overclocks, 96mhz is just within the 100mhz limits given in F411 specs
if it gets lucky this may work, but this still do not patch up the pin maps, or check other stuff e.g. other clocks settings
some work may be needed there
i do not have a f411 board to test this, so good luck with the attempt
;)
Last edited by ag123 on Sun Jan 05, 2020 4:38 am, edited 1 time in total.
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Using Arduino for other board

Post by fredbox »

In the official core, you can select Tools->Board Nucleo 64. For Board Part Number you can select Nucleo F411RE. Wouldn't this get you close? The 411RE has less pins than the 411VE but it appears to run at the same clock speed.

I've been looking at those pill boards with the STM32F411CEU6 and wondering if this configuration would be applicable.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Using Arduino for other board

Post by ag123 »

agreed with fred

i did not look at the 411RE NUCLEO, but i think that is likely a better fit and may just work out of the box
interestingly nucleo caters for a 8mhz crystal though according to the manual it isn't soldered
https://www.st.com/content/ccc/resource ... 105823.pdf
still as 8mhz seemed to be the defacto frequency, it'd (the variant) likely work so long as the crystal is there

i think the pill boards run off a 25mhz crystal, so the divisors and multipliers are likely different.
for the pill boards F401 is currently supported out of the box
viewtopic.php?f=14&p=350#p350
i think it is similar/(identical?) to the F411 pill board same layout chip swap f401/f411 25mhz crystal, just that F401 do not have certain on chip hardware e.g. sd and 2 additional spi on f411. f401 has less sram and flash as well, but i'd guess it'd still work in f411
vanillahere
Posts: 2
Joined: Mon Jul 17, 2023 1:15 pm

Re: Using Arduino for other board

Post by vanillahere »

Hello,
I am fairly new to the world of microcontrollers and I have recently started a project for automated control of DC motors for active suspension applications. Currently the system has arduino nano board which is to be replaced by the stm32f411E-DISCO board however I am not able to detect this board in Arduino IDE even after installing the packages. moreover, this particular board stm32f411E-DISCO is not to be found anywhere inside the discovery board list. What could be the alternative or workaround for this? or should i simply code inside STMCubeIDE, Arduino code seems simpler to learn. Could anyone please guide me, would be highly appreciated thank you.
Post Reply

Return to “General discussion”