-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better documentation of bootloader firmware building process #8
Comments
A few things are nice to have as well.
|
Can you help? Being a seasoned perl programmer, I do not know what hurdles there are for someone without perl experience or a perl installation. You managed. What did you have to do? @mcuee
Absolutely not recommended. I only mentioned to you as a highly competent engineer and only for a quick fix to get you to compile one particular bootloader. In reality there are so many pitfalls when using this route, eg, how to compute START and JMPWP, both of which |
I see. So the recommendation is to use Windows is probably the more challenging part if I want to use MSYS2 as it lacks the necessary |
Only useful if there is the avr-gcc toolchain. urboot.c only compiles with that specific compiler. Best experience is with 4.8.1 and 5.4.0, |
Yes MSYS2 has avr-gcc toolchain. I can also try out Atmel provided avr-gcc toolchain with standalone perl installation without MSYS2 (but I tend to use MSYS2 a lot under Windows). |
Here is an example of using avr-gcc from MSYS2.
|
For
So it seems to me the newer toolchain is pretty much the same in terms of code generration (code size).
|
One file is not enough to judge. Try
This shows you where the two toolchains differ in generated code size |
Please do |
I need to use the following command to use Atmel avr-gcc toolchain in the Path.
Here is the comparison with Atmel provided Linux toolchain, gcc 7.3 version.
|
Easier to read version. So yes I agree that the old version creates same or smaller codes in general.
|
The following perl modules are required by
Ubuntu 20.04 (tested to be good) -- hexls and urboot-gcc work out of the box as perl and necessary perl-modules have been installed. I do not see File::HomeDir listed but it still works. macOS (to test) : install File::HomeDir using sudo if you are using system provided perl. It should also work if you use other perl version. Windows (to test): install Strawberry Perl and you are all set. You can also use other Perl installations. I will carry out test under macOS and Windows later. |
BTW, I am not able to get File::HomeDir installed under MSYS2.
|
Hack to get things working under Windows with Strawberry Perl and Atmel 7.3.0 toolchain.
Results:
|
I managed to find a few Atmel toolchain for Windows. Here is the comparison. I need to process the data better in a better format.
|
Maybe the other MSYS2 installation needs some updates. I tried another Windows machine and it works fine to install File::HomeDir. But then it does not work. Therefore I think I will have to rely on Strawberry Perl together with MSYS2 for now.
|
Under macOS, other than installing Since I have only the 9.4.0 toolchain, minor change to the Makefile is required. Similar modification can be done for Arduino toolchain 7.3.0.
9.4.0 will be worse than stock urboot (4.8.1 or 5.4.0) but it is actually better than Arduino 7.3.0 version.
|
It seems to me there is nothing much to improve on the build process under Linux as it is working out of the box. As for macOS. You just need to document that perl modules Better documentation of urboot-gcc and hexls will still be good. For Windows, unfortunately MSYS2 perl packaging is not good. We can forget about Windows support for a while. Windows users can refer to this post to build if they really want to do that (using Strawberry Perl and then modify the few files accordingly). |
@mcuee Many thanks for exploring how to use the project under Windows and MacOS, and for sharing tips for better documentation! Well appreciated. I have updated The comparison table stock urboot/9.4.0/7.3.0 is great! I suspect you mixed the columns for urboot and 9.4.0, though? I believe the stock Note that the |
Great, now that
Edit: Copy the file I do not want to change the urboot Linux toolchain so I named the Windows 5.4.0 toolchain as version
|
Yes, you are right, urboot is always the best. Table updated |
I can not find version 4.8.1 but Atmel provided 7.3.0 and 5.4.0 for Linux, Windows and macOS. Now I need to figure out how to get Atmel avr-gcc compiler to work under macOS (due to all the developer signing issues). https://www.microchip.com/en-us/tools-resources/develop/microchip-studio/gcc-compilers |
I think this issue can be closed. I will report the macOS 5.4.0 situation later. |
This is the current problem with the Atmel toolchain avr-gcc 5.4.0. I will see how to fix it.
|
Work-around is to unlock the file. |
Results from Atmel 5.4.0 toolchain under macOS -- it may produce some bigger size urboot hex files but the space occupied is the same in the end. I also checked and the size produced by Atmel 5.4.0 toolchain under Windows produce the same binaries. I also attached Atmel 7.3.0 build but I understand it is not supported.
|
In summary, I think there is nothing to be changed on your side. In case users want to build under Windows or macOS, they can refer to my experiences here. I am happy to help as well if other users encountered problems under macOS or Windows. |
@mcuee Thank you for all your hard work exploring ways to improve the urboot building process. When I get a minute I will put the results of your exploration into a "how-to-build" page; your work will be used to good effect. |
It is good to have some documentation for the users to build their own firmware.
The comments here are a good start.
urboot-gcc
2. Using avr-gcc directlyThe text was updated successfully, but these errors were encountered: