Gemalto is now part of the Thales Group, find out more.

You are here

Python script to load files into module's FFS over AT command interface

Tutorial, March 12, 2014 - 3:02pm, 4773 views

On EHSx module's family AT^SJDL command can be used to download files into the module's FFS via RS232 or USB interfaces. The advantage of this solution is that it is in general OS independent. Check attached file. This example shows how to download files to the module over AT command interface with Python script. works on Windows (tested with Windows 7 64bit) and Linux (Ubuntu 12.04). It opens com interface, reads module's SW version, invokes AT^SJDL to download the file and calculates CRC code to verify if transfered file is complete. 


  • installed Python 2.7.x (tested with Python 2.7.5 on Windows and Python 2.7.3 on Ubuntu)
  • installed pySerial library (tested with 2.7 on Windows and 2.5 on Ubuntu)
  • rights to access serial devices

Usage examples:

  • print help: -h for help
  • download on Windows: -p COM1 -b 115200 LocalFile.txt RemoteFile.txt
  • download on Linux: -p /dev/ttyACM0 -b 115200 LocalFile.txt RemoteFile.txt


  • on Linux remember to set chmod +x before running the script
Alopez's picture


Great!!! that way is that I was looking for!!!




Somewhere over the rainbow!!! Looking for the Oz Land!!!

relihanl's picture


I have an EGS5+X with revision 02.004, a-revision 03.000.20.

Unfortunately I'm getting "Incorrect module response". I think my firmware might no support SJDL. What can I do here? I would really like to get this functionality working for me as MES has never worked for me on Windows 7

fongang's picture

Hello Guys.

Does this script work with the concept board?

fongang's picture

Yes it does work with the concept board. Finding the USB connection more stable under Linux

sponster's picture

There's a slight bug in this excellent code: if the CRC happens to have a leading 0, the CRC comparison fails. I've updated the matching code to account for this.

I've also added some code to support a default remote filename.


driveloc's picture

Very Great, works only under Python 2.7 ... but very fine...Danke

Jędrzej Gemalto Moderator