ebs-universe / pysamloader

Python library for writing flash on Atmel's ARM chips via SAM-BA.
https://pysamloader.readthedocs.io/en/latest/
GNU General Public License v3.0
1 stars 3 forks source link

add support for SAMD21 #1

Open mattvenn opened 4 years ago

mattvenn commented 4 years ago

I would happily send you some hardware if you could add SAMD21G support. I took a look at the existing parts and I think they are using different types of memory handling.

At least in the BOSSA definitions: https://github.com/shumatech/BOSSA/blob/ae2c04d9bfa51f033e9220242b413d493c011b48/src/Device.cpp

The SAMD21 uses D2xNvmFlash while the AT91 uses EfcFlash.

Cheers, Matt

chintal commented 4 years ago

@mattvenn I'll have to take a look at D2XNVM Flash, though most likely it will take access to hardware to be able to implement something, with no guarantee that it would be possible.

The current codebase is centered around the EFC, which has SAM-BA attached behavior that is not exactly the same as a naive reading of the datasheet would indicate. What D2XNVM's behavior is will need to be tested.

Atmel's standard software and their recommendations to users involve using SAM-BA to install a shim to device RAM, which then can flash the device. I haven't really spent any time looking at the shims themselves, but that might be a direction you could look in.

I am curious why you need pysamloader, though. This is piece of software that's somewhat old and hasn't quite had very much traction, to the extent that for the past few years I've only really been performing maintenance on it when I need it for something.

mattvenn commented 4 years ago

Hi, thanks for the reply. We're working on a product with a SAM-BA bootloader (based very closely on the Arduino Zero bootloader). We have assembly line tools based on Python and one thing I want to implement is a final firmware update at the end of the line. I'll thought I'd either package bossac with the tool or use a Python library. Would be nice to have it all Python and OS independent. Yours was the closest I found.

If you think it could be difficult then I'll just go with the bossac option.

Cheers, Matt

On Fri, 13 Sep 2019 at 08:49, Chintalagiri Shashank < notifications@github.com> wrote:

@mattvenn https://github.com/mattvenn I'll have to take a look at D2XNVM Flash, though most likely it will take access to hardware to be able to implement something, with no guarantee that it would be possible.

The current codebase is centered around the EFC, which has SAM-BA attached behavior that is not exactly the same as a naive reading of the datasheet would indicate. What D2XNVM's behavior is will need to be tested.

Atmel's standard software and their recommendations to users involve using SAM-BA to install a shim to device RAM, which then can flash the device. I haven't really spent any time looking at the shims themselves, but that might be a direction you could look in.

I am curious why you need pysamloader, though. This is piece of software that's somewhat old and hasn't quite had very much traction, to the extent that for the past few years I've only really been performing maintenance on it when I need it for something.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ebs-universe/pysamloader/issues/1?email_source=notifications&email_token=AAE223AKSPXJKUCZ5JBJDJLQJMZYZA5CNFSM4IWB5AN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6UEDFA#issuecomment-531120532, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE223BELNW2Y4IMKW5KIN3QJMZYZANCNFSM4IWB5ANQ .

-- Matthew Venn web mattvenn.net twitter @matthewvenn https://twitter.com/matthewvenn

chintal commented 4 years ago

@mattvenn I did take a look at the D21. My suspicion is that D2XNVM will be a smaller concern than the fact that the D21 doesn't ship with SAM-BA programmed onto the flash. You're going to need a regular programmer to write SAM-BA in to each chip anyway.

Additionally, the current approach I use with EFC is to write word-by-word, which is incredibly slow. It's fine for the occasional field upgrade type thing with patient customers (more patient than I would be if I had paid good money for something :P ) or for low intensity development, but I'm not sure that approach would work on an assembly line. For reference, my burn cycle for the SAM3U4E for ~50K flash is about 7 minutes long (IIRC). I have no reason to believe D2XNVM will not have the same limitation, or, to be fair, that it does have the same limitation.

Bossac looks like it does what you want it to do. It has a good support list and claims cross platform support. I'd probably go with it instead, and if bossac existed (or if I had found it, if it did) in 2011, I probably would never have written pysamloader. I have never used Bossac, though, and to be honest haven't even seen it before now, so I can't actually recommend it either way.

That said, I have ordered a D21 (Arduino Zero clone, I think, I'm not sure) in any case. It'll likely come in a month or so and when it does I'll give it a go. Can't make any promises though, especially about having the time to get to it in a timely manner.

mattvenn commented 4 years ago

OK, thanks for your help and comments. I will go with bossac. Good luck with the Zero anyway, I'll keep an eye on the repo to see how you get on! Cheers, Matt

On Mon, 16 Sep 2019 at 16:25, Chintalagiri Shashank < notifications@github.com> wrote:

@mattvenn https://github.com/mattvenn I did take a look at the D21. My suspicion is that D2XNVM will be a smaller concern than the fact that the D21 doesn't ship with SAM-BA programmed onto the flash. You're going to need a regular programmer to write SAM-BA in to each chip anyway.

Additionally, the current approach I use with EFC is to write word-by-word, which is incredibly slow. It's fine for the occasional field upgrade type thing with patient customers (more patient than I would be if I had paid good money for something :P ) or for low intensity development, but I'm not sure that approach would work on an assembly line. For reference, by burn cycle for the SAM3U4E for ~50K flash is about 7 minutes long (IIRC). I have no reason to believe D2XNVM will not have the same limitation, or, to be fair, that it does have the same limitation.

Bossac looks like it does what you want it to do. It has a good support list and claims cross platform support. I'd probably go with it instead, and if bossac existed (or if I had found it, if it did) in 2011, I probably would never have written pysamloader.

That said, I have ordered a D21 (Arduino Zero clone, I think, I'm not sure) in any case. It'll likely come in a month or so and when it does I'll give it a go. Can't make any promises though, especially about having the time to get to it in a timely manner.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ebs-universe/pysamloader/issues/1?email_source=notifications&email_token=AAE223DD6P7QPR4GAQGVWBLQJ6JPDA5CNFSM4IWB5AN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6ZKMHI#issuecomment-531801629, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE223FX2ZQI5QI3SQVWEFDQJ6JPDANCNFSM4IWB5ANQ .

-- Matthew Venn web mattvenn.net twitter @matthewvenn https://twitter.com/matthewvenn