EG912U QuecOpen SPI & SPI_FLash

Hi Quectel team,

I have QuecPython EVB with EG912UGL_AA module.
I am evaluating the NorFlash connected on board as SPI6 interface to store the prepack files.
QFlashv7.4 shows the Errcode :262 while writing Prepack file.

Please find following for your reference to suggest the solution to resolve the error

QuecOPen version: LTE01R03A06

following code i entered in target config
#SPI6 NAND Flash
CONFIG_QUEC_PROJECT_FEATURE_SPI6_NAND_FLASH=n
CONFIG_QUEC_PROJECT_FEATURE_FS_NAND_FLASH=n
#SPI4 NAND Flash
CONFIG_QUEC_PROJECT_FEATURE_SPI_NAND_FLASH=n
#Boot SPI6
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI6_NAND=n

#SPI6 NOR FS
CONFIG_QUEC_PROJECT_FEATURE_SPI6_EXT_NOR_SFFS=y
CONFIG_QUEC_PROJECT_FEATURE_SPI4_EXT_NOR=n
CONFIG_QUEC_PROJECT_FEATURE_SPI_NOR_FLASH=y
#BOOT SPI6 NOR
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI6_EXTNSFFS=y

following code in quec_spi_nor_flash_prop.c
#ifndef DISABLE_W25Q32JW_FW
{
// W25Q32JWUUIQ

      .mid = 0x1660ef, // W25Q32JW
      .capacity = 0x400000,
      .mode = QUEC_NOR_FLASH_MODE_16BIT,
      .mount_start_addr = 0x0000000,
      .mount_size = 0x400000,
      .pb_size = 0x200,
      .eb_size = 0x1000,
  },

#endif

Anticipate your earliest guidance. Thank you

Hi,

Based on the information you shared and the EG912U series requirements, the Errcode: 262 seen in QFlash while writing the Prepack file is possibly caused by a NOR Flash configuration mismatch.

For EG912U series modules, the system reserves the first 0x80000 bytes (512 KB) of external SPI NOR Flash.
This region must not be used for mounting the file system.

Current configuration:

.mount_start_addr = 0x0000000,
.mount_size = 0x400000,

Mounting from address 0x0 conflicts with the reserved system area, which leads to Prepack write failure and results in Errcode: 262.

Required change:

.mount_start_addr = 0x80000,
.mount_size = 0x380000, // 0x400000 - 0x80000

This adjustment is mandatory for EG912U.

Although you modified quec_spi_nor_flash_prop.c, for 6-wire SPI NOR Flash, the SDK expects configuration to be aligned with:

hal_spi_flash_prop.csv
(Path: components/hal/src/)

Please ensure:

The MID 0x1660ef is correctly defined for W25Q32JW (this part is correct).

-All parameters match the SDK’s halSpiFlash_t structure.
-For W25Q32JW, sreg_block_size should be 256 bytes.
-Protection (wp_type) and UID parameters should also be consistent with the SDK defaults.

Any mismatch here may prevent QFlash from recognizing the flash layout correctly.

If the NOR Flash was previously used or mounting fails, format it before mounting:

ql_spi6_ext_nor_flash_sffs_mkfs();

Also, confirm that the EVB hardware is using SPI6 (6-wire) and that
quec_boot_spi6_pin_cfg_map in quec_boot_pin_map.c matches the actual wiring.

When using SPI6 NOR with Prepack, total file path + file name length ≤ 192 bytes. Exceeding this limit can also cause Prepack write failures.

Hope this helps!

Thanks!
Have a great day!

Best Regards,
Ananthan

Thank you Ananthan for quick and detailed response.

Please find following configuration and findings for your reference for further guidance.

File: (changed)
~\components\ql-kernel\drivers\quec_spi_nor_flash_prop.c
#ifndef DISABLE_W25Q32JW_FW
{
// W25Q32JWUUIQ

      .mid = 0x1660ef, // W25Q32JW
      .capacity = 0x400000,
                //.mode = QUEC_NOR_FLASH_MODE_8BIT,
                .mode = QUEC_NOR_FLASH_MODE_16BIT,
                .mount_start_addr = 0x80000,
                .mount_size = 0x380000,
                .pb_size = 0x200,
                .eb_size = 0x1000,
            }
        #endif

~\components\hal\src\hal_spi_flash_prop.csv
image

~\components\ql-kernel\boot_ex\quec_boot_pin_map.c

EVB - EG912UGL_AA (Board Schematic is not available)


Considering the tracks and pin_mux configuration Pretty sure it has SPI6 (there is only 1 flash_port with 6 wire interface)

Failed to program the Prepack file,
Prepack files removed and programmed the device with SDK’s Demo Program
~\components\ql-application\spi6_ext_nor_flash\spi6_ext_nor_flash_demo.c to execute ql_spi6_ext_nor_flash_sffs_mkfs();

Module keeps resetting - please find the Debug info for your reference

Your timely help appreciated,

Incase, possible request to provide latest SDK with all the required setup/ changes to use the EVB board’s NorFlash

Hi Tom,

Based on the current findings, the Errcode: 262 and the reset loop when running ql_spi6_ext_nor_flash_sffs_mkfs() are most likely caused by a pin multiplexing and initialization conflict, not by the NOR Flash size or partition settings.

On EG912U, SPI6 shares pins with the PCM (audio) interface. If any audio/PCM feature is enabled, it can conflict with SPI6 and cause crashes or resets.

Please ensure all audio / PCM features are disabled in target.config, for example:

CONFIG_QUEC_PROJECT_FEATURE_AUDIO=n
CONFIG_QUEC_PROJECT_FEATURE_PCM=n

If the SPI6 pins are not initialized correctly in quec_boot_pin_map.c, the flash MID may not be read correctly, which can lead to unstable SFFS mount and reset during mkfs().

Verify that quec_boot_spi6_pin_cfg_map matches the actual SPI6 wiring on the EVB.

Ensure that the flash parameters in hal_spi_flash_prop.csv match those in quec_spi_nor_flash_prop.c for W25Q32JW (MID: 0x1660ef).

Since the mount address and size were changed, the NOR Flash must be formatted once:

ql_spi6_ext_nor_flash_sffs_mkfs();

Do this only after the reset issue is resolved.

Make sure the total file path + file name length is less than 192 bytes. The issue is most likely due to SPI6 pin conflict with PCM/audio or incorrect SPI6 pin initialization at boot. Once this is fixed, the reset loop should stop and Prepack programming should work normally.

Please try the above and let us know the result.

Thanks!
Have a great day!

Best Regards,
Ananthan

Hi, Ananthan,

In Earlier post i provided screenshot for all settings for your reference and rechecking.

I Disabled Audio in target.config - but result didn’t changed, there is some thing a miss. Request to give your precious time to refer all the screenshots and check incase anything missed.

As stated earlier Quectel doesn’t provided schematic for EVB - all the settings done as per the EG912U reference design available on Quectel website

Being from Quectel support team - incase you have access to EVB schematic - request to provide the same

Hi Ananthan,

After configuring Audio=n
It doesn’t compile – refer the error as attached

Hi Tom,

The errors are happening because Audio is disabled in the kernel config, but your application code is still trying to use audio functions.

When you set Audio = n in target.config, the audio implementation is removed. However, the app side is still linking audio-related code, so the linker fails.

Try to disable Audio on the App side as well

File path:
components/ql-application/ql_app_feature_config.cmake

Set Audio to OFF:

option(QL_APP_FEATURE_AUDIO “Enable AUDIO” OFF)

Make sure no audio init is called in the app

File path:
components/ql-application/init/ql_init.c

Ensure ql_audio_app_init() is removed or wrapped with the audio feature macro. Once Audio is OFF, this code will be skipped automatically.

Do a clean rebuild. After changing config files, a clean build is required.

Thanks!
Have a great day!

Best Regards,
Ananthan