Zombieverter .bin compile help - Codeblocks

Introduction and miscellaneous that we haven't created categories for, yet
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

I wondered if this should go in the Zombieverter thread but figured it might only clog up the thread with something so basic for most! :?

I'd like to get set up to use Codeblocks to compile the Zombie git files to keep up to date with all the development work. I'm running a Windows 10 laptop, and keep having computer issues getting virtualbox to run Ubuntu consistently, but my understanding is that windows 10 might only be a problem when uploading a .bin file over wifi, but there is no issue using Windows 10 to create the .bin (then maybe use another device to upload).

I have Codeblocks installed on Windows 10, and seem to have the arm-none-eabi toolchain installed ok too. Have a resent copy of the stm32-vcu repository and can open the stm32-vcu.cbp project. Trying to build the project, I get errors around the make/makefile.

Wondering if someone who has a similar setup could screenshot the key settings/properties windows showing the important links or options I should check (like below). I will figure out how to get mine fixed then?
Codeblocks001.JPG
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by johu »

The printf commands are the issue, windows doesn't know printf on command line. So replace it all by "echo", like so

Code: Select all

@echo   CLEAN   ${OUT_DIR}
And also you need make.exe and point CodeBlocks to it
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

Thanks Johu, I will give this a go :) Would this qualify for a support session if I don't get it!
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

Hi johu, I wanted to check that I am on the right track. When you mention the 'printf' issue, I am taking this as only referring to the 'Makefile' file in the stm32-vcu-master github directory. There are 15 instances of 'printf' in that file, and I've shown a few example of what they were and what I've changed them to below (originally just replaced printf with echo but from your example looked like the " \n" etc info also gets removed).

I have make.exe installed, Codeblocks should be looking at this as set in the Toolchain Executables section of Global Compiler Settings, but still getting an error:

-------------- Build: STM32F107 in stm32-vcu (compiler: GNU GCC Compiler for ARM)---------------

Checking if target is up-to-date: make.exe -q
Running command: make
Execution of 'make' in 'C:\Users\Neil\Downloads\Stm32-vcu-master' failed.


Code: Select all

...my_string.o digio.o my_fp.o printf.o anain.o throttle.o ...
...@printf "  OBJCOPY $(BINARY).bin\n"...
...@printf "  OBJCOPY $(BINARY).hex\n"...
...@printf "  LD      $(subst $(shell pwd)/,,$(@))\n"...
...@printf "  CLEAN   ${OUT_DIR}\n"...

Code: Select all

...my_string.o digio.o my_fp.o echo.o anain.o throttle.o ...
...@echo   OBJCOPY $(BINARY).bin...
...@echo   OBJCOPY $(BINARY).hex...
...@echo   LD      $(subst $(shell pwd)/,,$(@))...
...@echo   CLEAN   ${OUT_DIR}...

My thoughts are that echo.o wouldn't be correct and I only need to worry about the @ commands. Also thrown by 'make' reference to the Stm32-vcu-master folder, should this be Makefile if I've done it right?
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by johu »

Looks right. Can you run make on the command line?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

johu wrote: Sat Apr 23, 2022 6:16 am Looks right. Can you run make on the command line?
When I first tried 'make' from the command line I got errors about not being a command. Fixed the path's and should now be working.

Running 'make' from the stm32 folder gives me this reply, not sure yet what this means:
Make001.JPG

EDIT: Retried building in Codeblocks now the 'make' path was changed and get the same error as above
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by johu »

Ok, one step further then. Just run "make get-deps" once, then remove "get-deps" behind the "images:" label in line 63.

Code::Blocks just executes the make command so you'll always get the same result as on command line
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

Thanks johu,

Ok. So ran make get-deps once and got a similar error:
MakeGetDeps001.JPG
Then opened the Makefile in Notepad and edited line 63: images: get-deps $(BINARY) to images: $(BINARY) and ran 'make'. This looks to do more but something still annoying it:
Make002.JPG
Wondering if your suggestion to remove 'get-deps' might mean remove the whole line, I tried removing the rest of that line $(BINARY) and ran 'make', but this still gave an error:
Make003.JPG
I'm thinking the 'make get-deps' didn't do what it was supposed to above
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

Googling some forums and working through this. Originally I had only downloaded the repo zip files so went back and cloned it properly and using git bash tried the 'make' command again. More happening this time. Stopped on an error again, ran make get-deps and got another error.
Make004.JPG
As per previous suggestion, I edited line 63 of the makefile (images: get-deps $(BINARY) and removed get-deps from the line). I know get-deps didn't run right but tried anyway. Running make again gives similar error to before.
Make005.JPG
More homework to do :)
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by johu »

Oh I thought you were already compiling per your other thread.

I faintly remember this happening on Zapateros Windows machine. I "solved" it by copying the already compiled libopencm3 over

In fact you only need the static lib for the STM32F1, attached it. Extract it into libopencm3/lib

Then, with get-deps removed you should be able to just run "make"

EDIT: also it doesn't seem to find the eabi binaries. If you type "arm-non-eabi-gcc" what happens?
Attachments
libopencm3_stm32f1.a.zip
(907.86 KiB) Downloaded 65 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

Thanks johu, I will give this a try tomorrow :)

From the suggestions in the Zombie thread I've just tried gitpod and have been able to compile the latest stm32 repo, so I can try uploading and testing that tomorrow too.
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

