Prepacking Audio files in External Nor Flash

I am using EC200U-CNAA with SDK Version LTE01R03A04
I have connected W25Q128 Nor flash SPI and it’s responding well with the Demo Program.
I am looking at the solutions where i can store the audio files into Ext SPI Nor Flash at the time of compilation using Prepack.json file
Is it possible to achieve solution for the same?

Hi @Inventor_TM,
If you know which json file it is then it should be pretty straightforward to you. Assuming your NOR flash is in 4-wire mode, the drive prefix would be /ext4n/.

Hi Victor.W,

Thank you for the response.
I tried as per your suggestion, yes i have connected Nor flash to Pin 37,38,39 & 40

image

and compiled successfully. During downloading merge.pac using Qflash6.9 getting the error at Prepack downloading operation

Secondly,
I am using UFS:Simerr.mp3 (syntax) to play file on module
what syntax i shall write to play the file from ext Nor flash

Hi Victor,

Request to provide the solution for the error i am facing.

Is there any specific configuration changes to be adopted? please guide.

Are you able to prepack the file to the UFS only? And how big is your MP3 file?

I am able to prepack file to the UFS as (β€œ/users/welcome.mp3”) - Downloading to chip and play the file successfully.

I am able to prepack file to the (β€œ/ext4n/welcome.mp3”) - Downloading to chip fails
The file welcome.mp3 is of 4.5KB

I have multiple files which needs to be uploaded - min size 1KB and max. size 24KB

Thanks for the info!
To prepack file to NOR flash you’ll also need to turn the prepacking on at components\bootloader\src\boot_fdl_dnld.c. Search for ql_boot_spi4_nor_flash_init() and enable that block of code.
And are you using the GNSS function on the module? The SPI pins are different and depends on GNSS is enabled or not.

Hi - Thank you for response,

This is to confirm that i ma not using GNSS and i can access Nor Flash read and Write functions with the SDK’s demo program.

To follow your instructions i changed following in the file components\bootloader\src\boot_fdl_dnld.c

I have not found the entry to enable the feature in the file \components\ql-application\ql_app_feature_config.cmake : so i written #define CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI4_EXTNSFFS in the same file to try (you can let me know from where i can enable this feature)

I have enabled the block as instructed by you.

while building the file facing the error as follows.

Waiting for your guidance to resolve the error.

Thank you for the detailed information!
Please don’t define the macro yourself, the feature is configured in components\ql-config\build\EC200UCN_AA\8915DM_cat1_open\target.config.
To enable the feature, add the following config:

#SPI4 NOR FS
CONFIG_QUEC_PROJECT_FEATURE_SPI4_EXT_NOR_SFFS=y
CONFIG_QUEC_PROJECT_FEATURE_SPI6_EXT_NOR=n
CONFIG_QUEC_PROJECT_FEATURE_SPI_NOR_FLASH=y
#BOOT SPI4 NOR
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI4_EXTNSFFS=y

Then build clean and build new.
If some error about flash overflow occurs, add the following config as well:

#Disable FAT & SD in bootloader, saves space
CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SDMMC=n

If it still overflows, add the following config:

#Others
CONFIG_QUEC_PROJECT_FEATURE_BOOT_EMMC=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_LCD=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_LED=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_ADC=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SCATTER=n

Remember to use the β€œnew” build option everytime you change the config.

HI - Victor,

Thank you for guidance.

But something still missing - i am still getting the error at the time of download

Please go through the below list of configuration while compiling, is there any feature which is not ON / disabled is creating the error.

