In QN908x how to keep the configured NVDS data untouched while reloading firmware

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

In QN908x how to keep the configured NVDS data untouched while reloading firmware

1,757 Views
kishansaralaya
Contributor III

After saving the configured NVDS data tag values in the QN908x Flash when we reflash the firmware using QN908x programming tool - SWD Download option (where we un-check "Download NVDS File") previously saved NVDS data gets erased. Since our customized product have only SWD interface is there way to keep the NVDS data values untouched while reloading the firmware. 

It will be very helpful if anyone here can point me to a document which explains the firmware loading with respect to NVDS data, chipmode etc.

Labels (1)
  • QN

8 Replies

1,602 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Kishan,

I hope you are doing great.

How are you checking if the tool is changing the values that you previously have?

For programming, the NVDS you could modify the values in your code and be sure that you want it at the beginning or you can use reading out values using the NVDS Configurator.

Regards,

Mario

0 Kudos

1,602 Views
kishansaralaya
Contributor III

Hi Mario, 

Am doing good, hope the same on your side.

In my code if the BLE Friendly name NVDS tag value is empty then the firmware will write NVDS magic word along with all the other default NVDS tag values ( like MAC address , BLE NAME, XTAL values etc). And after this every time when we turn on the BLE controller we could see the updated BLE friendly name and other field values.  
In  board.c file under hardware_init() method: 

if (NVDS_OK == nvds_init((uint8_t *) CFG_NVDS_ADDRESS, CFG_NVDS_SIZE,
(uint8_t *) CFG_NVDS_BACKUP_ADDRESS, NULL, &gFlashConfig)) {

     NVDS_SetLoadCaps();         
} else {

    // here WRITE New set of NVDS Tag values.

}


When we reload the firmware using the USB mode all the previously written NVDS values gets erased, which we come to know by looking at the newly set BLE MAC and friendly name. 

If we use the Debug Flash tool to load (first time) and to reload also then the NVDS values not gets modified. It will be helpful to know is there any setting we need to follow in order to keep the NVDS data untouched while reloading the firmware through USB. 

Underproject setting -> MCU Linker setting we set "--defsym=gEraseNVMLink_d=0

Regards,

 kishan

0 Kudos

1,602 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Kishan,

The NVDS is a section of memory that the code could access with specific APIs, get/put/erase. However, the Programming Tool could access to this specific memory through the ISP commands.

What do you mean with the Debug Flash Tool?

I am sorry. I want to understand the process that you are doing. Did you read out the using JLink commander or using the NVDS Configurator?

Regards,

Mario

0 Kudos

1,602 Views
kishansaralaya
Contributor III

HI Mario ,

 Debug Flash Tool which am referring here is the GUI Flash Tool.

pastedImage_1.png

The Process we are following to load firmware is : 
 1. Our board has only SWD interface. 
 2. We use the JTAG connector cable - where one end is connected to the Debug Connector of the NXP 908x Development  Board. The other end of the cable is connected to the SWD_CLK, RST_N, SWD_IO, Vcc and GND pin of the customized board with QN908x.
3. Now using the "QN908x Programming Tool" we are load the firmware and NVDS files and the other way is use the "GUI Flash Tool" to load the firmware.  

When we use the QN908x Programming Tool even if we uncheck  NVDS file load option as shown below : 
pastedImage_2.png

Stored NVDS tag values gets erased. 

I have not used J-Link Commander, will take look into that. Can you help me in two things:
 1. Even after unchecking the Download NVDS File why the stored NVDS tag values getting Erassed. 
 2. How J-Link commander will help here.

Regards , 

 kishan

0 Kudos

1,602 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Kishan,

The Programming Tool is using the SWD interface and it is erasing all the memory. 

I recommend 2 options for programming the QN908x without erasing the NVDS data.

1. You could use the GUI Flash Tool, programming the bin file. I tested by my side and it is not erasing the NVDS.

2. You could use the ISP programming option in QN908x programming tool

Regards,

Mario

0 Kudos

1,602 Views
kishansaralaya
Contributor III

Thank you Mario for the update. 
 But what am not able to comprehend here is GUI Flash Tool also uses the SWD interface to load the firmware so why its erasing the NVDS data even when we don't select the NVDS file.

Unfortunately in our hardware project ISP interface is not exposed to the end user, only SWD interface is available.


Regards, 
 kishan
 

1,602 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Kishan,

Our Programming tool is sending a Mass Erase through the SWD.

I suggest programming your device using the Jlink commander or you could use the J-Flash to achieve this.

You have to avoid the mass erase.

Regards,

Mario

1,602 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Kishan,

I have been replicated your issue.

I am working on it. I will get back to you as soon as possible.

Regards,

Mario

0 Kudos