adafruit / ArduinoCore-samd

114 stars 116 forks source link

Bootloader for ATSAME54N20 #33

Closed freemovers closed 6 years ago

freemovers commented 6 years ago

I'm working on a custom board where I like to Arduino to create the programs. I customized BOSSAC already to accept the SAME54, and I am able to upload sketches through Arduino using the METRO_M4_sam_ba.hex for the bootloader. I like to compile a custom bootloader for the ATSAME54N20, but have difficulties compiling the source with MSYS. I always get the following error, even after adding the board ID:

_Compiling bootloader using BASE PATH = C:\Users\AppData\Local/Arduino15/packages/arduino GCC PATH = C:\Users\AppData\Local/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi- board id = METRO_M4 Compiling board_driver_led.c to build/board_driver_led.o "C:\Users\AppData\Local/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gcc" -mthumb -mcpu=cortex-m4 -c -std=gnu99 -MD -MP -MF "build/board_driver_led.d" -MT"build/board_driver_led.d" -MT"build/board_driver_led.o" -ffunction-sections -fdata-sections -nostdlib -nostartfiles --param max-inline-insns-single=500 -Os -DDEBUG=0 -D -DBOARD_ID_METRO_M4 -I"C:\Users\AppData\Local/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" -I"C:\Users\AppData\Local/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/" board_driver_led.c -o build/board_driver_led.o

:0:1: error: macro names must be identifiers In file included from board_driver_led.h:24:0, from board_driver_led.c:20: board_definitions.h:25:4: error: #error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h #error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h ^ board_driver_led.c:22:1: error: unknown type name 'uint8_t' volatile uint8_t ledKeepValue = 0; ^ board_driver_led.c:23:1: error: unknown type name 'uint8_t' volatile uint8_t ledTargetValue = 20; ^ board_driver_led.c:24:1: error: unknown type name 'int8_t' volatile int8_t ledDirection = 1; ^ make: *** [build/board_driver_led.o] Error 1_ I have no issue compiling the "zero" bootloaders.
freemovers commented 6 years ago

I added back the board ID and board chip in the makefile, and it seems to work now.

# Boards definitions
BOARD_ID?=METRO_M4
BOARD_CHIP?=__SAMD51J19A___

Are you usually adding these through the command line?

deanm1278 commented 6 years ago

Hi yes those are usually added through the command line. Unfortunately this bootloader was just used for testing purposes before our uf2 bootloader was finished and has been removed in the master branch. You are welcome to continue using it, but it is completely unsupported :)

On Tue, Apr 3, 2018 at 11:15 PM Sander van de Bor notifications@github.com wrote:

I added back the board ID and board chip in the makefile, and it seems to work now.

# Boards definitions BOARD_ID?=METRO_M4 BOARD_CHIP?=SAMD51J19A

Are you usually adding these through the command line?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/ArduinoCore-samd/issues/33#issuecomment-378467155, or mute the thread https://github.com/notifications/unsubscribe-auth/AGA5un3oRbd_5xY7MtmCz6ikDWEMD6Xqks5tlDqygaJpZM4TGCqU .

freemovers commented 6 years ago

Thank your for the quick response. I think I got it, I was even able to compile for the ATSAME54N20 after adding some lines to the CMSIS files. I will look into the UF2 bootloaders as well, haven't used those yet, but looks promising to make it even more user friendly.

deanm1278 commented 6 years ago

here's our uf2 repo: https://github.com/adafruit/uf2-samd21

ladyada commented 6 years ago

i second recommend UF2, its bossa compatible but has drag n drop and webUSB support (in the future), its what we're using going forward for SAMD chips

freemovers commented 6 years ago

I’m looking into the UF2 right now, try to find out what will be involved to get it going for the ATSAME54N20. It looks pretty simple compared to the SAMBA bootloader, but I might miss something here J. I will just download, make some changes, and compile.

From: ladyada [mailto:notifications@github.com] Sent: Wednesday, April 4, 2018 7:44 AM To: adafruit/ArduinoCore-samd ArduinoCore-samd@noreply.github.com Cc: Sander van de Bor sander@freemovers.eu; Author author@noreply.github.com Subject: Re: [adafruit/ArduinoCore-samd] Bootloader for ATSAME54N20 (#33)

i second recommend UF2, its bossa compatible but has drag n drop and webUSB support (in the future), its what we're using going forward for SAMD chips

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/ArduinoCore-samd/issues/33#issuecomment-378625329 , or mute the thread https://github.com/notifications/unsubscribe-auth/AgsqXb9UW6AJ0ZtmGbq0-NZpANfmWKmfks5tlNw5gaJpZM4TGCqU . https://github.com/notifications/beacon/AgsqXTJ1DUB93_a8kOktJpHNHOC8bPOUks5tlNw5gaJpZM4TGCqU.gif