BUILDING FROM SOURCE (ELI5)
I will share my stumbles before getting COMPILE FROM SOURCE working.
I had WinAVR-20100110 from some distant past installed on my PC, and I *hoped* it would generate identical code to the .hex and .eep in trunk
I was stumped when there was NO SOURCE that I could associate with my particular variant although I could find the .hex and .eep and a Make file within \trunk\mega328_T4_v2_st7565.
And I KEPT READING "just run the Makefile in Programmers Notepad" (=PN) that I finally realized COMES WITH WINAVR.
Even though I could see NO SOURCE CODE, I decided to try to RUN THE MAKEFILE to see if an error would enlighten me.
I launched PN. I opened the Makefile from \trunk\mega328_T4_v2_st7565 in PN. I clicked Tools/Make All.
Well it DID give me an error that was a clue. The error said there was NO ../setup.mk
So.... the Makefile wanted to FIND A FILE in a directory ABOVE where the Makefile lived! How would THAT HAPPEN?
And so it came to me that I NEEDED TO EXPAND THE WHOLE TRUNK on my disk instead of just fumbling around in the tarball looking for pieces that I thought were applicable. Now I think I understand how the whole system for variants is made to work. Simple really; silly of me to be looking for complexity! All sources are in \trunk directly, all Makefiles are in subdirectories.
I decided to expand it to a memory stick to avoid cluttering my main PC even more. After the WHOLE trunk tree was resident on the stick, I THEN opened (in PN) the Makefile that was within the directory for my variant:
I:\jays_lcr_t4\trunk\mega328_T4_v2_st7565\Makefile
Next (in PN) I ran Make All and got this familiar error:
0 [main] sh 9104 sync_with_child: child 15176(0x1E4) died before initialization with status code 0xC0000142
I say familiar since apparently many many people have had to find this msys-1.0.dll file and place it as directed:
I found solution.
Copy this file:
http://www.madwizard.org/download/electronics/msys-1.0-vista64.zipto utils\bin directory (WinAVR)
I BALKED at taking this random file, and pondered what to do....then I SEARCHED my C:\ drive and found LOTS of them already on my PC. So I chose what looked like a more recent one (2014!)
And I was about to copy THAT into the location When I saw there was one ALREADY THERE!
Drat! It was going to be so easy!
Now what? I fretted for a while…..then read so many people saying that it worked for them that I threw caution to the wind and RENAMED the existing file and went ahead and copied the rando different version in. And it helped, darn it!
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 5/18/2007 7:09 PM 724784 msys-1.0.dll <---- downloaded from madwizard
-a---- 1/19/2010 10:08 AM 781616 msys-1.0.dll.old
-a---- 1/19/2010 10:08 AM 781616 msys-1.0HIDING.dll
The Make All succeeded. I got 2 warnings:
../main.c:480:4: warning: #warning Capacity measurement from high to low not possible for diodes without PULLUP_DISABLE option!
../make_frequency.c:11: warning: 'wish_freq' may be used uninitialized in this function
Did I get IDENTICAL .hex and .eep to the ones in \trunk\mega328_T4_v2_st7565? WinMerge compare = NO darn it..
There IS a block of identical bytes, starting here
:100070009395E5B8C4B8B6EFB0937A00A5E0A09325
But before & after this block of 19 identical lines, all lines differ.
What about those warnings…..
…OR should I try to update WinAvr?
Lemme look! Well no info on warnings I could see. And a mass of entanglement trying to research if I was using exactly the same version of WinAVR/gcc/??? as was used in \trunk.
I decided to change the word "Bat." to "Jay." to prove my compile was taking effect.
Searched for "Bat_str" and found it here:
"I:\jays_lcr_t4\trunk\Battery_check.c"
"I:\jays_lcr_t4\trunk\Transistortester.h"
I went ahead and flashed the code, AND IT RAN! And it said my name!
I would like to know why my .hex is so different. It has to be my avr-gcc version, right?
I need to learn how to update. Should I uninstall-reinstall WinAVR?
Directory: I:\jays_lcr_t4\trunk\mega328_T4_v2_st7565
01/8/2021 11:02 PM 86450 mega328_T4_v2_st7565.hex
Directory of H:\My Equipment\LCR-T4_T3_.....\github\transistortester-trunk\trunk\mega328_T4_v2_st7565
05/13/2020 03:37 AM 83468 mega328_T4_v2_st7565.hex
Thanks again!