Convert SAM-BA scripts
This page can help you convert your SAM-BA script from one revision of SAM-BA to the other. We made some little changes to the SAM-BA API and SAM-BA QML Scripts as slightly different.
SAM-BA tool revision
You can verify the revision of your SAM-BA tool by running the following command:
sam-ba -v
SAM-BA Command Line Tool v3.8
Copyright 2024 Microchip Technology
SAM-BA module revisions
At the beginning of your script, you have some lines which state the revision of each module that are used by the QML script. These are the
import
lines that give the revision number of the modules that shall be used in the core of the script. So, while moving to a more recent revision of SAM-BA, make sure to update these numbers accordingly.
|
|
SAM-BA version |
3.2.y |
3.5.y |
3.7.y |
Headers |
import SAMBA 3.2 import SAMBA.Connection.Serial 3.2 import SAMA5D2 3.2 |
import SAMBA 3.5 import SAMBA.Connection.Serial 3.5 import SAMA5D2 3.5 |
import SAMBA 3.7 import SAMBA.Connection.Serial 3.7 import SAMA5D2 3.7 |
|
|
|
SAM-BA QML conversion table
|
|
SAM-BA API changes |
SAM-BA 3.1.x |
SAM-BA 3.2.y/3.5.y/3.7.y |
Comments |
AppletLoader {} |
needed |
removed |
Removed AppletLoader object. Connection object can now be used directly when working with applets. |
device example |
device: SAMA5D2 {
board: "sama5d2-xplained"
} |
device: SAMA5D2Xplained {
} |
Board selection is not done using a board property on the device anymore. Instead, the boards are defined using inheritance: for example, the SAMA5D2Xplained QML object inherits from SAMA5D2 QML object. |
applet initialization call |
appletInitialize() |
initializeApplet() |
|
applet erase/write functions |
appletErase() appletWrite() |
applet.erase() applet.write() |
|
applet Boot Config manipulation |
appletWriteBootCfg() appletReadBootCfg() |
applet.writeBootCfg() applet.readBootCfg() |
|
|
|
|
Example QML script for SAM-BA 3.2.y
The demo archive for Linux4SAM 5.6 onwards support newer revision of SAM-BA. But if you want to run an older demo package with SAM-BA 3.2.y you can take example on this script for
Linux4SAM 5.5 converted to SAM-BA 3.2.y revision.