– QL_APP_FEATURE_FTP ON
– QL_APP_FEATURE_HTTP ON
– FEATURE MMS is disabled at core!
– QL_APP_FEATURE_MMS OFF
– QL_APP_FEATURE_MQTT ON
– FIREWALL is disabled at core!
– QL_APP_FEATURE_FIREWALL OFF
– QL_APP_FEATURE_SSL ON
– QL_APP_FEATURE_PING ON
– QL_APP_FEATURE_NTP ON
– QL_APP_FEATURE_ALI_LINKSDK ON
– QL_APP_FEATURE_QCLOUD_IOT ON
– QL_APP_FEATURE_LBS ON
– FEATURE QTHSDK is disabled at core!
– QL_APP_FEATURE_QTHSDK OFF
– QL_APP_FEATURE_SOCKET ON
– FEATURE ALIOTSMARTCARD is disabled at core!
– QL_APP_FEATURE_ALIOTSMARTCARD OFF
– FEATURE CTSREG is disabled at core!
– QL_APP_FEATURE_CTSREG OFF
– QL_APP_FEATURE_FILE ON
– FEATURE FILE_ZIP is disabled at core!
– QL_APP_FEATURE_FILE_ZIP OFF
– QL_APP_FEATURE_AUDIO ON
– QL_APP_FEATURE_AUDIO_RECORD ON
– FEATURE HEADSET_DET is disabled at core!
– QL_APP_FEATURE_HEADSET_DET OFF
– QL_APP_FEATURE_TTS ON
– QL_APP_FEATURE_EXT_CODEC ON
– QL_APP_FEATURE_WIFISCAN ON
– QL_APP_FEATURE_BT ON
– QL_APP_FEATURE_BT_HFP ON
– QL_APP_FEATURE_BT_SPP ON
– FEATURE BT A2DP & AVRCP is disabled at core!
– QL_APP_FEATURE_BT_A2DP_AVRCP OFF
– QL_APP_FEATURE_BLE_GATT ON
– QL_APP_FEATURE_GNSS ON
– QL_APP_FEATURE_LCD ON
– QL_APP_FEATURE_LVGL ON
– FEATURE MIPI LCD is disabled at core!
– QL_APP_FEATURE_MIPI_LCD OFF
– QL_APP_FEATURE_CAMERA ON
– QL_APP_FEATURE_SIM ON
– FEATURE VSIM ADAPT is disabled at core!
– QL_APP_FEATURE_VSIM_ADAPT OFF
– FEATURE DOUBLE SIM is disabled at core!
– QL_APP_FEATURE_DSIM OFF
– FEATURE DSSS is disabled at core!
– QL_APP_FEATURE_DSSS OFF
– FEATURE PBK is disabled at core!
– QL_APP_FEATURE_PBK OFF
– FEATURE STK is disabled at core!
– QL_APP_FEATURE_STK OFF
– QL_APP_FEATURE_SMS ON
– QL_APP_FEATURE_VOICE_CALL ON
– FEATURE VoLTE is disabled at core!
– QL_APP_FEATURE_VOLTE OFF
– QL_APP_FEATURE_SPI ON
– QL_APP_FEATURE_SPI_NOR_FLASH ON
– FEATURE SPI4_EXT_NOR_SFFS is disabled at core!
– QL_APP_FEATURE_SPI4_EXT_NOR_SFFS OFF
– QL_APP_FEATURE_SPI6_EXT_NOR ON
– QL_APP_FEATURE_SPI_NAND_FLASH ON
– FEATURE SPI6_NAND_FLASH is disabled at core!
– QL_APP_FEATURE_SPI6_NAND_FLASH OFF
– QL_APP_FEATURE_UART ON
– QL_APP_FEATURE_RS485 ON
– QL_APP_FEATURE_LEDCFG ON
– QL_APP_FEATURE_KEYPAD ON
– QL_APP_FEATURE_DECODER ON
– QL_APP_FEATURE_APP_IMG_AT ON
– QL_APP_FEATURE_RTC ON
– QL_APP_FEATURE_SECURE_BOOT OFF
– QL_APP_FEATURE_USB_CHARGE ON
– QL_APP_FEATURE_VIRT_AT ON
– QL_APP_FEATURE_I2C ON
– QL_APP_FEATURE_USB ON
– QL_APP_FEATURE_HTTP_FOTA ON
– QL_APP_FEATURE_FTP_FOTA ON
– QL_APP_FEATURE_JAMDET ON
– QL_APP_FEATURE_SDMMC ON
– QL_APP_FEATURE_PWK ON
– FEATURE USBNET is disabled at core!
– QL_APP_FEATURE_USBNET OFF
– FEATURE FS_NAND_FLASH is disabled at core!
– QL_APP_FEATURE_FS_NAND_FLASH OFF
– FEATURE FS_NOR_FLASH is disabled at core!
– QL_APP_FEATURE_FS_NOR_FLASH OFF
– FEATURE SFTP is disabled at core!
– QL_APP_FEATURE_SFTP OFF
– QL_APP_FEATURE_MXML ON
– FEATURE EMBED NOR FLASH is disabled at core!
– QL_APP_FEATURE_EMBED_NOR_FLASH OFF
– FEATURE CLOUDOTA is disabled at core!
– QL_APP_FEATURE_CLOUDOTA OFF
– QL_APP_FEATURE_HILINK ON
– FEATURE GPRS_DATA_TRANSFER is disabled at core!
– QL_APP_FEATURE_GPRS_DATA_TRANSFER OFF
– QL_APP_FEATURE_PSM ON
– FEATURE TP is disabled at core!
– QL_APP_FEATURE_TP OFF
– FEATURE ALIPAY_IOT_SDK is disabled at core!
– QL_APP_FEATURE_ALIPAY_IOT_SDK OFF
– FEATURE NTRIP_RTK is disabled at core!
– QL_APP_FEATURE_NTRIP_RTK OFF
– FEATURE WEBSOCKET is disabled at core!
– QL_APP_FEATURE_WEBSOCKET OFF
– FEATURE LWM2M is disabled at core!
– QL_APP_FEATURE_LWM2M OFF
– FEATURE SS is disabled at core!
– QL_APP_FEATURE_SS OFF
– FEATURE ETHERNET is disabled at core!
– QL_APP_FEATURE_ETHERNET OFF
– FEATURE WIFI is disabled at core!
– QL_APP_FEATURE_WIFI OFF
– QL_APP_PACK_FILE ON @ components/ql-config/download/prepack/ql_prepack_tts_gps.json

