¿ªÔÆÌåÓý

Which branch to use to compile the same firmware as Erik is releasing?


 

On Fri, Dec 16, 2022 at 05:33 PM, Ho-Ro wrote:
Then I'll distribute the step-by-step instructions.
Erik,
Here we are, I documented the progress on my up-to-date GitHub fork and a fresh local clone.
/g/tinysa/files/Firmware_Programming/Rename_tinySA_V4.3_to_main.pdf
Martin


 

On Fri, Dec 16, 2022 at 12:00 AM, Lane Wilson wrote:

git clone?
cd tinySA
git checkout V4.3
git pull
git submodule update --init ¨Crecursive

?

Lane,

Good work!
One remark: with Erik's reorganisation / renaming V4.3 to main the "git checkout V4.3" isn't needed anymore, after the clone you're already on the right branch. So the section about "what is the right branch" is not necessary too.

I cannot judge the windows stuff, but as soon the "make" command works, you're done.

One last point is the tedious "How do I do a FW update?" discussion. I use dfu-util (also available from Erik):
If you rename it to dfu-util.exe and put it somewhere in your PATH, the "make flash" of the Makefile is your friend.?

Just use Zadig to make the device (in DFU mode) known to windows. (But as I wrote - DID I? :) - I do not use Windows).
Best thing would be to get a signed "driver", i.e. a *.inf" file for dfu-util.

Martin


 

Martin, to make sure I have this correct, the changes to my previous instructions are:
remove the line--> git checkout V4.3

remove the lines below for the temporary fix for wrong version number (do this once)
git tag -d v1.3
git tag -a -m v1.3 v1.3 12a96bb

I have tested the instructions locally here and it seems to build OK.
If this makes sense to you, I will re-port my modified instaructions.

Lane


 

Lane,

That's correct, but also these lines are not needed anymore:

The easiest way to find out where (and which branch) the latest code is??The development branch is currently "V4.3" since quite a long time, unfortunately Erik's default branch is still on "master". So, you should always look at:




Martin


 

Martin, here is the updated "Compiling from Windows 10" notes:
Please review to make sure it is accurate. Seems to work fine here.
Lane

The following is notes made by Lane and Martin, that describes how to compile the tinySA firmware under a Windows 10 environment. It also describes the software tools needed to perform the compile. This information was written updated on Dec. 22, 2022. (Updated for latest version v1.4)

Compiling from source code (using Git) on Windows 10

Using the Mingw64 Git Bash shell, in the drive folder you wish to hold the tinySA source code, do the following git / GitHub commands. This will create a new folder called: ¡°tinySA¡±. This provides an easy cold start:


git clone?

cd tinySA
git pull
git submodule update --init --recursive


To build tinySA firmware you can type:?
make


To build tinySA Ultra firmware you can type:
make TARGET=F303


This should produce the *.bin *.hex and *.elf in directory build. ARM GCC toolchain 11.x will work, you can also use 8.x and Erik's builds are still on 7.x, so it should work without an issue.

With every new version that Erik puts on GitHub you should do a new:


make clean???????????????????????????? (if you build original tinySA firmware)

? ?or

make TARGET=F303 clean?? (if you build tinySA ULTRA firmware)
git pull


and you can start again.

If you want to make your own changes etc. you should create a new branch with:


git checkout -b MyNewFeature


You will then be on your new branch.


Firmware Compile Tools Required

1.)??? ARM GNU Tools

2.)??? MinGW tools

Getting/Installing the ARM GNU Tools:

Go to click on Download to download the ARM GNU toolchain installer. As of Dec 15, 2022, recommend using the 11.3Rel1 installer. Newer versions may work as well.

Arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi.exe

Download the installer and run it installing the files into the default locations.

Getting/Installing MinGW tools:

There does not appear to be a single/simple method of installing the MinGW tools. The MinGW tools are required to provide the ¡°make¡± tool used to build the tinySA firmware. There are multiple sources and ways to do this. Download and then using the ¡°mingw-get-setup.exe¡± tool from SourceForge. It will then download the next level installer allowing you to download the parts of the MinGW package you need. ?This is just one method, MinGW is contained within other software development tool too.

Obtain WinGW Get Installer from SourceForge:

?

Run the mingw-get-setup.exe to get MinGW installer:

When running the MinGW installer, you only need the "minw32-base" package. Recommend that you install the MinGW files into a high-level folder on your PC such as: C:\MinGW

?

See various tutorials: (There are lots)

https://www.ics.uci.edu/~pattis/common/handouts/mingweclipse/mingw.html

https://www.youtube.com/watch?v=sXW2VLrQ3Bs&ab_channel=ProgrammingKnowledge2

https://www.geeksforgeeks.org/installing-mingw-tools-for-c-c-and-changing-environment-variable/

https://www.youtube.com/watch?v=Zcy981HhGw0&ab_channel=SemicolonDotDev

https://www.youtube.com/watch?v=dRxPUblx2SY&ab_channel=AnielMaharajh

?

Last step is to run the Windows Environment variable tool: Windows->Settings->Advanced System Settings->Environment Variables. Using this tool, you will need to add to the PATH environment variable, either user or System variables, the path that you used when you installed the MinGW tools. The example above shows the path as C:\MinGW

Run this command from the Mingw64 Git Bash shell:

Make --version

Ensure that it runs and displays the current version number of the make tool. If this does not work, then check the .bashrc file in your windows home folder (Typically look in C:\Users\<Your_Login_Name>) and make sure it contains this line:

alias make=mingw32-make.exe

?


 

Lane,
For me it looks fine, no objections. Your Windows build succeeded, so were done!
Martin