OSA_InterruptDisable();vTaskSuspendAll();FLASH_Init(FLASH);int err_code ;err_code = FLASH_ErasePages(FLASH, FLASH_START_PAGE, 1);if(err_code == kStatus_FLASH_Success){PRINTF(" kStatus_FLASH_Success");}uint32_t au32Data[sizeof(struct generic_beacon_cota_param_t)];for (uint32_t i = 0; i < sizeof(struct generic_beacon_cota_param_t); i++){au32Data[i] = 0x99;//(uint32_t)(rand());}err_code = FLASH_Program(FLASH,bcn_cota_params_addr,&au32Data,sizeof(struct generic_beacon_cota_param_t));if(err_code == kStatus_FLASH_Success){PRINTF(" kStatus_FLASH_Success");}OSA_InterruptEnable();xTaskResumeAll();
OSA_InterruptDisable();vTaskSuspendAll();uint32_t temp[4];uint32_t readData[sizeof(struct generic_beacon_cota_param_t)] = {0};PRINTF(" Pre Process Data : ");for(uint32_t i = 0;i < sizeof(struct generic_beacon_cota_param_t);i += 4){FLASH_Read(FLASH, (uint8_t *)(bcn_cota_params_addr + i), 0, (uint32_t *)temp);memcpy(&readData[i], (void *)temp, sizeof(temp));PRINTF("%02x ",readData[i]);}OSA_InterruptEnable();xTaskResumeAll();Output :Output: Before Soft ResetPre Process Data : 99 99 99 99 99 99 99 99 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00Output: After Soft ResetPre Process Data : f601dead dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdbdbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdbdbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb dbdbdbdb
Hello @HarishCS,
Hope you are doing well.
Could you please help us with more details about your application? What is its purpose?
What QN9090 SDK version are you using? Are you using any of the demo applications from the SDK as base for your development? If so, which one?
What is the flash region you are trying to write?
Regards,
Eduardo.
Hello @EduardoZamora
This Application uses BLE in it, SDK Version 2.6.5 , build on top of the example wireless UART. I am trying to Write in the Flash Region "0x0009B000"
Hi,
There should be a newer version of the QN9090 SDK, you can download the latest version from the MCUXpresso SDK Builder.
Have you tested the driver_examples > flash_demo without modifications? Do you observe the same behavior described in this post? Please, compare your read/write procedure with the one from the flash_demo application.
By any chance, is gAppUseNvm_d set to 1 in app_preinclude.h file?
Also, could you try the same procedure using another demo application from the SDK without BLE functionality as base?
As another test, you could try writing to another address outside the NVM region. Please, take a look at the src > connectivity.ld file for more information on the map of QN9090 FLASH.
Please, let me know your findings.
Regards,
Eduardo.