waiting for your valued response

QL_APP_FEATURE_SPI4_EXT_NOR_SFFS needs to be on but it’s off.

If it doesn’t work, just copy my config:

#MTP/MSG
CONFIG_QUEC_PROJECT_FEATURE_USB_MASS_STORAGE=n

#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

#SPI4 NOR FS
CONFIG_QUEC_PROJECT_FEATURE_SPI4_EXT_NOR_SFFS=y
CONFIG_QUEC_PROJECT_FEATURE_SPI6_EXT_NOR=n

CONFIG_QUEC_PROJECT_FEATURE_SPI_NOR_FLASH=y

#BOOT SPI4 NOR
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI4_EXTNSFFS=y

#Disable FAT, saves space
CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SDMMC=n
#Others
CONFIG_QUEC_PROJECT_FEATURE_BOOT_EMMC=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_LCD=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_LED=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_ADC=n
CONFIG_QUEC_PROJECT_FEATURE_BOOT_SCATTER=n

#LibWebsocket
CONFIG_QUEC_PROJECT_FEATURE_WEBSOCKET=n

CONFIG_QUEC_PROJECT_FEATURE_SMS_AT=n

#SFTP
CONFIG_QUEC_PROJECT_FEATURE_SSH2=n
CONFIG_QUEC_PROJECT_FEATURE_FTP=n

#Wi-Fi, feature SPI needed for any SPI application as well!
CONFIG_QUEC_PROJECT_FEATURE_SPI=y
CONFIG_QUEC_PROJECT_FEATURE_WIFI=n

#USSD
CONFIG_QUEC_PROJECT_FEATURE_SS=n

CONFIG_QUEC_PROJECT_FEATURE_FTP=n

Hi - Victor thank you for sharing your configuration.

After suggested changes i am able to compile, download and execute the code and play MP3 file stored in the Ext_nor_Flash.

Currently, I am prepacking the file as /ext4n/audio.mp3 and playing the file as EXTNSFFS:audio.mp3 successfully.

can we prepack the file in folder and play the file?

I tried prepacking as /ext4n/en/audio.mp3 - able to compile and download in the module successfully but while playback as EXTNSFFS:en/audio.mp3 // EXTNSFFS:/en/audio.mp3 - Playback fails.

Hi @Inventor_TM
Is the file actually there? Can you get the error code of the audio play API?

HI Victor,
I located syntax error in my application code.

Now able to store and play the file from the folder.

Thank you for your support to resolve at every stage of the subject topic.

1 Like