Open agdl opened 5 years ago
Let me preface this with I have no idea what I'm actually doing, I'm just reading the code that I've been able to find and seeing what happens from there.
I ran into this issue today and since there hasn't been any movement on this, I thought I'd look and see if I could figure it out. I got a lot farther than I expected, but this is what I have worked out on my own so far:
SDU.cpp
includes a header file for each type of board, which is where we get the error that the board we want isn't supportedextras/SDUBoot/
, it looks like there is a script to compile said header files for each board typeextras/SDUBoot/build.sh
I added buildSDUBootSketch "arduino:samd:nano_33_iot" "$OUTPUT_PATH/nano33iot.h"
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
#include "nano33iot.h"
SDU.cpp:48:1: error: too many initializers for 'unsigned char [16384]'
};
^
On closer investigation, it looks like it is failing because the compiled output is larger than the array I'm trying to squeeze it into; trying to fit some 16,847 elements into a 16,384 long array. I'm fairly sure that bad things™ would happen if I try to make that array larger; I'm playing with fire already, given that I honestly don't know what I'm doing here.
Does anyone have any suggestions on how to trim down the size of the compiled output? It looks like the files resulted from the modified script are significantly larger than the existing files. Or better yet, how to do this correctly : )
I believe I've found a solution that works with the IDE 1.8.13 and samd core 1.8.11, I haven't tested it with an sd card yet but it runs and after various attempts and having to force the board back into bootloader it seems to run fine to a test sketch. Need to modify SDU.cpp in the samd core folder here Here's my folder as an example /home/pi/Desktop/pi/.arduino15/packages/arduino/hardware/samd/1.8.11/libraries/SDU/src/boot
From unsigned char sduBoot[0x4000] = { To unsigned char sduBoot[0x6000] = {
And add this towards the end before the last else statement
And then in the IDE export compiled binary this program for your board, in my case the nano 33 iot
https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/SDU/extras/SDUBoot/SDUBoot.ino
After that you need to run the following in the SDU sketch folder, and past the new file into the boot folder of the samd core for example mine is here
/home/pi/Desktop/pi/.arduino15/packages/arduino/hardware/samd/1.8.11/libraries/SDU/src/boot
(I renamed the bin without bootloader to make this line easier during testing"
cat "SDU.bin" | xxd -i > nano_33_iot.h
Then when you goto your sketch all you need to do is the same include sdu and it seems to be working
If anyone is having this same issue I can do a pull request but otherwise not
Has there been any resolution to this issue? I have tried what you advised above, but the Arduino hangs during bootloader phase.
Has there been any resolution to this issue? I have tried what you advised above, but the Arduino hangs during bootloader phase.
I haven't been following the past few months but my boards using modifications I posted about above have been solidly working for a long while now, I'll link to my version of the repo here You should be able to pretty much replace this folder in your samd core libraries folder to be able to make it work but I haven't tested. Also not sure if it makes a difference but I'm using Linux
Thank you for the quick response! I added a bash shell to windows so I was able to use your commands from ubuntu. So far, the program downloads the file and stores it to the SD, but the board never boots with the UPDATE.BIN... it just hangs after the NVIC reset. I think I have an issue with the bootloader. Am I supposed to be using the binary file with or without the bootloader?
I'll take a look at your repo and let you know if I am able to resolve.
I believe it's without the bootloader, and also make sure the program you are using to download to SD has the SDU library included and then every subsequent binary needs to have that library included in the program so it can continue to have that update from SD feature
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Joe G. @.> Sent: Tuesday, March 22, 2022 10:05:31 AM To: arduino/ArduinoCore-samd @.> Cc: winner10920 @.>; Comment @.> Subject: Re: [arduino/ArduinoCore-samd] ADD NANO 33 IoT Support to SDU (#465)
Thank you for the quick response! I added a bash shell to windows so I was able to use your commands from ubuntu. So far, the program downloads the file and stores it to the SD, but the board never boots with the UPDATE.BIN... it just hangs after the NVIC reset. I think I have an issue with the bootloader. Am I supposed to be using the binary file with or without the bootloader?
I'll take a look at your repo and let you know if I am able to resolve.
— Reply to this email directly, view it on GitHubhttps://github.com/arduino/ArduinoCore-samd/issues/465#issuecomment-1075223238, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARVDXTTZCC5CFJKWPAWGLKDVBHHSXANCNFSM4JEQG5VA. You are receiving this because you commented.Message ID: @.***>
I believe it's without the bootloader, and also make sure the program you are using to download to SD has the SDU library included and then every subsequent binary needs to have that library included in the program so it can continue to have that update from SD feature Get Outlook for Androidhttps://aka.ms/AAb9ysg …
Thank you! I was able to get it to work. It was the one without the bootloader. The issue was that the file on my server did not have the SDU.h library included. Once I added the file, it started right up.
No problem 👍 glad you got it working
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Joe G. @.> Sent: Tuesday, March 22, 2022 10:31:47 AM To: arduino/ArduinoCore-samd @.> Cc: winner10920 @.>; Comment @.> Subject: Re: [arduino/ArduinoCore-samd] ADD NANO 33 IoT Support to SDU (#465)
I believe it's without the bootloader, and also make sure the program you are using to download to SD has the SDU library included and then every subsequent binary needs to have that library included in the program so it can continue to have that update from SD feature Get Outlook for Androidhttps://aka.ms/AAb9ysg … ____ From: Joe G. @.> Sent: Tuesday, March 22, 2022 10:05:31 AM To: arduino/ArduinoCore-samd @.> Cc: winner10920 @.>; Comment @.> Subject: Re: [arduino/ArduinoCore-samd] ADD NANO 33 IoT Support to SDU (#465https://github.com/arduino/ArduinoCore-samd/issues/465) Thank you for the quick response! I added a bash shell to windows so I was able to use your commands from ubuntu. So far, the program downloads the file and stores it to the SD, but the board never boots with the UPDATE.BIN... it just hangs after the NVIC reset. I think I have an issue with the bootloader. Am I supposed to be using the binary file with or without the bootloader? I'll take a look at your repo and let you know if I am able to resolve. — Reply to this email directly, view it on GitHub<#465 (comment)https://github.com/arduino/ArduinoCore-samd/issues/465#issuecomment-1075223238>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARVDXTTZCC5CFJKWPAWGLKDVBHHSXANCNFSM4JEQG5VA. You are receiving this because you commented.Message ID: @.***>
Thank you! I was able to get it to work. It was the one without the bootloader. The issue was that the file on my server did not have the SDU.h library included. Once I added the file, it started right up.
— Reply to this email directly, view it on GitHubhttps://github.com/arduino/ArduinoCore-samd/issues/465#issuecomment-1075257665, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARVDXTSQGZ63Z6FVSEKWT7LVBHKVHANCNFSM4JEQG5VA. You are receiving this because you commented.Message ID: @.***>
Otherwise you get unsupported board https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/SDU/src/SDU.cpp#L44