Convert SAM-BA scripts

Last modified by Microchip on 2025/02/28 12:36

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.7
Copyright 2022 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 VERSION3.2.Y3.5.Y3.7.Y
HEADERSimport 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 CHANGESSAM-BA 3.1.XSAM-BA 3.2.Y/3.5.Y/3.7.YCOMMENTS
AppletLoader {}neededremovedRemoved 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 callappletInitialize()initializeApplet() 
applet erase/write functionsappletErase()
appletWrite()
applet.erase()
applet.write()
 
applet Boot Config manipulationappletWriteBootCfg()
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.

Related Topics

Boards

Sama5d27Som1EK
Sama5d2PtcEK
Sama5d2Xplained
Sama5d3xek
Sama5d3Xplained
Sama5d4Xplained
Sama5d4ek
 

Components

SAM-BA

Summary

SAM-BA API revisions