Skip to content

Building bootloader for MKR GSM 1400 and MKR NB 1500  #571

@ksmith3036

Description

@ksmith3036

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:

  1. The bootloader files supplied by Arduino, are they compiled for both serial and USB, or only USB?
  2. The bootloader files supplied by Arduino, are they compiled with DEBUG or not?
  3. If compiled for both serial and USB and without debug, why is my resulting files som much smaller than the prebuilt files supplied from Arduino?
  4. Is the small 6544 bytes long file OK, so that I safely could flash it using a modified SAMD_BootloaderUpdater library?

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.
MKRNB1500byArduino
MKRNB1500byMe

I attached the build logs, since you then can verifiy that the correct options and toolset has been used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions