Set default modem binary MBN with PDC Tool for Qualcomm HS-USB WWAN Adapter for VoLTE, VoWiFi, VoNR, IMS

You may brick your phone. Do it on your own risk. Do the backup first:
Create an EFS backup in TWRP, OrangeFOX Recovery.
Do the QCN and XQCN backup before you begin.
QCN: QPST > Software download tool > Backup > save in QCN format
XQCN: QPST > QFIL > Tools > Backup and restore > save in XQCN forma
t

To enable VoLTE (voice over LTE), VoWiFi (voice over WiFi), VoNR (voice over new radio 5G) for unsupported carrier you can enable modem binary (MBN) file in PDC Tool for Qualcom devices.

To make that almost persistent you will have to edit “mcfg_sel_db.xml” and “mcfg_sel_db_ext.xml” files with EFS Explorer on NVRAM. On other brands it could be different files, Xiaomi, Oppo, Samsung, Huawei, Oneplus.

Phone is saving used SIM cards profiles by its ICCID number (16 or 20 numbers). It choose MBN only at the first time you insert SIM card. So you will have to remove the profile with EFS Explorer. You can check that reset mobile network in System > Reset will work. Without that modem will use profile choosed at the first time.

All the MBNs and the modem images with configuration files (ex. NON-HLOS.bin, modem.img) are usually signed. So you can read them but it is not possible to use flashed modified the image.

You can try to find signed MBNs file from similar device and try to insert to modem image. It should be signed from the same brand/manufacturer. I’m not sure about that. Do not forget to flash “modem_a” and “modem_b” on A/B devices. Modem images is just partitions image.

TIP: you should replace any existing MBN file and use its index in XML files. Do not try to add new one.

mkdir modem
sudo mount -o loop modem.img modem

Remember that MBN files has carrier configuration for modem. It usually includes:

  • IMS settings (VoLTE, VoWiFi, SMS over IMS)
  • APN profiles for data, MMS, IMS etc.
  • policies rules (which MCC/MNC triggers which profile)
  • Network feature flags (e.g., whether VoLTE is enabled)

Usually IMS APN is hidden (in most cases it has apn: ims and name: ims typ: ims), emergency one as well.

Tools

Install QPST Tool and Qualcom Drivers first.

Enable MBN profile with PDC Tool

First you need have to find working profile for you SIM Card. We will try different MBN profiles with PDC Tool. First have to disable current Active profile, set different one and Active it.

Remember the order:

  1. Disable Active profile
  2. Set different profile
  3. Click Activate

When you get error “PDC: QueryGetConfigInfo failed with Gobi error code: 16 (Malformet QMI response received)” you should restart PDC Tool. It may be necessary to restart PDC Tool after every change.

Usually Sub0 is for SIM slot 1 and Sub1 form SIM slot #2. Notice esim may use sub2.

  1. Install QPST tools and Qualcomm drivers
  2. Enable ADB Debugging in Developer Settings
  3. Enter to diag mode:
    adb shell
    su
    setprop sys.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb
    (reconnect USB and repeat commands)
    adb shell
    su
    setprop sys.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb

  4. Run PDC Tool as admin.
  5. Choose from list: Qualcomm HS-USB WWAN Adapter 90XX. It may hang for some time.
    WARN: never disable HW Type in PDC Tool
  6. In this example ROW_Commercial is active. Click right on ROW_Commerical > Deactivate > SubX.
  7. Choose different profile from list, SetSelectedConfig > SubX. It should change status to Pending
  8. On the bottom click Activate
  9. New profile should be active for choosen SubX
  10. Check in dialer IMS, and VoLTE status using code: *#*#4636#*#* (*#*#INFO#*#*). Click 3 dots in right top corner > IMS Service Status
    IMS Registration Registered
    Voice over LTE: Available
  11. Yoo will have to enable VoLTE in mobile sim card settings. Sometimes you have to use this codes to enable this options:
    VoLTE *#*#86583#*#*
    VoWIFI *#*#869434#*#*
  12. Remember the profile which works and try to make i permanent change.

Set default MBN profile for your sim card

  1. You have to get MCC (Mobile Country Code): XXX and MNC (Mobile Network Code): YY of your sim card with command:
    adb shell getprop gsm.sim.operator.numeric
  2. Get ICCID number of your sim card (16 or 20 digits)
  3. Run diag mode
  4. Run EFS Explorer, go to /nv/item_files/mcfg/ and “Copy Data File to Pc” files: mcfg_sel_db.xml
    mcfg_sel_db_ext.xml
  5. Search in both files first 6 digits of ICCID or MCC and MNC in format XXX-YY
  6. If you find any of it you will have to replace mcfg_carrier_index=”ZZZ” with working one from PDC Tool
  7. Search for name in carrier_name=”XYZ”, read index:
    mcfg_carrier_index=”160″
  8. Replace this index number under your carrier <SelRecord /> in <if></if> block
  9. In case you card choose ROW (rest of the world) and you cannot find you imsi or MNC-MCC you can simply find working MBN profile from PDC Tool and add your MCC,MNC to it:
  10. Save file and in EFS Explorer right click > Copy DataFile from PC.
  11. Now you should remove sim cards from phone
  12. Remove saved SIM Cards profile in EFS Explorer
    just remove all files in (or you can remove only your card, it can mess with esim)
    /nv/item_files/mcfg/cards/*
    You can try System > Reset > Reset mobile settings. But i cannot guarantee it will work.
  13. Put your sim cards again. Now it should choose correct mbn profile based on changes in xml files.
  14. Modem choose mbn profile only once for new sim card and save it. After every change of xml file you will have to remove you sim card and file in /nv/item_files/mcfg/cards/

Now it should work after every restart of the phone.

Replace battery in Leifheit Dry & Clean 51000 3.7V

There is two versions of BFN18650 1S1P batteries in Leifheit Dry & Clean:

  • 3.7V 1800mAh – Li-Ion
  • 3.2V – probably LiFePo4 (Li-Po)

Check voltage on device:
Leifheit Dry Clean 51000 Battery 3.7V

Both are 18650 1S1P size. You have to buy version without extra protection pcb because it won’t fit.

If you would like to replace the battery just open case in left back corner. Disconnect the old one and solder connector to the new one.


You can use NCR18650B 3.7V with extra connector it is easy to solder:

trim fucked up my data on Crucial SSD

As always after upgrade Windows 10 it won’t boot. So as always I recreate the boot partitions by deleting them and create new one.

This time I have deleted by mistake my system partition, don’t worry just repair partition table. Then I have restored it. All files was OK.

First boot take a lot of time but finally I saw my desktop. After minute icons on my dekstop started disappearing. I shut down my system because i thought it is ransomware or something.

Recovery software shows all files is OK. MFT looks fine so i have restored them all.

Every restored file is full of null! That has to be trim fault.

SSD did not notice that I restored my partition and trim rewrite it with zero.

There is Crucial BX300 240GB SSD stats:

Cannot install MTP Device and cannot find wpdmtp.inf

On Windows versions N and KN there is no Media Feature Pack. MTP and PTP dirvers (wpdmtp.inf) is included in this pack.

Without it you cant send files to and from the Android phone.

Media Feature Pack for N and KN versions of Windows 10 (choose your language)
https://www.microsoft.com/en-us/software-download/mediafeaturepack
or
https://www.microsoft.com/en-US/download/details.aspx?id=48231

Unrecognized device in PTP mode:
USB\VID_2717&PID_FF18&REV_0223&MI_00
USB\VID_2717&PID_FF18&MI_00

Unrecognized device in MTP mode:
USB\VID_2717&PID_FF48&REV_0223&MI_00
USB\VID_2717&PID_FF48&MI_00

Arduino Nano with ATmega 328PB and Arduino IDE support

I did not notice that i bought Arduino clone with ATmega328PB not with the ATmega328P, there is CH340C USB-UART chip. 328PB version is newer chip, some kind better than old.

Main disadvantage that chip is not supported by Arduino IDE and it came with unsupported bootloader to load sketches via Arduino IDE (even with added support to 328PB).

I tried to flash new bootloader via USBasp but i can’t change fuse bits. Fuses stays as it was!
avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0xff
avrdude: verification error; content mismatch

Somehow i have disabled SPIEN (it enable serial programming and data downloading) and i could not program it via ICSP anymore. I got error but 328pb will be alive:
avrdude: auto set sck period (because given equals null)
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.

Recover atmega 328 fuse bits

I have MiniPro Tl866 programmer that support atmega 328p programming. It not support 328PB, it has difference timings for programing but it works if you choose 328P.

But i could set fuse bits! You have to connect all pins like on scheme down below.

Then before you click program you have to connect XTAL1(PIN9) to pin 7 and XTAL2(PIN10) to pin 8 of 328PB (you have to touch it with small wires for 100ms of programming, do not need to solder).

Uncheck check ID. Set Config an click Programm with checked Config fuse bits and Lock bits:


Now we have to flash bootloader.

328pb Arduino IDE support and bootloader

We will use MiniCore that supports 328PB chip. On Arduino IDE 1.8.7 we can add support for this board in easy way. Open File > Preferences and add extra url for Board Manager:
https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json
Then go to Tools > Board > Board Manager and install MiniCore by MCUdude.

Now we can choose our board in tools:
Board: Atmega328
Bootloader: Yes
Clock: 16MHz external
BOD: 2.7v
Compiler LTO: Disabled (you can enable it if you need)
Variant: 328PB

Connect your programmer (i’m using usbasp) and choose Burn Bootloader.

Done, now you can write sketches via usb!

If something is still wrong you should set fuse by tl866 again or try this: For example open boards.txt from “C:\Users\user\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.1”
change
328.bootloader.unlock_bits=0x3f
to
328.bootloader.unlock_bits=0xff
Save & close the file.

You can use minicore for all 328p boards as well!

Done. Now we have fully functional 328PB with Arduino IDE.