Closed loppylu closed 8 months ago
copyFlashAndReset
runs in RAM and is not allowed to use and other part of the code since that is overwritten. so Serial print just crashes
Hi again, And thanks for your quick reply.
Ok, I added those prints just for debugging, but before I added the Serial.print (not modified your code) I didn't hear that it reached the NVIC command to reset it either (normal USB sound when a new USB is connected). I believe the interrupts are removed as well, so blinking the LED is probably out of the question also for some sort of debugging.
I assume there is not difference between MKR boards on this specific matter since you've tested this on other MKR boards, so it should behave the same. I have run the same bin file with bossac, and that works fine.
Then I am guessing that there is something with the bin-file I am receiving, but I don't see any flaws to that either to be honest. That is more of a forum question I guess (so I can mark this is as closed), but do you see any reason why this would not work? I am happy to share my entire code if you want to have it as an example for NB 1500 later on.
Richard
Hi again, I will close this issue, since the issue was not related to your library. I finally got it working, the code I provided earlier was correct on both sides, the issue was the content of the HTTP request returned it as text and not octet-stream.
Thanks again for your help!
Hello, And thanks for your library :)
I am facing an issue when trying to flash my device. I am currently getting a bin file from a HTTP server (will be HTTPS in the future) and trying to add this the device. The content/bin is of 18317 bytes. Below you can see my code (sorry about the formatting, dunno why it didn't grab the whole thing as code). Everything works fine until I am erasing the flash on the device. It seems that is indeed erasing it (since the old program can not be run anymore after this when rebooting the device), but it won't continue to add the new content. Below is my "modified" Serial print of the copyFlashAndReset function.
I get to the 'eraseFlash(dest, length, pageSize);' function, but it won't continue after that. Do you have any thoughts on why?
Thanks again! Richard