Using the sam-ba.dll to create a custom flasher tool

Discussion around product based on ARM Cortex M4 core.
This forum will be discontinued soon.

Moderators: nferre, ncollot

hraftery
Posts: 5
Joined: Wed Nov 23, 2016 11:10 pm

Using the sam-ba.dll to create a custom flasher tool

Thu Nov 24, 2016 5:47 am

I'm looking for a way to ease production of our custom SAM4E16E based design. Having to have a full Atmel Studio install and a programmer in production is not nice, so SAM-BA looks like it could be the way to go.

Unfortunately the GUI is still too complicated and has to be configured just right. Writing a small interface around the dll would be ideal.

I think I've just wasted another day on this to no avail. Has anyone had any success with sam-ba.dll?

Whether I use the example project or create my own, the call to AT91Boot_Scan() triggers a breakpoint and throws an unhandled exception. In debug mode I can force it to continue, and the next call to open appears to succeed, however this can't be done when the exe is running outside the debugger, as it will in production. If I skip the call to AT91Boot_Scan() and go straight to AT91Boot_Open(), it always returns a NULL handle, despite passing the same parameters.

It doesn't provide much confidence when the example project fails to build right out of the box because a variable had not been declared.

FWIW, I'm using Visual Studio 2015 Community Edition on Windows 10.
hraftery
Posts: 5
Joined: Wed Nov 23, 2016 11:10 pm

Re: Using the sam-ba.dll to create a custom flasher tool

Mon Nov 28, 2016 11:23 pm

For posterity, the solution I came up with after hours of beating my head against the Atmel tools, was to wrap the sam-ba.exe command line program. First I had to install a configuration in the tcl_lib folder, create a tcl script, and then call the exe with a port, the configuration name, and the script name. Works pretty well in the end, despite the horribly clumsy solution behind the scenes.

Would be great if there was an applet that rebooted the MCU. That bit has to be done manually, but the rest is pretty automated.

Return to “SAM4 Cortex-M4 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest