Page 1 of 1

Tool chain

Posted: Sun Nov 01, 2020 12:09 pm
by EV_Builder
I was wondering which toolchain is needed to compile the code for the inverter?

Perhaps elaborate on it and make this a sticky.

Then we are a small step closer to participating :)

Re: Tool chain

Posted: Sun Nov 01, 2020 2:39 pm
by johu
It is in the readme and I think thats where it belongs: https://github.com/jsphuebner/stm32-sine (scroll to bottom)

Re: Tool chain

Posted: Sun Nov 01, 2020 3:22 pm
by EV_Builder
Yeah, i found it but to me it doesn't make sense. But i deff can code, so perhaps there is way to lower the bar. When i got my environment setup i will post it here. If i succeed that is...

Re: Tool chain

Posted: Sun Nov 01, 2020 3:31 pm
by EV_Builder
Until now:
missingHperhaps..JPG
I know the libs are on github so will pull them but i dont know where the my is.

Re: Tool chain

Posted: Sun Nov 01, 2020 3:44 pm
by johu
I don't know which build system you're trying to use there.
I suggest to roll with Linux but apparently Windows works too. In Debian based ones you just do

Code: Select all

apt install gcc-arm-none-eabi build-essentials
Thats a useful line I could add to the readme.

Re: Tool chain

Posted: Sun Nov 01, 2020 6:15 pm
by dima
With Windows, you will need to install "Python" to build "libopencm3" + GCC + arm-none-eabi to build actual firmware.

It is not easy in Windows, I use a script to build.

Re: Tool chain

Posted: Sun Nov 01, 2020 8:05 pm
by EV_Builder
Eeekss..... i hoped on a arduino style toolchain. Can't imagine that isn't available for a STM32 MCU...

Nobody went the Visual Code and arm-none-eabi way of doing things then....

Think i will crank up a VM then :)

Re: Tool chain

Posted: Sun Nov 01, 2020 9:31 pm
by johu
Haha, Arduino didn't really exist when I started this code :) This is much better though, all self-contained bare metal stuff.

You can also try https://gitpod.io/#https://github.com/< ... stm32-sine

Just fork the project to your own git account then you can develop online if you want

Re: Tool chain

Posted: Sun Nov 01, 2020 10:05 pm
by EV_Builder
Well it's just that i'm not that fit in toolchain setups and operating systems etc.

Yeah, i already downloaded everything. Now i need a toolchain.
And not only the compiler. Which IDE do you use?

Re: Tool chain

Posted: Sun Nov 01, 2020 10:23 pm
by EV_Builder
- First thing i wanted to build is auto-tune :)
- More CANBUS less WiFi
- C# GUI??

If i get the toolchain running i will start converting my inverter :)

Re: Tool chain

Posted: Mon Nov 02, 2020 9:45 am
by johu
Sounds good. I use Code::Blocks as IDE. The cbp file is the project file.

Re: Tool chain

Posted: Tue Nov 03, 2020 11:39 pm
by EV_Builder
OK I got code block setup but you have projects inside projects so i miss a bunch of dependencies.

Isn't there a project snapshot incl. all dependencies?

Re: Tool chain

Posted: Wed Nov 04, 2020 10:46 am
by johu
Executed "make get-deps" ?

Re: Tool chain

Posted: Thu Nov 05, 2020 7:38 pm
by EV_Builder
That fails saying first no git (ok i know wy you leave that out, but i started vanilla) then it says its not within a GIT directory...

I compiled the "libopencm3" but then i get a big bunch of cpu folders/ wich part needs to be copied to the project?
(i assume this since make errors out with a reference to stm32/usart.h but in the stm32 folder in the library there are sub folders...)

For the rest almost there then :)

Re: Tool chain

Posted: Thu Nov 05, 2020 8:15 pm
by johu
No other steps, make get-deps thats it. Yes some tools must be missing, it's so obvious to me that I can't explain it ;)

Re: Tool chain

Posted: Thu Nov 05, 2020 8:16 pm
by EV_Builder
ok i figured out i should use GIT... this works way easier. So i was too old school there :).

Now your commands work (obviously).

For Linux:
  • create a VM with Ubuntu (for example)
  • sudo apt-get install (ide of choice, git, gcc-arm-none-eabi)
  • create a directory for GIT clone (mkdir .....)
(omit the version tag if you want master/develop)
  • make get-deps
  • make

Re: Tool chain

Posted: Fri Nov 06, 2020 11:15 am
by johu
Great :) I added the apt line to readme. Just wondering, why did you pick the "-source" package instead of just gcc-arm-none-eabi?

Also cloning the 4.94.R branch won't get the newest sources, I suggest you omit that.

Re: Tool chain

Posted: Mon Nov 09, 2020 5:48 pm
by EV_Builder
oww some typo's i corrected the post.

Re: Tool chain

Posted: Mon Nov 09, 2020 5:50 pm
by EV_Builder
It would be useful if you check in a new folder the commands. Build the bin and compare it. Tobe sure that references etc. and everything results in the same binary.

At Least its how we at work check the toolchain. Build something (old version/release) and compare the bin file.
We don't accept new binaries if the input was the same.