Need to find the CRC/Checksum for the Existing QN9080 Application

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need to find the CRC/Checksum for the Existing QN9080 Application

2,529 Views
James5427
Contributor II

Hi,

We are working on the QN9080C chip. We are programming source code successfully through OTAP and J-Link. Now in software, we need to find the CRC or Checksum for the running application from the Start address to the End address to verify whether OTAP programmed code is the same or not. For that, need clarity on which address the OTAP code will be placed for the first time and the second time.
I found that the QN9080C flash size is 512KB then they are segmented into two blocks with each 256KB size. As mentioned below in the 2.1 section of AN12970 reference document:

"1. By default, the KW38 flash memory is partitioned in three main regions:
• One 256 KB Program Flash array (P-Flash) divided into 2 KB sectors with a flash address range from 0x0000_0000 to 0x0003_FFFF.
• One 256 KB FlexNVM array divided in 2 KB sectors with address range from 0x1000_0000 to 0x1003_FFFF.
• Alias memory with address range from 0x0004_0000 to 0x0007_FFFF. Writing or reading at the Alias range address modifies or returns the FlexNVM content respectively."

From the above information, at which location (Start address) my code/application will be stored/placed? If not, how can I get the Exact Program start address to calculate the code or application CRC/Checksum. Anyone help us to meet the requirement?

Any help would be very thankful 


Thanks & Regards
QN9080 Memory 2023-07-31.png
On chip memory 2023-07-31 185205.png

Tags (1)
0 Kudos
Reply
6 Replies

819 Views
James5427
Contributor II

Hi, Please go through the below sizes. Hope this help to meet our requirements.

 

NVMSectorCountLink = DEFINED(gNVMSectorCountLink_d) ? gNVMSectorCountLink_d : ( DEFINED(gUseNVMLink_d) ? 4 : 0 );

m_flash_size = 0x00080000;
m_sector_size = 2048; /* 2k */

NV_STORAGE_SIZE = NVMSectorCountLink * m_sector_size;

m_reserved_flash_start =  m_flash_size - 3 * m_sector_size;
NV_STORAGE_END_ADDRESS =  m_reserved_flash_start - 1;
NV_STORAGE_START_ADDRESS =  NV_STORAGE_END_ADDRESS - NV_STORAGE_SIZE + 1;
INT_STORAGE_END =  NV_STORAGE_START_ADDRESS - 1;
INT_STORAGE_START =  INT_STORAGE_END - INT_STORAGE_SIZE + 1;

Any help would be very Thankful,

0 Kudos
Reply

2,501 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello,

 

Hope you are doing well. My name is Ricardo and I have been assigned this case.

Could you please clarify what are you trying to achieve with this? The OTAP application checks if the imaged received is newer, and then proceed to update the image.

But, for the memory question, you could check the QN908XC_connectivity.ld file. There you can find the memory layout for the flash.

 

Regards,

Ricardo

0 Kudos
Reply

2,453 Views
James5427
Contributor II

Thank you for the reply @Ricardo_Zamora ,

We need to verify whether the OTAP was successfully done or not with the new .srec file. I think .bin or .hex file is having the checksum but we need to calculate the checksum in code based on the Start Address location.

So, My main requirement here is to know from which address (exact address) the new .srec (OTAP file) start loading and till the end address. Please check the Attached images having the addresses in "QN908XC_connectivity.ld file" suggested by you.

Could you please help us to meet the requirement?

 

Thanks & Regards
Vamshi

0 Kudos
Reply

2,426 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hello Vamshi,

 

As the main requirement is to check if the OTAP process was done successfully, you could check the otapClientAppData_t information, such as the state, currentImgId, currentImgVer, imgId, etc.

Also, you can find there the imgComputedCrc and the imgReceivedCrc.

 

Hope this helps!

 

Regards,

Ricardo

0 Kudos
Reply

2,418 Views
James5427
Contributor II

Hi @Ricardo_Zamora ,

I accept your suggestion. But please have a glance at our requirement "I need to calculate checksum definitely as our customer needs it". I can see "imgComputedCrc and the imgReceivedCrc" but at the same time I will use those to verify my calculated CRC with the "imgComputedCrc and the imgReceivedCrc".
So, please share the OTAP Application Start and End address details from the attached images previously.

0 Kudos
Reply

2,374 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hi,

 

As you were able to see, the OTAP Internal Storage is defined on the QN908XC_connectivity.ld file. Please help us check the INT_STORAGE_START and the INT_STORAGE_END.

 

Regards,

Ricardo

0 Kudos
Reply