Bug #3850

programming of 3 digit MNC does not work

Added by dexter 3 months ago. Updated 2 months ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


While programming 3 digit MCC + 2 digit MNC works flawlessly, problems are experienced when the MNC is extended to 3 digits (which is spec compliant!).

One can use the attached script to generate a problematic card. See mksim_sjs1_three_digit_mnc.log for the expected output. The programming works fine and the output also does not show any suspicious behavior. However, when the card is inserted into a phone, the phone seems not to recognize the third digit of the MNC and the digit is chopped off.

The origin of this problem is presumably the way how MCC and MNC are programmed into the sysmo-usim-sjs1. The only way how the sim gets informed about MNC/MCC is the IMSI string. This means for the sim there is no way of knowing if the third digit of the MCC is actually part of the MCC or just the first digit of the consecutive part of the IMSI. Presumbably one needs to write MNC/MCC to some other file as well or set a flag somewhere. This needs to be checked further.

mksim_sjs1_three_digit_mnc.log mksim_sjs1_three_digit_mnc.log 1.15 KB dexter, 03/20/2019 12:01 PM 321 Bytes dexter, 03/20/2019 12:01 PM


#1 Updated by dexter 3 months ago

  • Status changed from New to In Progress

The files EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT were not programmed for sysmo-usim-sjs1 for some reason. I thought that would also add the necessary information to the SIM, but apparently it did not help, the phone keeps showing the wrong MCC/MNC combination.

See also: commands: correct case of a TLV tag (A5 => a5) cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT and ...

Since PLMN are now added, one could check if it is just a display problem or if even the LU has problems.

#2 Updated by dexter 3 months ago

  • Status changed from In Progress to New

I think I managed to pinpoint the problem, there is an EF.AD that controls the length of the MNC. We never update this file during the programming process, so the length of the MNC stays always at 2. See also: 3GPP 31.102 section 4.2.18

#3 Updated by dexter 3 months ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 90

I have now integrated updating of the length field in the EF.AD file. There is now a patch in gerrit: sysmo-usim-sjs1: update EF.AD with correct MNC length

(sysmo-usim-tool also got updated and now supports setting of the length field as well)

#4 Updated by dexter 2 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)