-
-
Notifications
You must be signed in to change notification settings - Fork 725
Building bootloader for MKR GSM 1400 and MKR NB 1500 #571
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
Comments
Hi @ksmith3036 , |
Thank you for your answer. I want to compile the same way as the supplied bootloaders is built. I just testet different ways, to try to get a bootloader with about the same size, to see if it looked allrigt, since flashing a non-working bootloader bricks the Arduino. In effect, what I do is to build the MKR GSM 1400 and NB 1500 bootloaders exactly the same way as the script does it.
Here are the dates and file sizes of the prebuilt files that come with the SAMD board support downloaded through Android IDE:
Since the file sizes of my build, using the toolset that come together with the SAMD board support download, is about 1,5 KBytes smaller, I guess something has changed. I see the Makefile was changed in october 2019, while the prebuilt bootloaders is built in september 2019: Maybe the bootloaders was built using the 4.8.3-2014q1 toolchain? |
Very likely it has been built with the old toolchain since we don't update them if really necessary. About the size it could be due to |
OK, I downloaded the package for the toolchain 4.8.3-2014q1 and downloaded CoreArduino-samd tag 1.6.21 sources. Now it builds without errors and the file size is nearly the same. Just 8 bytes diff! :-) Not that I would like to build based on old sources, but since I haven't got the SWD programmer, I just wanted to be sure. Good to hear that the new toolchain should work. 1,5 KByte less size for a 8KByte originally is very significant! Keep up the good work! One suggestion for improvement, when packaging the Arduino SAMD Boards (32-bits ARM Cortex-M0+) packages for download, is to document what source code level the prebuilt bootloaders have, because it seems that the prebuilt bootloaders is older than rest of the package. Thank you! |
I ended up building modified bootloaders, based on toolchain 4.8.3-2014q1 and CoreArduino-samd tag 1.6.21 sources. And worked great! |
I have built the bootloaders from this repo, with source code current as of now.
Have been using make of Cygwin and also tried using Atmel/Microchip Studio. I guess there is no differencem since both really uses the toolset that come with the Arduino support for the SAMD21 boards.
The Arduino Zero builds fine, but the MKR GSM 1400 and MKR NB 1500 fails when compiled with DEBUG enabled or the end bootloader files is about 1 KByte smaller than the files installed by Arduino studio.
This build fails:
$ make DEBUG=1 SAM_BA_INTERFACES=SAM_BA_BOTH_INTERFACES BOARD_ID=arduino_mkrnb1500 NAME=samd21_sam_ba_arduino_mkrnb1500 clean all
Error: arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 1156 bytes
Build error MKR NB 1500.txt
This build works:
$ make DEBUG=1 SAM_BA_INTERFACES=SAM_BA_USBCDC_ONLY BOARD_ID=arduino_mkrnb1500 N00 NAME=samd21_sam_ba_arduino_mkrnb1500 clean all
The built file, samd21_sam_ba_arduino_mkrnb1500.bin is 8164 bytes, almost matching the bootloader supplied by Arduino: C:\Users\kaypro\AppData\Local\arduino15\packages\arduino\hardware\samd\1.8.9\bootloaders\mkrnb1500\samd21_sam_ba_arduino_mkrnb1500.bin of 7980 bytes size.
Build only CDC with debug MKR NB1500.txt
If bulding without debug, I can build for both USB and serial:
$ make SAM_BA_INTERFACES=SAM_BA_BOTH_INTERFACES BOARD_ID=arduino_mkrnb1500 NAME =samd21_sam_ba_arduino_mkrnb1500 clean all
Build no debug - both serial and USB - MKR NB 1500.txt
But it is quite suspicious that the resulting samd21_sam_ba_arduino_mkrnb1500.bin is only 6544 bytes long, as the prebuilt Arduino supplied file is 7980 bytes long.
Exactly the same goes for the MKR GSM 1400 build, since I guess only the VID and PIDS is changed from the NB 1500 board.
So my questions are these:
When opening the prebuilt bootloader files and the bootlader files I built without DEBUG in an hex editor, I see that the structure is quite different. Look at the dumps of the hex editor, showing a very different placement of the versions trings and text information.


So both the size and structure of the file is suspicious.
I attached the build logs, since you then can verifiy that the correct options and toolset has been used.
The text was updated successfully, but these errors were encountered: