Building without Atmel Studio

288 views
Skip to first unread message

TBAmax

unread,
Dec 9, 2021, 2:33:43 AM12/9/21
to cheali-charger
Hello is there a way to build without installing Atmel Studio 7 (now Microchip Studio)? This is a whole 1Gb in size and I am pretty sure this is all mostly useless stuff for what I am trying to do.
-I already have avr-gcc installed with the Arduino.
-Installed the make.exe with the WinAVR
-installed cmake
I am thinknking that I may be close,  but it still throws some error with the cmake. What I am missing?

TBAmax

unread,
Dec 9, 2021, 2:35:47 AM12/9/21
to cheali-charger
forgot to mention that it is building on Windows 10 that I was talking about.

TBAmax

unread,
Dec 9, 2021, 7:53:25 AM12/9/21
to cheali-charger
Ok, this is fail overall. Ended up installing Microchip Studio, but still no luck with building. Followed the instruction from the github "Building from source" section. It actually generates .hex .eep .bin files for the first target but then stucks with the notice:
'..' is not recognized as an internal or external command,

diggit

unread,
Dec 9, 2021, 11:56:15 AM12/9/21
to cheali-charger
Hi,
can you please share your steps and errors you got?
It's hard to tell, knowing only, that is "didn't work"...

I can help with CMake + gcc

TBAmax

unread,
Dec 9, 2021, 8:45:20 PM12/9/21
to cheali-charger
The steps that I took:
1.Cloned the cheali-charger from github to my local disk
2. Installed cmake ver.3.22.0
3.I installed Microchip Studio (formerly known as Atmel Studio)
4.Run Microchip Studio and from there: Tools-> "Command Prompt"
5.go to the cheali-charger directory and run bootstrap-avr.bat
    no errors at that point, only some warnings
6.then run "make"
    it builds about 5% (through the first target) then it is stuck.   
Copy of  the output messages:

C:\Teemo\GitHub\cheali-charger>cmake . -DCMAKE_TOOLCHAIN_FILE=avr-toolchain.cmake -Denable-short-names=1 -G "Unix Makefiles"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- windows detected: setting enable-short-names-default to ON
-- firmware file short names: 1
-- Could NOT find UnixCommands (missing: GZIP)
-- setting up cheali-charger MACROS.
-- cheali-charger-version: 2.01
-- cheali-charger-eeprom-calibration-version: 10
-- cheali-charger-eeprom-programdata-version: 3
-- cheali-charger-eeprom-settings-version: 12
-- cheali-charger-eeprom-version-string: e10.3.12
-- cheali-charger-buildnumber: 20211210
CMake Warning at CMakeLists.txt:36 (message):
  short names enabled!


-- target architecture: avr
-- target: ADCKeyboardAnalyzer-150W
-- cpu: atmega32
-- generic charger: adc_key_test
-- target: BalancePortAnalyzer-200W
-- cpu: atmega32
-- generic charger: 200W
-- target: Dual-Power-B6AC-80W-RC
-- cpu: atmega32
-- generic charger: 50W
-- target: imaxB6-clone
-- cpu: atmega32
-- generic charger: 50W
-- target: imaxB6-clone-50W-4.5A
-- cpu: atmega32
-- generic charger: 50W
-- target: Turnigy-A-6-10-200W
-- cpu: atmega32
-- generic charger: 200W
-- target: Bantam-BC6HP-250W
-- cpu: atmega32
-- generic charger: 200W
-- target: Turnigy-Accucel-8-150W-7A
-- cpu: atmega32
-- generic charger: 200W
-- target: GTPowerA6-10
-- cpu: atmega32
-- generic charger: 200W
-- target: imaxB6-original
-- cpu: atmega32
-- generic charger: 50W
-- target: imaxB6-original-chihying
-- cpu: atmega32
-- generic charger: 50W
-- target: Turnigy-Accucel-6-50W-5A
-- cpu: atmega32
-- generic charger: 50W
-- target: Turnigy-Accucel-6-50W-6A
-- cpu: atmega32
-- generic charger: 50W
-- target: Turnigy-MEGA-400Wx2
-- cpu: atmega32
-- generic charger: 200W
-- target: Turnigy-MEGA-200Wx2
-- cpu: atmega32
-- generic charger: 200W
-- target: Turnigy-MAX80W-7A
-- cpu: atmega32
-- generic charger: 50W
-- target: Turnigy-Mega-300W-8s
-- cpu: atmega32
-- generic charger: 200W
-- target: HobbyKing-ECO8-150W-7A-8S
-- cpu: atmega32
-- generic charger: 200W
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: C:/Teemo/GitHub/cheali-charger
C:\Teemo\GitHub\cheali-charger>make
Consolidate compiler generated dependencies of target ADCKeyboardAnalyzer-150W_atmega32
[  0%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/ChealiCharger2.cpp.obj
[  1%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/eeprom.cpp.obj
[  1%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/screens/ScreenBalancer.cpp.obj
[  1%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/screens/Screen.cpp.obj
[  1%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/screens/ScreenMethods.cpp.obj
[  1%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/screens/ScreenStartInfo.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/screens/ScreenCycle.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/screens/ScreenEditable.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/drivers/SerialLog.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/helper/AnalogInputsAnalyzer.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/helper/BalancePortAnalyzer.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/helper/LCDAnalyzer.cpp.obj
[  2%] Building CXX object src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.dir/__/__/__/__/core/helper/ADCKeyboardAnalyzer.cpp.obj
[  2%] Linking CXX executable ADCKeyboardAnalyzer-150W_atmega32
[  5%] Built target ADCKeyboardAnalyzer-150W_atmega32

'..' is not recognized as an internal or external command,
operable program or batch file.
src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size.dir/build.make:70: recipe for target 'src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size' failed
make[2]: *** [src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size] Error 1
CMakeFiles/Makefile2:480: recipe for target 'src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size.dir/all' failed
make[1]: *** [src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

TBAmax

unread,
Dec 27, 2021, 5:38:58 AM12/27/21
to cheali-charger
Seems that I am currently unable to get it to build on on my new machine. Still have the old machine where I am able to build it when I need to. Some research into the cmake, conclusion for me is that cmake is a way too much brain load for a sole enthusiast (considering need to have attention to some other things also). So looking for help converting the whole project to PlatformIO.
Otherwise the chargers that I have built, that are using cheali-charger, are working fine. Just simply the best charger that there is. Specially the user interface is just so good with that standard cheap display.

diggit

unread,
Dec 27, 2021, 12:04:11 PM12/27/21
to cheali-charger
Sorry, I missed your previous reply.
No Issue when building using cmake+make or cmake+ninja on my machine (Archlinux).
It's weird, that your log is missing part about detected toolchain.

(OMG, no monospaced fonts available in google groups)

cmake . -DCMAKE_TOOLCHAIN_FILE=avr-toolchain.cmake -Denable-short-names=1 -G "Unix Makefiles"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/avr-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/avr-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

-- firmware file short names: 1
-- Found UnixCommands: /usr/bin/bash  

-- setting up cheali-charger MACROS.
-- cheali-charger-version: 2.01
-- cheali-charger-eeprom-calibration-version: 10
-- cheali-charger-eeprom-programdata-version: 3
-- cheali-charger-eeprom-settings-version: 12
-- cheali-charger-eeprom-version-string: e10.3.12
-- cheali-charger-buildnumber: 20211227

CMake Warning at CMakeLists.txt:36 (message):
  short names enabled!

rest seems same

Can you share contents of these files?:
src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size.dir/build.make
src/hardware/atmega32/targets/ADCKeyboardAnalyzer-150W/CMakeFiles/ADCKeyboardAnalyzer-150W_atmega32.size

There are probably some broken paths.
btw, you can always use WSL...

diggit

unread,
Dec 27, 2021, 12:06:39 PM12/27/21
to cheali-charger
Looking into avr-toolchain.cmake, I suspect, you don't have your avr toolchain binaries in PATH.

TBAmax

unread,
Dec 28, 2021, 4:22:21 AM12/28/21
to cheali-charger
@diggit thanks for the feedback and tips. Yes I even installed WSL so this is now also somwhere in my computer. Not sure yet what this WSL thing is and what people use it for mainly, I get the impression it is a something like a mix of windows and linux and somehow having common shell but I am not quite sure. Anyway I did not go further into that to trying to build within WSL also, because I got fixated trying to use PlatformIO because I kind of been getting to like that IDE with other projects. I just was impressed how it worked out of the box 
 Current status is that I managed to add build capability with  PlatformIO to the project. It was quite a puzzle to get through the cmake add directory magic, but I think I got it. Currently only one environment works (imax-original) but from there it is easy to add others. Then it is convinient to change the target just from the menu, do not need to build all. Also upload and even debug directly from the IDE capability can be added now. So then it will be more like Arduino, just install vscode and PlatformIO and ready to go building and uploading.

diggit

unread,
Dec 28, 2021, 6:52:14 AM12/28/21
to cheali-charger
Hi,
CMake, Meson and similar build systems, not bound to IDE or some custom ecosystem, are easy to use in continuous integration (CI) and so on. Not sure about PlatformIO options...
I am not big fan of Arduino nor PlatformIO, but if that makes you development easier, go for it.
VS Code itself is great and powerful tool. (and works well with CMake)
AFAIK small AVRs like Mega32 do not have debug interface accessible so no debugging anyway...
Reply all
Reply to author
Forward
0 new messages