Ran 'arm-non-eabi-gcc' and 'arm-none-eabi-gcc' and got following error so yes, looks to be issue here. They do show up in codeblocks on the toolchains though:
Bash error.JPG
Copied over the 'libopencm3_stm32f1.a' file above and unzipped into the lib folder of libopencm3 in the clone repo. Just ran make before I figure out how to fix eabi issue out of curiosity:
Bash make.JPG
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by johu »

The settings in CodeBlocks are irrelevant, the toolchain has to be in your path variable
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
paaa
Posts: 209
Joined: Fri Dec 06, 2019 8:59 pm
Location: Dublin & Kilkenny Ireland
Has thanked: 2 times
Been thanked: 11 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by paaa »

I had similar issue before issue before , when im home on Tuesday will record a video of how I set it up, I installed chocolatly to make it work. https://chocolatey.org/install
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

paaa wrote: Sun May 01, 2022 9:05 am I had similar issue before issue before , when im home on Tuesday will record a video of how I set it up, I installed chocolatly to make it work. https://chocolatey.org/install
Cheers :)
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

johu wrote: Sun May 01, 2022 6:11 am The settings in CodeBlocks are irrelevant, the toolchain has to be in your path variable
Ahh, ok. Thought I had that done but was the GnuWin32 I did recently instead. This should be it now.
Environment.JPG
Rebooted and ran 'make' again. Still something with libopencm3:
Make006.JPG
paaa
Posts: 209
Joined: Fri Dec 06, 2019 8:59 pm
Location: Dublin & Kilkenny Ireland
Has thanked: 2 times
Been thanked: 11 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by paaa »

I have a working compiled .hex or bin if you need ,only thing not working is dash can output, pm if you want me to send it to you and ill dig it out as on other pc. I have only tested dit with gs450h gearbox and e65 can so far though , fixed a scaling issue for the throttle
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by johu »

nkiernan wrote: Sun May 01, 2022 5:57 pm Rebooted and ran 'make' again. Still something with libopencm3:

Make006.JPG
Ah crap, the .h files are partially generated by some python scripts. So, attaching some more. Goes into /libopencm3/include/libopencm3
Attachments
libopencm3.zip
(541.57 KiB) Downloaded 67 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

paaa wrote: Tue May 03, 2022 5:22 pm I have a working compiled .hex or bin if you need ,only thing not working is dash can output, pm if you want me to send it to you and ill dig it out as on other pc. I have only tested dit with gs450h gearbox and e65 can so far though , fixed a scaling issue for the throttle
Perfect, happy to try. Will send a PM, cheers
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

johu wrote: Tue May 03, 2022 7:24 pm Ah crap, the .h files are partially generated by some python scripts. So, attaching some more. Goes into /libopencm3/include/libopencm3
Cheers johu, will give this a go. Sorry for taking up so much of your time on this one :?
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 276 times
Been thanked: 64 times

Re: Zombieverter .bin compile help - Codeblocks

Post by nkiernan »

nkiernan wrote: Tue May 03, 2022 8:26 pm Cheers johu, will give this a go. Sorry for taking up so much of your time on this one :?
Johu, you the man! Looks like we have lift off! Bin and Hex have been created in the folder :)
Make007.JPG
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by EV_Builder »

IMHO Visual Studio Code is the way togo on windows..
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
dadiowe
Posts: 109
Joined: Fri Sep 17, 2021 6:11 pm
Has thanked: 41 times
Been thanked: 19 times

Re: Zombieverter .bin compile help - Codeblocks

Post by dadiowe »

So after a few days trying to compile the stm3-vcu.bin file. I found a readme which gives a "simple way to compile" the files

The main thing is to get the software listed and install it all, don't get the latest version of anything.

The list is,
**For Windows:**

Download and install:

- msys - http://sourceforge.net/projects/mingw/f ... 1.0.11.exe
- Python - http://www.python.org/ftp/python/2.7/python-2.7.msi (any 2.7 release)
- arm-none-eabi/arm-elf toolchain (for example this one gcc-arm-embedded version 4.8 2014q3)

Run msys shell and set the path without standard Windows paths, so Windows programs such as 'find' won't interfere:

export PATH="/c//Python27:/c/ARMToolchain/bin:/usr/local/bin:/usr/bin:/bin"

At this point the cursor changed to a blinking triangle so I exited msys shell and then re started msys shell

Now, in "msys shell" run, "git clone https://github.com/damienmaguire/Stm32-vcu.git"

Then, "cd ~/Stm32-vcu"
followed by, "make get-deps"
then, make

you will find the hex and bin file in, C:\msys\1.0\home\<username>\Stm32-vcu
Attachments
output of screen using the instructions for cloning.docx
(24.6 KiB) Downloaded 58 times
User avatar
asavage
Posts: 328
Joined: Sat May 14, 2022 10:57 pm
Location: Oak Harbor, Washington, USA
Has thanked: 269 times
Been thanked: 103 times
Contact:

Re: Zombieverter .bin compile help - Codeblocks

Post by asavage »

Python 2.7 was EOL way back in 2020, and has been removed from most distributions; there's got to be an updated way to do this.
Al Savage
2014 RAV4 EV
NissanDiesel
royhen99
Posts: 195
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 14 times
Been thanked: 94 times

Re: Zombieverter .bin compile help - Codeblocks

Post by royhen99 »

There's no need to use Python 2.7 it works with the later versions. I am using 3.10.
Post Reply